Search in sources :

Example 36 with AppUrl

use of teammates.common.util.AppUrl in project teammates by TEAMMATES.

the class InstructorCoursesPageUiTest method getCoursesPage.

private InstructorCoursesPage getCoursesPage() {
    AppUrl coursesUrl = createUrl(Const.ActionURIs.INSTRUCTOR_COURSES_PAGE).withUserId(instructorId);
    InstructorCoursesPage page = loginAdminToPage(coursesUrl, InstructorCoursesPage.class);
    page.waitForAjaxLoadCoursesSuccess();
    return page;
}
Also used : AppUrl(teammates.common.util.AppUrl) InstructorCoursesPage(teammates.test.pageobjects.InstructorCoursesPage)

Example 37 with AppUrl

use of teammates.common.util.AppUrl in project teammates by TEAMMATES.

the class StudentCourseDetailsPageUiTest method verifyContent.

private void verifyContent(String courseObjectId, String studentObjectId, String filePath, boolean isFullPageChecked) throws Exception {
    AppUrl detailsPageUrl = createUrl(Const.ActionURIs.STUDENT_COURSE_DETAILS_PAGE).withUserId(testData.students.get(studentObjectId).googleId).withCourseId(testData.courses.get(courseObjectId).getId());
    StudentCourseDetailsPage detailsPage = loginAdminToPage(detailsPageUrl, StudentCourseDetailsPage.class);
    if (isFullPageChecked) {
        detailsPage.verifyHtml(filePath);
    } else {
        detailsPage.verifyHtmlMainContent(filePath);
    }
}
Also used : AppUrl(teammates.common.util.AppUrl) StudentCourseDetailsPage(teammates.test.pageobjects.StudentCourseDetailsPage)

Example 38 with AppUrl

use of teammates.common.util.AppUrl in project teammates by TEAMMATES.

the class StudentHomePageUiTest method testContentAndLogin.

private void testContentAndLogin() throws Exception {
    ______TS("content: no courses, 'welcome stranger' message");
    String unregUserId = TestProperties.TEST_UNREG_ACCOUNT;
    String unregPassword = TestProperties.TEST_UNREG_PASSWORD;
    // delete account if it exists
    BackDoor.deleteAccount(unregUserId);
    logout();
    studentHome = getHomePage().clickStudentLogin().loginAsStudent(unregUserId, unregPassword);
    // this test uses the accounts from test.properties
    // do not do full HTML verification here as the unregistered username is not predictable
    studentHome.verifyHtmlMainContent("/studentHomeHTMLEmpty.html");
    ______TS("persistence check");
    loginWithPersistenceProblem();
    // This is the full HTML verification for Student Home Page, the rest can all be verifyMainHtml
    studentHome.verifyHtml("/studentHomeHTMLPersistenceCheck.html");
    ______TS("login");
    studentHome = getHomePage().clickStudentLogin().loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, TestProperties.TEST_STUDENT1_PASSWORD);
    ______TS("content: multiple courses");
    // this test uses the accounts from test.properties
    studentHome.verifyHtmlMainContent("/studentHomeHTML.html");
    AppUrl detailsPageUrl = createUrl(Const.ActionURIs.STUDENT_HOME_PAGE).withUserId(testData.students.get("SHomeUiT.charlie.d@SHomeUiT.CS2104").googleId);
    StudentHomePage studentHomePage = loginAdminToPage(detailsPageUrl, StudentHomePage.class);
    studentHomePage.verifyHtmlMainContent("/studentHomeTypicalHTML.html");
    ______TS("content: requires sanitization");
    detailsPageUrl = createUrl(Const.ActionURIs.STUDENT_HOME_PAGE).withUserId(testData.students.get("SHomeUiT.student1InTestingSanitizationCourse").googleId);
    studentHomePage = loginAdminToPage(detailsPageUrl, StudentHomePage.class);
    studentHomePage.verifyHtmlMainContent("/studentHomeTypicalTestingSanitization.html");
}
Also used : AppUrl(teammates.common.util.AppUrl) StudentHomePage(teammates.test.pageobjects.StudentHomePage)

Example 39 with AppUrl

use of teammates.common.util.AppUrl in project teammates by TEAMMATES.

the class StudentHomePageUiTest method loginWithPersistenceProblem.

private void loginWithPersistenceProblem() {
    AppUrl homeUrl = ((AppUrl) createUrl(Const.ActionURIs.STUDENT_HOME_PAGE).withParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, "SHomeUiT.CS2104")).withUserId("unreg_user");
    studentHome = loginAdminToPage(homeUrl, StudentHomePage.class);
}
Also used : AppUrl(teammates.common.util.AppUrl) StudentHomePage(teammates.test.pageobjects.StudentHomePage)

Example 40 with AppUrl

use of teammates.common.util.AppUrl in project teammates by TEAMMATES.

the class SystemErrorEmailReportTest method testAssertionError.

private void testAssertionError() {
    ______TS("AssertionError testing");
    AppUrl url = createUrl(Const.ActionURIs.ADMIN_EXCEPTION_TEST).withParam(Const.ParamsNames.ERROR, AssertionError.class.getSimpleName());
    page.navigateTo(url);
    print("AssertionError triggered, please check your crash report at " + Config.SUPPORT_EMAIL);
}
Also used : AppUrl(teammates.common.util.AppUrl)

Aggregations

AppUrl (teammates.common.util.AppUrl)52 Test (org.testng.annotations.Test)7 InstructorCourseEnrollPage (teammates.test.pageobjects.InstructorCourseEnrollPage)6 InstructorStudentListPage (teammates.test.pageobjects.InstructorStudentListPage)6 StudentHomePage (teammates.test.pageobjects.StudentHomePage)6 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)4 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)3 InstructorCourseDetailsPage (teammates.test.pageobjects.InstructorCourseDetailsPage)3 InstructorCourseStudentDetailsEditPage (teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage)3 InstructorHomePage (teammates.test.pageobjects.InstructorHomePage)3 Stopwatch (teammates.client.scripts.util.Stopwatch)2 AdminHomePage (teammates.test.pageobjects.AdminHomePage)2 InstructorCourseStudentDetailsViewPage (teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage)2 InstructorCoursesPage (teammates.test.pageobjects.InstructorCoursesPage)2 InstructorFeedbackResultsPage (teammates.test.pageobjects.InstructorFeedbackResultsPage)2 InstructorFeedbackSessionsPage (teammates.test.pageobjects.InstructorFeedbackSessionsPage)2 InstructorStudentRecordsPage (teammates.test.pageobjects.InstructorStudentRecordsPage)2 StudentCourseDetailsPage (teammates.test.pageobjects.StudentCourseDetailsPage)2 BlobInfo (com.google.appengine.api.blobstore.BlobInfo)1 BlobKey (com.google.appengine.api.blobstore.BlobKey)1