Search in sources :

Example 1 with StudentHelpPage

use of teammates.test.pageobjects.StudentHelpPage in project teammates by TEAMMATES.

the class StudentHomePageUiTest method testLinks.

private void testLinks() {
    AppUrl homePageUrl = createUrl(Const.ActionURIs.STUDENT_HOME_PAGE).withUserId(testData.students.get("SHomeUiT.charlie.d@SHomeUiT.CS2104").googleId);
    StudentHomePage studentHomePage = loginAdminToPage(homePageUrl, StudentHomePage.class);
    ______TS("link: help page");
    StudentHelpPage helpPage = studentHomePage.loadStudentHelpTab();
    helpPage.closeCurrentWindowAndSwitchToParentWindow();
    ______TS("link: view team link");
    studentHomePage.clickViewTeam();
    AppUrl detailsPageUrl = createUrl(Const.ActionURIs.STUDENT_COURSE_DETAILS_PAGE).withUserId(testData.students.get("SHomeUiT.charlie.d@SHomeUiT.CS1101").googleId).withCourseId(testData.students.get("SHomeUiT.charlie.d@SHomeUiT.CS1101").course);
    assertEquals(detailsPageUrl.toAbsoluteString(), browser.driver.getCurrentUrl());
    studentHomePage.loadStudentHomeTab();
    ______TS("link: link of published feedback");
    studentHomePage.clickViewFeedbackButton("Closed Feedback Session");
    studentHomePage.reloadPage();
    String pageSource = browser.driver.getPageSource();
    assertTrue(pageSource.contains("Feedback Results"));
    assertTrue(pageSource.contains("SHomeUiT.CS2104"));
    assertTrue(pageSource.contains("Closed Feedback Session"));
    studentHomePage.loadStudentHomeTab();
    studentHomePage.clickSubmitFeedbackButton("Closed Feedback Session");
    studentHomePage.reloadPage();
    pageSource = browser.driver.getPageSource();
    assertTrue(pageSource.contains("Submit Feedback"));
    assertTrue(pageSource.contains("SHomeUiT.CS2104"));
    assertTrue(pageSource.contains("Closed Feedback Session"));
    assertTrue(pageSource.contains(Const.StatusMessages.FEEDBACK_SUBMISSIONS_NOT_OPEN));
    studentHomePage.loadStudentHomeTab();
    ______TS("link: link of Grace period feedback");
    assertTrue(studentHomePage.getViewFeedbackButton("Graced Feedback Session").getAttribute("class").contains("disabled"));
    studentHomePage.clickSubmitFeedbackButton("Graced Feedback Session");
    studentHomePage.reloadPage();
    pageSource = browser.driver.getPageSource();
    assertTrue(pageSource.contains("Submit Feedback"));
    assertTrue(pageSource.contains("SHomeUiT.CS2104"));
    assertTrue(pageSource.contains("Graced Feedback Session"));
    assertTrue(pageSource.contains(Const.StatusMessages.FEEDBACK_SUBMISSIONS_NOT_OPEN));
    studentHomePage.loadStudentHomeTab();
    ______TS("link: link of pending feedback");
    assertTrue(studentHomePage.getViewFeedbackButton("First Feedback Session").getAttribute("class").contains("disabled"));
    studentHomePage.clickSubmitFeedbackButton("First Feedback Session");
    studentHomePage.reloadPage();
    pageSource = browser.driver.getPageSource();
    assertTrue(pageSource.contains("Submit Feedback"));
    assertTrue(pageSource.contains("SHomeUiT.CS2104"));
    assertTrue(pageSource.contains("First Feedback Session"));
    studentHomePage.loadStudentHomeTab();
}
Also used : StudentHelpPage(teammates.test.pageobjects.StudentHelpPage) AppUrl(teammates.common.util.AppUrl) StudentHomePage(teammates.test.pageobjects.StudentHomePage)

Aggregations

AppUrl (teammates.common.util.AppUrl)1 StudentHelpPage (teammates.test.pageobjects.StudentHelpPage)1 StudentHomePage (teammates.test.pageobjects.StudentHomePage)1