From ab1a0c01661c6df08095d04d9fc64d7c78388355 Mon Sep 17 00:00:00 2001 From: bamboo3250 Date: Thu, 21 Apr 2016 01:09:02 +0800 Subject: [PATCH] improve test case --- .../InstructorFeedbackPageUiTest.java | 40 ++-- .../data/InstructorFeedbackPageUiTest.json | 8 +- .../pages/instructorFeedbackAddSuccess.html | 18 +- .../instructorFeedbackAllSessionTypes.html | 96 +++++----- ...FeedbackAllSessionTypesWithHelperView.html | 76 ++++---- .../pages/instructorFeedbackCopySuccess.html | 18 +- .../instructorFeedbackCopyTrimmedSuccess.html | 18 +- .../instructorFeedbackDeleteSuccessful.html | 176 +++++++++--------- .../instructorFeedbackPublishSuccessful.html | 96 +++++----- ...instructorFeedbackUnpublishSuccessful.html | 96 +++++----- 10 files changed, 321 insertions(+), 321 deletions(-) diff --git a/src/test/java/teammates/test/cases/ui/browsertests/InstructorFeedbackPageUiTest.java b/src/test/java/teammates/test/cases/ui/browsertests/InstructorFeedbackPageUiTest.java index 5bd6c12c360..f363919c092 100644 --- a/src/test/java/teammates/test/cases/ui/browsertests/InstructorFeedbackPageUiTest.java +++ b/src/test/java/teammates/test/cases/ui/browsertests/InstructorFeedbackPageUiTest.java @@ -58,7 +58,7 @@ public static void classSetup() throws Exception { newSession = new FeedbackSessionAttributes(); newSession.courseId = "CFeedbackUiT.CS1101"; - newSession.feedbackSessionName = "New Session"; + newSession.feedbackSessionName = "New Session ##"; // start time is in future, hence the year. newSession.startTime = TimeHelper.convertToDate("2035-04-01 11:59 PM UTC"); newSession.endTime = TimeHelper.convertToDate("2035-04-30 10:00 PM UTC"); @@ -157,9 +157,9 @@ public void testContent() throws Exception { feedbackPage.verifyHtmlMainContent("/instructorFeedbackAllSessionTypes.html"); feedbackPage.sortByName().verifyTablePattern( - 0, 1,"Awaiting Session{*}First Session{*}Manual Session #1{*}Open Session{*}Private Session"); + 0, 1,"Awaiting Session #{*}First Session #1{*}Manual Session #1{*}Open Session #{*}Private Session #"); feedbackPage.sortByName().verifyTablePattern( - 0, 1,"Private Session{*}Open Session{*}Manual Session #1{*}First Session{*}Awaiting Session"); + 0, 1,"Private Session #{*}Open Session #{*}Manual Session #1{*}First Session #1{*}Awaiting Session #"); ______TS("sort by course id"); @@ -246,7 +246,7 @@ public void testAddAction() throws Exception{ feedbackPage.verifyHidden(By.id("responsesVisibleFromColumn")); feedbackPage.verifyHidden(By.id("instructionsRow")); - newSession.feedbackSessionName = "private session of characters123456789"; + newSession.feedbackSessionName = "private session of characters1234567 #"; newSession.courseId = "CFeedbackUiT.CS2104"; newSession.timeZone = 5.75; newSession.endTime = null; @@ -285,7 +285,7 @@ public void testAddAction() throws Exception{ feedbackPage.clickCustomVisibleTimeButton(); feedbackPage.clickDefaultPublishTimeButton(); - newSession.feedbackSessionName = "Allow Early Viewing Session"; + newSession.feedbackSessionName = "Allow Early Viewing Session #"; newSession.courseId = "CFeedbackUiT.CS1101"; newSession.timeZone = -4.5; @@ -323,7 +323,7 @@ public void testAddAction() throws Exception{ feedbackPage.clickDefaultVisibleTimeButton(); feedbackPage.clickNeverPublishTimeButton(); - newSession.feedbackSessionName = "responses cant be seen my students 1"; + newSession.feedbackSessionName = "responses cant be seen my students 1 #"; // start time in past newSession.startTime = TimeHelper.convertToDate("2012-05-01 4:00 AM UTC"); newSession.endTime = TimeHelper.convertToDate("2017-31-12 11:59 PM UTC"); @@ -355,7 +355,7 @@ public void testAddAction() throws Exception{ feedbackPage.clickEditUncommonSettingsButton(); feedbackPage.clickDefaultVisibleTimeButton(); feedbackPage.clickCustomPublishTimeButton(); - newSession.feedbackSessionName = "Long Instruction Test"; + newSession.feedbackSessionName = "Long Instruction Test ##"; newSession.timeZone = 0; newSession.startTime = TimeHelper.convertToDate("2012-05-01 8:00 AM UTC"); newSession.endTime = TimeHelper.convertToDate("2012-09-01 11:00 PM UTC"); @@ -386,7 +386,7 @@ public void testAddAction() throws Exception{ feedbackPage.clickCustomVisibleTimeButton(); feedbackPage.clickCustomPublishTimeButton(); - newSession.feedbackSessionName = "invalid publish time"; + newSession.feedbackSessionName = "invalid publish time #"; newSession.startTime = TimeHelper.convertToDate("2012-05-01 8:00 PM UTC"); newSession.endTime = TimeHelper.convertToDate("2012-05-01 4:00 PM UTC"); @@ -427,7 +427,7 @@ public void testAddAction() throws Exception{ //feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - newSession.feedbackSessionName = "bad name %%"; + newSession.feedbackSessionName = "bad name %% #"; newSession.endTime = Const.TIME_REPRESENTS_LATER; feedbackPage.addFeedbackSession( newSession.feedbackSessionName, newSession.courseId, @@ -435,7 +435,7 @@ public void testAddAction() throws Exception{ newSession.instructions, newSession.gracePeriod); assertEquals(String.format( FieldValidator.INVALID_NAME_ERROR_MESSAGE, - "bad name %%", + "bad name %% #", FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, FieldValidator.REASON_CONTAINS_INVALID_CHAR, FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME), @@ -446,14 +446,14 @@ public void testAddAction() throws Exception{ public void testCopyFromAction() throws Exception{ ______TS("Success case: copy successfully a previous session"); - feedbackPage.copyFeedbackSession("New Session (Copied)", newSession.courseId); + feedbackPage.copyFeedbackSession("New Session ## (Copied)", newSession.courseId); feedbackPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_COPIED); // Check that we are redirected to the edit page. feedbackPage.verifyHtmlMainContent("/instructorFeedbackCopySuccess.html"); ______TS("Success case: copy successfully a previous session with trimmed name"); feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.copyFeedbackSession(" New Session Trimmed (Copied) ", newSession.courseId); + feedbackPage.copyFeedbackSession(" New Session ## Trimmed (Copied) ", newSession.courseId); feedbackPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_COPIED); // Check that we are redirected to the edit page. feedbackPage.verifyHtmlMainContent("/instructorFeedbackCopyTrimmedSuccess.html"); @@ -461,7 +461,7 @@ public void testCopyFromAction() throws Exception{ ______TS("Failure case: copy fail since the feedback session name is the same with existing one"); feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.copyFeedbackSession("New Session (Copied)", newSession.courseId); + feedbackPage.copyFeedbackSession("New Session ## (Copied)", newSession.courseId); feedbackPage.verifyStatus("A feedback session by this name already exists under this course"); feedbackPage.reloadPage(); @@ -478,9 +478,9 @@ public void testCopyFromAction() throws Exception{ ______TS("Failure case: copy fail since the feedback session name starts with ("); feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.copyFeedbackSession("(New Session)", newSession.courseId); + feedbackPage.copyFeedbackSession("(New Session ##)", newSession.courseId); feedbackPage.verifyStatus( - "\"(New Session)\" is not acceptable to TEAMMATES as feedback session name because " + "\"(New Session ##)\" is not acceptable to TEAMMATES as feedback session name because " + "it starts with a non-alphanumeric character. " + "All feedback session name must start with an alphanumeric character, " + "and cannot contain any vertical bar (|) or percent sign (%)."); @@ -489,7 +489,7 @@ public void testCopyFromAction() throws Exception{ } public void testCopyToAction() throws Exception { - String feedbackSessionName = "Open Session"; + String feedbackSessionName = "Open Session #"; String courseId = newSession.courseId; ______TS("Submit empty course list: Feedbacks Page"); @@ -558,7 +558,7 @@ public void testCopyToAction() throws Exception { public void testDeleteAction() throws Exception{ String courseId = newSession.courseId; - String sessionName = "Long Instruction Test"; + String sessionName = "Long Instruction Test ##"; // refresh page feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); @@ -794,12 +794,12 @@ public void testDefaultTimeZone() { public void testResponseRateLink(){ ______TS("test response rate link clickable"); - feedbackPage.clickViewResponseLink("CFeedbackUiT.CS2104", "Private Session"); - feedbackPage.verifyResponseValue("0 / 0", "CFeedbackUiT.CS2104","Private Session"); + feedbackPage.clickViewResponseLink("CFeedbackUiT.CS2104", "Private Session #"); + feedbackPage.verifyResponseValue("0 / 0", "CFeedbackUiT.CS2104","Private Session #"); ______TS("test response rate already displayed"); - assertEquals("0 / 0", feedbackPage.getResponseValue("CFeedbackUiT.CS1101", "Open Session")); + assertEquals("0 / 0", feedbackPage.getResponseValue("CFeedbackUiT.CS1101", "Open Session #")); } public void testViewResultsLink() { diff --git a/src/test/resources/data/InstructorFeedbackPageUiTest.json b/src/test/resources/data/InstructorFeedbackPageUiTest.json index c3c1b0fac84..0ed5ace67cf 100644 --- a/src/test/resources/data/InstructorFeedbackPageUiTest.json +++ b/src/test/resources/data/InstructorFeedbackPageUiTest.json @@ -278,7 +278,7 @@ "feedbackSessions" : { "publishedSession": { - "feedbackSessionName" : "First Session", + "feedbackSessionName" : "First Session #1", "courseId" : "CFeedbackUiT.CS2104", "creatorEmail" : "teammates.test2@gmail.tmt", "instructions": {"value" : "Instructions for first session"}, @@ -294,7 +294,7 @@ "sentPublishedEmail" : true }, "privateSession": { - "feedbackSessionName" : "Private Session", + "feedbackSessionName" : "Private Session #", "courseId" : "CFeedbackUiT.CS2104", "creatorEmail" : "teammates.test1@gmail.tmt", "instructions": {"value" : "Please please fill in the second feedback session"}, @@ -326,7 +326,7 @@ "sentPublishedEmail" : false }, "openSession": { - "feedbackSessionName" : "Open Session", + "feedbackSessionName" : "Open Session #", "courseId" : "CFeedbackUiT.CS1101", "creatorEmail" : "teammates.test2@gmail.tmt", "instructions": {"value" : "Please please fill in the fourth feedback session"}, @@ -342,7 +342,7 @@ "sentPublishedEmail" : false }, "awaitingSession": { - "feedbackSessionName" : "Awaiting Session", + "feedbackSessionName" : "Awaiting Session #", "courseId" : "CFeedbackUiT.CS2104", "creatorEmail" : "teammates.test2@gmail.tmt", "instructions": {"value" : "Instructions for first session"}, diff --git a/src/test/resources/pages/instructorFeedbackAddSuccess.html b/src/test/resources/pages/instructorFeedbackAddSuccess.html index 26bc1068d45..819e4603879 100644 --- a/src/test/resources/pages/instructorFeedbackAddSuccess.html +++ b/src/test/resources/pages/instructorFeedbackAddSuccess.html @@ -16,11 +16,11 @@

- + Delete - + Copy @@ -187,7 +187,7 @@

- New Session + New Session ##
@@ -732,7 +732,7 @@
+ @@ -840,7 +840,7 @@
+ @@ -840,7 +840,7 @@
+ @@ -840,7 +840,7 @@