Source:
private void testContent() throws Exception { ______TS("Awaiting session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Awaiting Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Awaiting Session", fq.getId()); submitPage .verifyHtml("/studentFeedbackQuestionSubmitPageAwaiting.html"); ______TS("Open session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Open Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); submitPage.verifyHtml("/studentFeedbackQuestionSubmitPageOpen.html"); ______TS("Grace period session"); FeedbackSessionAttributes fs = BackDoor.getFeedbackSession( "SFQSubmitUiT.CS2104", "Open Session"); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); Calendar endDate = GregorianCalendar.getInstance(TimeZone .getTimeZone("UTC")); fs.timeZone = 0; endDate.add(Calendar.MINUTE, -1); fs.endTime = endDate.getTime(); fs.gracePeriod = 10; BackDoor.editFeedbackSession(fs); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); WebElement submitButton = browser.driver.findElement(By .id("response_submit_button")); assertEquals(false, submitButton.isEnabled()); testData = loadDataBundle("/StudentFeedbackQuestionSubmitPageUiTest.json"); restoreTestDataOnServer(testData); ______TS("Closed) session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Closed Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Closed Session", fq.getId()); submitPage.verifyHtml("/studentFeedbackQuestionSubmitPageClosed.html"); }

Target:
private void testContent() throws Exception { ______TS("Awaiting session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Awaiting Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Awaiting Session", fq.getId()); submitPage.verifyHtml("/studentFeedbackQuestionSubmitPageAwaiting.html"); ______TS("Open session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Open Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); submitPage.verifyHtml("/studentFeedbackQuestionSubmitPageOpen.html"); ______TS("Grace period session"); FeedbackSessionAttributes fs = BackDoor.getFeedbackSession("SFQSubmitUiT.CS2104", "Open Session"); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); Calendar endDate = GregorianCalendar.getInstance(TimeZone.getTimeZone("UTC")); fs.timeZone = 0; endDate.add(Calendar.MINUTE, -1); fs.endTime = endDate.getTime(); fs.gracePeriod = 10; BackDoor.editFeedbackSession(fs); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice", "Open Session", fq.getId()); assertEquals(false, submitPage.getSubmitButton().isEnabled()); testData = loadDataBundle("/StudentFeedbackQuestionSubmitPageUiTest.json"); restoreTestDataOnServer(testData); ______TS("Closed) session"); fq = BackDoor.getFeedbackQuestion("SFQSubmitUiT.CS2104", "Closed Session", 1); submitPage = loginToStudentFeedbackQuestionSubmitPage("Alice","Closed Session", fq.getId()); submitPage.verifyHtml("/studentFeedbackQuestionSubmitPageClosed.html"); }