Search in sources :

Example 91 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project openolat by klemens.

the class LecturesTest method lecturesRollCall_authorizedAbsence.

/**
 * An author create a course, enable the absence management,
 * create a lecture block, add a coach and two participants.<br>
 * The coach login in, see the interceptor to start the roll call.
 * It starts the roll call, set an absence and close.<br>
 * The participant with an absence log in, use the lectures user's
 * tool to see that it has an absence.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lecturesRollCall_authorizedAbsence(@InitialPage LoginPage loginPage, @Drone @User WebDriver coachBrowser, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(true, true, true, false, false).save();
    // start the test with authorized absence on
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO coach = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Rymou");
    LoginPage.getLoginPage(browser, deploymentUrl).loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Lecture " + UUID.randomUUID();
    // create course
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // set access
    CoursePageFragment course = new CoursePageFragment(browser);
    course.accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
    // add a coach
    course.members().addMember().searchMember(coach, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, true, false).nextPermissions().finish();
    // add the participants
    course.members().importMembers().setMembers(participant1, participant2).nextUsers().nextOverview().nextPermissions().finish();
    // enable the lectures
    LectureRepositoryAdminPage lecturesAdmin = course.lecturesAdministration();
    lecturesAdmin.settings().enableLectures().overrideDefaultSettings().saveSettings();
    LectureRepositoryAdminListPage lectureList = lecturesAdmin.lectureList();
    Calendar cal = Calendar.getInstance();
    int today = cal.get(Calendar.DATE);
    int hour = cal.get(Calendar.HOUR_OF_DAY);
    String lectureTitle = "1. Lecture";
    lectureList.newLectureBlock().setTitle(lectureTitle).setTeacher(coach).setDate(today, hour, 0, hour, 59).save();
    // coach at work
    LoginPage coachLoginPage = LoginPage.getLoginPage(coachBrowser, deploymentUrl);
    coachLoginPage.loginAs(coach);
    new RollCallInterceptorPage(coachBrowser).start().setAbsence(participant1, "1").closeRollCall().confirmCloseRollCall().assertOnClosedTable();
    // participant check it roll call
    LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
    participantLoginPage.loginAs(participant1).resume();
    UserToolsPage participantUserTools = new UserToolsPage(participantBrowser);
    participantUserTools.openUserToolsMenu().openLectures().assertOnParticipantLecturesList().selectCourseAsParticipant(title).assertOnParticipantLectureBlocks().assertOnParticipantLectureBlockAbsent(coach, lectureTitle, title);
}
Also used : RollCallInterceptorPage(org.olat.selenium.page.lecture.RollCallInterceptorPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) Calendar(java.util.Calendar) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) LectureRepositoryAdminPage(org.olat.selenium.page.lecture.LectureRepositoryAdminPage) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) NavigationPage(org.olat.selenium.page.NavigationPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) LectureRepositoryAdminListPage(org.olat.selenium.page.lecture.LectureRepositoryAdminListPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 92 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project openolat by klemens.

the class LecturesTest method lectureMobileRollCall_authorizedAbsence.

/**
 * An author create a course, enable the absence management,
 * create a lecture block, add a coach and two participants.<br>
 * The coach login in, see the interceptor to start the roll call
 * version mobile.<br>
 * It starts the roll call, set an absence and close.<br>
 * The participant with an absence log in, use the lectures user's
 * tool to see that it has an absence.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lectureMobileRollCall_authorizedAbsence(@InitialPage LoginPage loginPage, @Drone @User WebDriver coachBrowser, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(true, true, true, false, false).save();
    // start the test with authorized absence on
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO coach = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Rymou");
    LoginPage.getLoginPage(browser, deploymentUrl).loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Lecture " + UUID.randomUUID();
    // create course
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // set access
    CoursePageFragment course = new CoursePageFragment(browser);
    course.accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
    // add a coach
    course.members().addMember().searchMember(coach, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, true, false).nextPermissions().finish();
    // add the participants
    course.members().importMembers().setMembers(participant1, participant2).nextUsers().nextOverview().nextPermissions().finish();
    // enable the lectures
    LectureRepositoryAdminPage lecturesAdmin = course.lecturesAdministration();
    lecturesAdmin.settings().enableLectures().overrideDefaultSettings().saveSettings();
    LectureRepositoryAdminListPage lectureList = lecturesAdmin.lectureList();
    Calendar cal = Calendar.getInstance();
    int today = cal.get(Calendar.DATE);
    int hour = cal.get(Calendar.HOUR_OF_DAY);
    String lectureTitle = "2.Lecture";
    lectureList.newLectureBlock().setTitle(lectureTitle).setTeacher(coach).setDate(today, hour, 0, hour, 59).save();
    // coach at work
    LoginPage coachLoginPage = LoginPage.getLoginPage(coachBrowser, deploymentUrl);
    coachLoginPage.loginAs(coach);
    new RollCallInterceptorPage(coachBrowser).startMobile().setAbsence("1").saveAndNext().setAbsence("1").setAbsence("2").saveAndNext().closeRollCall();
    // check that a roll call at least is closed
    new TeacherRollCallPage(coachBrowser).assertOnClosedTable();
    // participant check it roll call
    LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
    participantLoginPage.loginAs(participant1).resume();
    UserToolsPage participantUserTools = new UserToolsPage(participantBrowser);
    participantUserTools.openUserToolsMenu().openLectures().assertOnParticipantLecturesList().selectCourseAsParticipant(title).assertOnParticipantLectureBlocks().assertOnParticipantLectureBlockAbsent(coach, lectureTitle, title);
}
Also used : RollCallInterceptorPage(org.olat.selenium.page.lecture.RollCallInterceptorPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) Calendar(java.util.Calendar) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) LectureRepositoryAdminPage(org.olat.selenium.page.lecture.LectureRepositoryAdminPage) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) NavigationPage(org.olat.selenium.page.NavigationPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) LectureRepositoryAdminListPage(org.olat.selenium.page.lecture.LectureRepositoryAdminListPage) TeacherRollCallPage(org.olat.selenium.page.lecture.TeacherRollCallPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 93 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project openolat by klemens.

the class LoginTest method maintenanceMessage.

/**
 * An administrator set a maintenance message. A first user
 * logs in before and wait until the message appears. A second
 * user load the login page, check that the message is visible,
 * logs in and check that the message is visible too.
 *
 * @param loginPage
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void maintenanceMessage(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    // a first user log in
    LoginPage kanuLogin = LoginPage.getLoginPage(kanuBrowser, deploymentUrl).loginAs(kanu).resume();
    // administrator come in, and set a maintenance message
    loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
    String message = "Hello - " + UUID.randomUUID();
    AdministrationMessagesPage messagesPage = new NavigationPage(browser).openAdministration().selectInfoMessages().newMaintenanceMessage(message);
    // A new user see the login page
    LoginPage.getLoginPage(reiBrowser, deploymentUrl).waitOnMaintenanceMessage(message).loginAs(rei).resume().assertOnMaintenanceMessage(message);
    kanuLogin.waitOnMaintenanceMessage(message);
    // administrator remove the message
    messagesPage.clearMaintenanceMessage();
    // we wait it disappears
    kanuLogin.waitOnMaintenanceMessageCleared();
}
Also used : UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) LoginPage(org.olat.selenium.page.LoginPage) AdministrationMessagesPage(org.olat.selenium.page.core.AdministrationMessagesPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 94 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project openolat by klemens.

the class AssessmentTest method certificatesGeneratedByTest.

/**
 * An author create a course, set up the root node to make efficiency statement,
 * add a test, publish it and add a participant. It set the certificate.<br>
 *
 * The participant logs in, make the test and look at its wonderful certificate
 * and the details of its performance.
 *
 * @param authorLoginPage
 * @param reiBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void certificatesGeneratedByTest(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
    // create an author and a participant
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    // deploy the test
    URL testUrl = ArquillianDeployments.class.getResource("file_resources/e4_test.zip");
    String testTitle = "E4Test-" + UUID.randomUUID();
    new RepositoryRestClient(deploymentUrl, author).deployResource(new File(testUrl.toURI()), "-", testTitle);
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Certif-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type CP with the CP that we create above
    String testNodeTitle = "Test-QTI-1.2";
    CoursePageFragment courseRuntime = CoursePageFragment.getCourse(browser);
    courseRuntime.edit().createNode("iqtest").nodeTitle(testNodeTitle).selectTabLearnContent().chooseTest(testTitle).selectRoot().selectTabScore().enableRootScoreByNodes().autoPublish().accessConfiguration().setUserAccess(UserAccess.registred).clickToolbarBack();
    // add a participant to the course
    MembersPage members = courseRuntime.members();
    members.addMember().searchMember(rei, true).nextUsers().nextOverview().nextPermissions().finish();
    // return to course
    courseRuntime = members.clickToolbarBack().efficiencyStatementConfiguration().enableCertificates(true).enableRecertification().save().clickToolbarBack();
    // Participant log in
    LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
    reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
    // open the course
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openMyCourses().select(courseTitle);
    // go to the test
    CoursePageFragment reiTestCourse = new CoursePageFragment(reiBrowser);
    reiTestCourse.clickTree().selectWithTitle(testNodeTitle);
    // pass the test
    QTI12Page.getQTI12Page(reiBrowser).passE4(rei);
    // open the efficiency statements
    UserToolsPage reiUserTools = new UserToolsPage(reiBrowser);
    reiUserTools.openUserToolsMenu().openMyEfficiencyStatement().assertOnEfficiencyStatmentPage().assertOnCertificateAndStatements(courseTitle).selectStatement(courseTitle).selectStatementSegment().assertOnCourseDetails(testNodeTitle, true);
}
Also used : RepositoryRestClient(org.olat.test.rest.RepositoryRestClient) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) File(java.io.File) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 95 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project openolat by klemens.

the class BusinessGroupTest method confirmMembershipByGroup.

/**
 * First, an administrator make in administration part
 * the confirmation of group's membership mandatory if
 * the group is created by a standard user.<br>
 *
 * A standard user create a group and add a participant.
 * The participant log-in and confirm its membership and
 * visit the group.<br>
 *
 * A first user log in, confirm the membership and search
 * the group.<br>
 *
 * A second user log in but with a rest url to the group
 * and jump to the group after confirming the membership.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void confirmMembershipByGroup(@InitialPage LoginPage loginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO participant = new UserRestClient(deploymentUrl).createRandomUser();
    // admin make the confirmation of membership mandatory
    // for groups created by standard users.
    loginPage.loginAs("administrator", "openolat").resume();
    AdministrationPage administration = new NavigationPage(browser).openAdministration().openGroupSettings().setGroupConfirmationForUser(true);
    // a standard user create a group
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
    // go to groups
    String groupName = "Group-1-" + UUID.randomUUID();
    NavigationPage rymouNavBar = new NavigationPage(ryomouBrowser);
    GroupPage group = rymouNavBar.openGroups(ryomouBrowser).createGroup(groupName, "Confirmation group");
    String groupUrl = group.openAdministration().getGroupURL();
    group.openAdminMembers().addMember().searchMember(participant, false).nextUsers().nextOverview().nextPermissions().finish();
    group.addMember().searchMember(rei, false).nextUsers().nextOverview().nextPermissions().finish();
    // participant login
    LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
    participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).assertOnMembershipConfirmation().confirmMembership();
    NavigationPage participantNavBar = new NavigationPage(participantBrowser);
    participantNavBar.openGroups(participantBrowser).selectGroup(groupName).assertOnInfosPage(groupName);
    // second participant log in with rest url
    reiBrowser.get(groupUrl);
    new LoginPage(reiBrowser).loginAs(rei.getLogin(), rei.getPassword()).assertOnMembershipConfirmation().confirmMembership();
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openGroups(reiBrowser).selectGroup(groupName).assertOnInfosPage(groupName);
    // reset the settings
    administration.setGroupConfirmationForUser(false);
}
Also used : AdministrationPage(org.olat.selenium.page.core.AdministrationPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupPage(org.olat.selenium.page.group.GroupPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)112 Test (org.junit.Test)112 NavigationPage (org.olat.selenium.page.NavigationPage)112 UserRestClient (org.olat.test.rest.UserRestClient)110 UserVO (org.olat.user.restapi.UserVO)110 LoginPage (org.olat.selenium.page.LoginPage)100 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)56 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)44 QTI21Page (org.olat.selenium.page.qti.QTI21Page)40 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)38 URL (java.net.URL)30 File (java.io.File)28 MembersPage (org.olat.selenium.page.course.MembersPage)28 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)20 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)18 GroupPage (org.olat.selenium.page.group.GroupPage)16 QTI21MatchEditorPage (org.olat.selenium.page.qti.QTI21MatchEditorPage)10 Calendar (java.util.Calendar)8 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)8 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)8