Search in sources :

Example 46 with AppUrl

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

the class AdminSessionsPageUiTest method testContent.

private void testContent() {
    ______TS("content: typical page");
    AppUrl sessionsUrl = createUrl(Const.ActionURIs.ADMIN_SESSIONS_PAGE);
    sessionsPage = loginAdminToPage(sessionsUrl, AdminSessionsPage.class);
    By timeFramePanel = By.id("timeFramePanel");
    sessionsPage.waitForElementToDisappear(timeFramePanel);
    assertTrue(isSessionDataDisplayCorrect());
    ______TS("content: show filter");
    sessionsPage.clickDetailButton();
    sessionsPage.waitForElementVisibility(browser.driver.findElement(timeFramePanel));
    assertTrue(isSessionDataDisplayCorrect());
    ______TS("content: hide filter");
    sessionsPage.clickDetailButton();
    sessionsPage.waitForElementToDisappear(timeFramePanel);
    assertTrue(isSessionDataDisplayCorrect());
}
Also used : AdminSessionsPage(teammates.test.pageobjects.AdminSessionsPage) AppUrl(teammates.common.util.AppUrl) By(org.openqa.selenium.By)

Example 47 with AppUrl

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

the class AllAccessControlUiTests method verifyCannotAccessAdminPages.

private void verifyCannotAccessAdminPages() {
    // cannot access directly
    AppUrl url = createUrl(Const.ActionURIs.ADMIN_HOME_PAGE);
    verifyRedirectToForbidden(url);
    // cannot access by masquerading either
    url = url.withUserId(TestProperties.TEST_ADMIN_ACCOUNT);
    verifyRedirectToForbidden(url);
}
Also used : AppUrl(teammates.common.util.AppUrl)

Example 48 with AppUrl

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

the class AllAccessControlUiTests method testUserNotRegistered.

@Test
public void testUserNotRegistered() {
    ______TS("student pages");
    loginStudent(TestProperties.TEST_UNREG_ACCOUNT, TestProperties.TEST_UNREG_PASSWORD);
    verifyRedirectToWelcomeStrangerPage(createUrl(Const.ActionURIs.STUDENT_HOME_PAGE), TestProperties.TEST_UNREG_ACCOUNT);
    ______TS("instructor pages");
    loginInstructorUnsuccessfully(TestProperties.TEST_UNREG_ACCOUNT, TestProperties.TEST_UNREG_PASSWORD);
    AppUrl url = createUrl(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
    verifyRedirectToNotAuthorized(url);
    verifyCannotMasquerade(url, otherInstructor.googleId);
    ______TS("admin pages");
    // cannot access admin while logged in as student
    verifyCannotAccessAdminPages();
    ______TS("incorrect URL");
    AppUrl nonExistentActionUrl = createUrl("/page/nonExistentAction");
    AppPage.getNewPageInstance(browser, nonExistentActionUrl, NotFoundPage.class);
}
Also used : AppUrl(teammates.common.util.AppUrl) Test(org.testng.annotations.Test)

Example 49 with AppUrl

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

the class AllAccessControlUiTests method verifyCannotMasquerade.

private void verifyCannotMasquerade(AppUrl url, String otherInstructorId) {
    AppUrl masqueradeUrl = url.withUserId(otherInstructorId);
    verifyRedirectToNotAuthorized(masqueradeUrl);
}
Also used : AppUrl(teammates.common.util.AppUrl)

Example 50 with AppUrl

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

the class AutomatedSessionRemindersTest method testFeedbackSessionClosingReminders.

@Test
public void testFeedbackSessionClosingReminders() {
    AppUrl closingRemindersUrl = createUrl(Const.ActionURIs.AUTOMATED_FEEDBACK_CLOSING_REMINDERS);
    loginAdminToPage(closingRemindersUrl, GenericAppPage.class);
}
Also used : AppUrl(teammates.common.util.AppUrl) Test(org.testng.annotations.Test)

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