use of teammates.test.pageobjects.InstructorFeedbackSessionsPage in project teammates by TEAMMATES.
the class InstructorFeedbackEditPageUiTest method testResponseRate.
private void testResponseRate() {
// Create a new question and save
feedbackEditPage.clickNewQuestionButton();
feedbackEditPage.selectNewQuestionType("TEXT");
feedbackEditPage.fillQuestionTextBoxForNewQuestion("new question");
feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details");
feedbackEditPage.clickAddQuestionButton();
// Create response for the new question
FeedbackResponseAttributes feedbackResponse = new FeedbackResponseAttributes(feedbackSessionName, courseId, "1", FeedbackQuestionType.TEXT, "tmms.test@gmail.tmt", Const.DEFAULT_SECTION, "alice.b.tmms@gmail.tmt", Const.DEFAULT_SECTION, new Text("Response from instructor to Alice"));
BackDoor.createFeedbackResponse(feedbackResponse);
______TS("check response rate before editing question");
InstructorFeedbackSessionsPage feedbacksPage = navigateToInstructorFeedbackSessionsPage();
feedbacksPage.waitForAjaxLoaderGifToDisappear();
feedbacksPage.clickViewResponseLink(courseId, feedbackSessionName);
feedbacksPage.verifyResponseValue("1 / 1", courseId, feedbackSessionName);
______TS("check warning is displayed while editing visibility options of question with existing response");
// Change the feedback path of the question and save
feedbackEditPage = getFeedbackEditPage();
assertTrue(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1));
feedbackEditPage.clickEditQuestionButton(1);
feedbackEditPage.enableOtherFeedbackPathOptions(1);
feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.TEAMS, 1);
feedbackEditPage.clickSaveExistingQuestionButton(1);
feedbackEditPage.waitForConfirmationModalAndClickOk();
______TS("check no warning displayed while editing visibility options of question without responses");
assertFalse(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1));
______TS("check response rate after editing question");
feedbacksPage = navigateToInstructorFeedbackSessionsPage();
feedbacksPage.waitForAjaxLoaderGifToDisappear();
feedbacksPage.clickViewResponseLink(courseId, feedbackSessionName);
feedbacksPage.verifyResponseValue("0 / 1", courseId, feedbackSessionName);
// Delete the question
feedbackEditPage = getFeedbackEditPage();
feedbackEditPage.clickDeleteQuestionLink(1);
feedbackEditPage.waitForConfirmationModalAndClickOk();
}
use of teammates.test.pageobjects.InstructorFeedbackSessionsPage in project teammates by TEAMMATES.
the class InstructorFeedbackSessionsPageUiTest method getFeedbackPageForInstructor.
private InstructorFeedbackSessionsPage getFeedbackPageForInstructor(String instructorId) {
AppUrl feedbackPageLink = createUrl(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE).withUserId(instructorId);
InstructorFeedbackSessionsPage page = loginAdminToPage(feedbackPageLink, InstructorFeedbackSessionsPage.class);
page.waitForElementPresence(By.id("table-sessions"));
return page;
}
use of teammates.test.pageobjects.InstructorFeedbackSessionsPage in project teammates by TEAMMATES.
the class InstructorFeedbackEditPageUiTest method navigateToInstructorFeedbackSessionsPage.
private InstructorFeedbackSessionsPage navigateToInstructorFeedbackSessionsPage() {
AppUrl feedbacksPageUrl = createUrl(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE).withUserId(instructorId);
InstructorFeedbackSessionsPage feedbacksPage = AppPage.getNewPageInstance(browser, feedbacksPageUrl, InstructorFeedbackSessionsPage.class);
feedbacksPage.waitForPageToLoad();
return feedbacksPage;
}
use of teammates.test.pageobjects.InstructorFeedbackSessionsPage in project teammates by TEAMMATES.
the class InstructorFeedbackEditPageUiTest method testDoneEditingLink.
private void testDoneEditingLink() {
InstructorFeedbackSessionsPage feedbackPage = feedbackEditPage.clickDoneEditingLink();
______TS("Compare URLs");
String expectedRedirectUrl = createUrl(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE).withUserId(instructorId).withCourseId(courseId).withSessionName(feedbackSessionName).toAbsoluteString();
assertEquals(expectedRedirectUrl, feedbackPage.getPageUrl());
______TS("Check for highlight on last modified row");
feedbackPage.waitForAjaxLoaderGifToDisappear();
String idOfModifiedSession = "session0";
String idOfModifiedSession2 = "session1";
assertTrue(feedbackPage.isContainingCssClass(By.id(idOfModifiedSession), "warning"));
assertFalse(feedbackPage.isContainingCssClass(By.id(idOfModifiedSession2), "warning"));
// restore feedbackeditpage
feedbackEditPage = getFeedbackEditPage();
}
use of teammates.test.pageobjects.InstructorFeedbackSessionsPage in project teammates by TEAMMATES.
the class InstructorFeedbackEditPageUiTest method testDeleteSessionAction.
private void testDeleteSessionAction() throws MaximumRetriesExceededException {
______TS("session delete then cancel");
feedbackEditPage.clickAndCancel(feedbackEditPage.getDeleteSessionLink());
assertNotNull(getFeedbackSessionWithRetry(courseId, feedbackSessionName));
______TS("session delete then accept");
// check redirect to main feedback page
InstructorFeedbackSessionsPage feedbackPage = feedbackEditPage.deleteSession();
assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser().contains(Const.StatusMessages.FEEDBACK_SESSION_DELETED));
assertNull(getFeedbackSession(courseId, feedbackSessionName));
}
Aggregations