Source:
private void testAddTemplateQuestionAction() throws Exception { ______TS("add template question action success"); feedbackEditPage.clickTemplateQuestionPanel(1); feedbackEditPage.clickTemplateQuestionPanel(2); feedbackEditPage.clickTemplateQuestionPanel(3); feedbackEditPage.clickTemplateQuestionPanel(4); feedbackEditPage.clickTemplateQuestionPanel(5); feedbackEditPage.verifyHtmlPart(By.id("addTemplateQuestionModal"), "/instructorFeedbackTemplateQuestionExpandedModal.html"); feedbackEditPage.clickTemplateQuestionModalCheckBox(1); assertTrue("Can click after selecting a question", feedbackEditPage.isAddTemplateQuestionButtonEnabled()); feedbackEditPage.clickAddTemplateQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 2)); feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackTemplateQuestionAddSuccess.html"); ______TS("add multiple template questions success"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.clickTemplateModalButton(); feedbackEditPage.clickTemplateQuestionModalCheckBox(2); feedbackEditPage.clickTemplateQuestionModalCheckBox(3); feedbackEditPage.clickAddTemplateQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( Const.StatusMessages.FEEDBACK_QUESTION_ADDED_MULTIPLE); assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 4)); String questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 4).getId(); BackDoor.deleteFeedbackQuestion(questionId); questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 3).getId(); BackDoor.deleteFeedbackQuestion(questionId); questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 2).getId(); BackDoor.deleteFeedbackQuestion(questionId); }

Target:
private void testAddTemplateQuestionAction() throws Exception { ______TS("add template question action success"); feedbackEditPage.clickTemplateQuestionPanel(1); assertTrue(feedbackEditPage.isTemplateQuestionPanelExpanded(1)); assertFalse("Cannot click before selecting a question", feedbackEditPage.isAddTemplateQuestionButtonEnabled()); feedbackEditPage.clickTemplateQuestionModalCheckBox(1); assertTrue("Can click after selecting a question", feedbackEditPage.isAddTemplateQuestionButtonEnabled()); feedbackEditPage.clickAddTemplateQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 1)); feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackTemplateQuestionAddSuccess.html"); ______TS("add multiple template questions success"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.clickTemplateModalButton(); feedbackEditPage.clickTemplateQuestionModalCheckBox(2); feedbackEditPage.clickTemplateQuestionModalCheckBox(3); feedbackEditPage.clickAddTemplateQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( Const.StatusMessages.FEEDBACK_QUESTION_ADDED_MULTIPLE); assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 3)); }