Search in sources :

Example 1 with InstructorStudentRecordsPage

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

the class InstructorCourseDetailsPageUiTest method testLinks.

private void testLinks() {
    StudentAttributes student1 = testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2104");
    StudentAttributes student2 = testData.students.get("charlie.tmms@CCDetailsUiT.CS2104");
    ______TS("link: view");
    InstructorCourseStudentDetailsViewPage studentDetailsPage = detailsPage.clickViewStudent(student1.name);
    studentDetailsPage.verifyIsCorrectPage(student1.email);
    studentDetailsPage.closeCurrentWindowAndSwitchToParentWindow();
    ______TS("link: edit");
    InstructorCourseStudentDetailsEditPage studentEditPage = detailsPage.clickEditStudent(student2.name);
    studentEditPage.verifyIsCorrectPage(student2.email);
    studentEditPage.closeCurrentWindowAndSwitchToParentWindow();
    ______TS("link: all records");
    InstructorStudentRecordsPage studentAllRecordsPage = detailsPage.clickAllRecordsLink(student2.name);
    studentAllRecordsPage.verifyIsCorrectPage(student2.name);
    studentAllRecordsPage.closeCurrentWindowAndSwitchToParentWindow();
    studentAllRecordsPage = detailsPage.clickAllRecordsLink(student1.name);
    studentAllRecordsPage.verifyIsCorrectPage(student1.name.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
    studentAllRecordsPage.closeCurrentWindowAndSwitchToParentWindow();
    ______TS("link: download student list");
    AppUrl studentListDownloadUrl = createUrl(Const.ActionURIs.INSTRUCTOR_COURSE_STUDENT_LIST_DOWNLOAD).withUserId("CCDetailsUiT.instr").withCourseId("CCDetailsUiT.CS2104");
    detailsPage.verifyDownloadLink(studentListDownloadUrl);
}
Also used : InstructorCourseStudentDetailsViewPage(teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage) InstructorCourseStudentDetailsEditPage(teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage) AppUrl(teammates.common.util.AppUrl) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes) InstructorStudentRecordsPage(teammates.test.pageobjects.InstructorStudentRecordsPage)

Example 2 with InstructorStudentRecordsPage

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

the class InstructorStudentListPageUiTest method testLinks.

private void testLinks() {
    String instructorId = testData.instructors.get("instructorOfCourse2").googleId;
    AppUrl viewPageUrl = createUrl(Const.ActionURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId);
    viewPage = loginAdminToPage(viewPageUrl, InstructorStudentListPage.class);
    ______TS("link: enroll");
    String courseId = testData.courses.get("course2").getId();
    InstructorCourseEnrollPage enrollPage = viewPage.clickEnrollStudents(courseId);
    enrollPage.verifyIsCorrectPage(courseId);
    viewPage = enrollPage.goToPreviousPage(InstructorStudentListPage.class);
    ______TS("link: view");
    StudentAttributes student1 = testData.students.get("Student2Course2");
    viewPage.checkCourse(0);
    viewPage.checkCourse(1);
    ThreadHelper.waitFor(500);
    InstructorCourseStudentDetailsViewPage studentDetailsPage = viewPage.clickViewStudent(student1.course, student1.name);
    studentDetailsPage.verifyIsCorrectPage(student1.email);
    studentDetailsPage.closeCurrentWindowAndSwitchToParentWindow();
    viewPage = loginAdminToPage(viewPageUrl, InstructorStudentListPage.class);
    ______TS("link: edit");
    StudentAttributes student2 = testData.students.get("Student3Course3");
    viewPage.checkCourse(0);
    viewPage.checkCourse(1);
    ThreadHelper.waitFor(500);
    InstructorCourseStudentDetailsEditPage studentEditPage = viewPage.clickEditStudent(student2.course, student2.name);
    studentEditPage.verifyIsCorrectPage(student2.email);
    studentEditPage.submitButtonClicked();
    studentEditPage.closeCurrentWindowAndSwitchToParentWindow();
    viewPage = loginAdminToPage(viewPageUrl, InstructorStudentListPage.class);
    ______TS("link: view records");
    viewPage.checkCourse(0);
    viewPage.checkCourse(1);
    ThreadHelper.waitFor(500);
    InstructorStudentRecordsPage studentRecordsPage = viewPage.clickViewRecordsStudent(student2.course, student2.name);
    studentRecordsPage.verifyIsCorrectPage(student2.name);
    studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow();
    viewPage = loginAdminToPage(viewPageUrl, InstructorStudentListPage.class);
}
Also used : InstructorCourseStudentDetailsViewPage(teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage) InstructorCourseStudentDetailsEditPage(teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage) InstructorCourseEnrollPage(teammates.test.pageobjects.InstructorCourseEnrollPage) AppUrl(teammates.common.util.AppUrl) InstructorStudentListPage(teammates.test.pageobjects.InstructorStudentListPage) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes) InstructorStudentRecordsPage(teammates.test.pageobjects.InstructorStudentRecordsPage)

Aggregations

StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)2 AppUrl (teammates.common.util.AppUrl)2 InstructorCourseStudentDetailsEditPage (teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage)2 InstructorCourseStudentDetailsViewPage (teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage)2 InstructorStudentRecordsPage (teammates.test.pageobjects.InstructorStudentRecordsPage)2 InstructorCourseEnrollPage (teammates.test.pageobjects.InstructorCourseEnrollPage)1 InstructorStudentListPage (teammates.test.pageobjects.InstructorStudentListPage)1