Source:
public void testInputValidation() { ______TS("empty options"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("ConstSum-option qn"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); feedbackEditPage.fillConstSumPointsBoxForNewQuestion(""); assertEquals("1", feedbackEditPage.getConstSumPointsBoxForNewQuestion()); feedbackEditPage.fillConstSumPointsForEachOptionBoxForNewQuestion(""); assertEquals("1", feedbackEditPage.getConstSumPointsForEachOptionBoxForNewQuestion()); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( "Too little options for Distribute points (among options) question. " + "Minimum number of options is: 2."); ______TS("remove when 1 left"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test const sum question"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); assertTrue(feedbackEditPage.verifyNewConstSumQuestionFormIsDisplayed()); feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(1); assertFalse(feedbackEditPage.isElementPresent("constSumOptionRow-1--1")); assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(0); assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( "Too little options for Distribute points (among options) question. " + "Minimum number of options is: 2."); ______TS("duplicate options"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test duplicate options"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); feedbackEditPage.fillConstSumOptionForNewQuestion(0, "duplicate option"); feedbackEditPage.fillConstSumOptionForNewQuestion(1, "duplicate option"); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( Const.FeedbackQuestion.CONST_SUM_ERROR_DUPLICATE_OPTIONS); }

Target:
public void testInputValidation() { ______TS("empty options"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("ConstSum-option qn"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); feedbackEditPage.fillConstSumPointsBoxForNewQuestion(""); assertEquals("1", feedbackEditPage.getConstSumPointsBoxForNewQuestion()); feedbackEditPage.fillConstSumPointsForEachOptionBoxForNewQuestion(""); assertEquals("1", feedbackEditPage.getConstSumPointsForEachOptionBoxForNewQuestion()); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( "Too little options for Distribute points (among options) question. Minimum number of options is: 2."); ______TS("remove when 1 left"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test const sum question"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); assertTrue(feedbackEditPage.verifyNewConstSumQuestionFormIsDisplayed()); feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(1); assertFalse(feedbackEditPage.isElementPresent("constSumOptionRow-1--1")); assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(0); assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( "Too little options for Distribute points (among options) question. Minimum number of options is: 2."); ______TS("duplicate options"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test duplicate options"); feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); feedbackEditPage.fillConstSumOptionForNewQuestion(0, "duplicate option"); feedbackEditPage.fillConstSumOptionForNewQuestion(1, "duplicate option"); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( Const.FeedbackQuestion.CONST_SUM_ERROR_DUPLICATE_OPTIONS); }