Search in sources :

Example 41 with AppUrl

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

the class SystemErrorEmailReportTest method testUnauthorizedAccessException.

// TODO: this test should be moved to the class testing access control
private void testUnauthorizedAccessException() {
    ______TS("UnauthorizedAccessException testing");
    AppUrl url = createUrl(Const.ActionURIs.ADMIN_EXCEPTION_TEST).withParam(Const.ParamsNames.ERROR, UnauthorizedAccessException.class.getSimpleName());
    page.navigateTo(url);
    print("This exception is handled by system, make sure you don't receive any emails. ");
}
Also used : AppUrl(teammates.common.util.AppUrl) UnauthorizedAccessException(teammates.common.exception.UnauthorizedAccessException)

Example 42 with AppUrl

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

the class SystemErrorEmailReportTest method testNullPostParamException.

private void testNullPostParamException() {
    ______TS("NullPostParamException testing");
    AppUrl url = createUrl(Const.ActionURIs.ADMIN_EXCEPTION_TEST).withParam(Const.ParamsNames.ERROR, NullPostParameterException.class.getSimpleName());
    page.navigateTo(url);
    page.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.NULL_POST_PARAMETER_MESSAGE.replace("<br>", "\n"));
    print("This exception is handled by system, make sure you don't receive any emails. ");
}
Also used : NullPostParameterException(teammates.common.exception.NullPostParameterException) AppUrl(teammates.common.util.AppUrl)

Example 43 with AppUrl

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

the class AdminActivityLogPageUiTest method testContent.

private void testContent() throws Exception {
    ______TS("content: typical page");
    AppUrl logPageUrl = createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE);
    logPage = loginAdminToPage(logPageUrl, AdminActivityLogPage.class);
    logPage.verifyIsCorrectPage();
    ______TS("content: navigate to other pages to get some logs");
    logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_HOME_PAGE));
    logPage.waitForPageToLoad();
    logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE));
    logPage.waitForPageToLoad();
    logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_SEARCH_PAGE));
    logPage.waitForPageToLoad();
    logPage.navigateTo(createUrl(Const.ActionURIs.ADMIN_ACTIVITY_LOG_PAGE));
    logPage.waitForPageToLoad();
    assertNotNull(logPage.getFirstActivityLogRow());
    assertTrue(logPage.isLogsTableVisible());
    assertEquals(2, logPage.getNumberOfTableHeaders());
    ______TS("content: ensure default search period is not more than one day");
    Instant yesterday = TimeHelper.getInstantDaysOffsetFromNow(-1);
    assertTrue(logPage.getDateOfEarliestLog().isAfter(yesterday));
    ______TS("content: show the earliest log's date in both Admin Time Zone and local Time Zone");
    String statusMessageText = logPage.getTextsForAllStatusMessagesToUser().get(0);
    assertTrue(statusMessageText.contains("The earliest log entry checked on"));
    assertTrue(statusMessageText.contains("in Admin Time Zone"));
    assertTrue(statusMessageText.contains("in Local Time Zone") || statusMessageText.contains("Local Time Unavailable"));
}
Also used : AppUrl(teammates.common.util.AppUrl) AdminActivityLogPage(teammates.test.pageobjects.AdminActivityLogPage) Instant(java.time.Instant)

Example 44 with AppUrl

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

the class AdminEmailLogPageUiTest method testContent.

private void testContent() {
    ______TS("content: typical page");
    AppUrl logPageUrl = createUrl(Const.ActionURIs.ADMIN_EMAIL_LOG_PAGE);
    emailLogPage = loginAdminToPage(logPageUrl, AdminEmailLogPage.class);
    emailLogPage.verifyIsCorrectPage();
    assertTrue(isEmailLogDataDisplayCorrect());
}
Also used : AdminEmailLogPage(teammates.test.pageobjects.AdminEmailLogPage) AppUrl(teammates.common.util.AppUrl)

Example 45 with AppUrl

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

the class AdminHomePageUiTest method testContent.

private void testContent() throws Exception {
    ______TS("content: typical page");
    AppUrl homeUrl = createUrl(Const.ActionURIs.ADMIN_HOME_PAGE).withUserId(TestProperties.TEST_ADMIN_ACCOUNT);
    homePage = loginAdminToPage(homeUrl, AdminHomePage.class);
    homePage.verifyHtml("/adminHomePage.html");
}
Also used : AdminHomePage(teammates.test.pageobjects.AdminHomePage) 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