Search in sources :

Example 1 with LectureRepositoryParticipantsPage

use of org.olat.selenium.page.lecture.LectureRepositoryParticipantsPage in project OpenOLAT by OpenOLAT.

the class LecturesTest method lecturesRollCall.

/**
 * An author create a course to use the absence management
 * without authorized absence.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lecturesRollCall(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(true, true, false, false, false).save();
    // start
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Rymou");
    LoginPage authorLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    authorLoginPage.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();
    CoursePageFragment course = new CoursePageFragment(browser);
    // add a coach
    course.members().quickAdd(author, true, true);
    // add the participants
    course.members().quickImport(participant1, participant2);
    // enable the lectures
    LectureRepositoryAdminPage lecturesAdmin = course.lecturesAdministration();
    lecturesAdmin.settings().enableLectures().overrideDefaultSettings().saveSettings();
    // add a lecture
    LectureRepositoryAdminListPage lectureList = lecturesAdmin.lectureList();
    String lectureTitle = "2.Lecture";
    lectureList.newLectureBlock().setTitle(lectureTitle).setTeacher(author).setDateOneHourBefore().save();
    // go to the lectures list as "teacher"
    LecturesRepositoryPage teachersLectures = lecturesAdmin.clickToolbarRootCrumb().lectures();
    teachersLectures.openRollCall(lectureTitle).setAbsence(participant1, "1").setAbsence(participant1, "2").setAbsence(participant1, "3").closeRollCall().confirmCloseRollCall().assertOnClosedTable();
    // go to the lecture administration in the course
    lecturesAdmin = teachersLectures.clickToolbarRootCrumb().lecturesAdministration();
    // edit the first admission to see some result
    LectureRepositoryParticipantsPage participantsAdmin = lecturesAdmin.participantList().editParticipant(participant1).firstAdmissionBack().saveParticipant().editParticipant(participant2).firstAdmissionBack().saveParticipant();
    // check
    participantsAdmin.assertOnParticipantLectureBlockAbsent(participant1, 3).assertOnParticipantLectureBlockAbsent(participant2, 0);
}
Also used : LectureRepositoryAdminPage(org.olat.selenium.page.lecture.LectureRepositoryAdminPage) NavigationPage(org.olat.selenium.page.NavigationPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) LectureRepositoryParticipantsPage(org.olat.selenium.page.lecture.LectureRepositoryParticipantsPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) LecturesRepositoryPage(org.olat.selenium.page.lecture.LecturesRepositoryPage) LectureRepositoryAdminListPage(org.olat.selenium.page.lecture.LectureRepositoryAdminListPage) 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 2 with LectureRepositoryParticipantsPage

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

the class LecturesTest method lecturesRollCall.

/**
 * An author create a course to use the absence management
 * without authorized absence.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lecturesRollCall(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(true, true, false, false, false).save();
    // start
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant1 = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO participant2 = new UserRestClient(deploymentUrl).createRandomUser("Rymou");
    LoginPage authorLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    authorLoginPage.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();
    CoursePageFragment course = new CoursePageFragment(browser);
    // add a coach
    course.members().quickAdd(author, true, true);
    // add the participants
    course.members().quickImport(participant1, participant2);
    // enable the lectures
    LectureRepositoryAdminPage lecturesAdmin = course.lecturesAdministration();
    lecturesAdmin.settings().enableLectures().overrideDefaultSettings().saveSettings();
    // add a lecture
    LectureRepositoryAdminListPage lectureList = lecturesAdmin.lectureList();
    String lectureTitle = "2.Lecture";
    lectureList.newLectureBlock().setTitle(lectureTitle).setTeacher(author).setDateOneHourBefore().save();
    // go to the lectures list as "teacher"
    LecturesRepositoryPage teachersLectures = lecturesAdmin.clickToolbarRootCrumb().lectures();
    teachersLectures.openRollCall(lectureTitle).setAbsence(participant1, "1").setAbsence(participant1, "2").setAbsence(participant1, "3").closeRollCall().confirmCloseRollCall().assertOnClosedTable();
    // go to the lecture administration in the course
    lecturesAdmin = teachersLectures.clickToolbarRootCrumb().lecturesAdministration();
    // edit the first admission to see some result
    LectureRepositoryParticipantsPage participantsAdmin = lecturesAdmin.participantList().editParticipant(participant1).firstAdmissionBack().saveParticipant().editParticipant(participant2).firstAdmissionBack().saveParticipant();
    // check
    participantsAdmin.assertOnParticipantLectureBlockAbsent(participant1, 3).assertOnParticipantLectureBlockAbsent(participant2, 0);
}
Also used : LectureRepositoryAdminPage(org.olat.selenium.page.lecture.LectureRepositoryAdminPage) NavigationPage(org.olat.selenium.page.NavigationPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) LectureRepositoryParticipantsPage(org.olat.selenium.page.lecture.LectureRepositoryParticipantsPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) LecturesRepositoryPage(org.olat.selenium.page.lecture.LecturesRepositoryPage) LectureRepositoryAdminListPage(org.olat.selenium.page.lecture.LectureRepositoryAdminListPage) 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)2 Test (org.junit.Test)2 LoginPage (org.olat.selenium.page.LoginPage)2 NavigationPage (org.olat.selenium.page.NavigationPage)2 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)2 LectureRepositoryAdminListPage (org.olat.selenium.page.lecture.LectureRepositoryAdminListPage)2 LectureRepositoryAdminPage (org.olat.selenium.page.lecture.LectureRepositoryAdminPage)2 LectureRepositoryParticipantsPage (org.olat.selenium.page.lecture.LectureRepositoryParticipantsPage)2 LecturesRepositoryPage (org.olat.selenium.page.lecture.LecturesRepositoryPage)2 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)2 UserRestClient (org.olat.test.rest.UserRestClient)2 UserVO (org.olat.user.restapi.UserVO)2