Search in sources :

Example 11 with AuthoringEnvPage

use of org.olat.selenium.page.repository.AuthoringEnvPage in project OpenOLAT by OpenOLAT.

the class LecturesTest method lecturesRollCall_defaultAuthorizedAbsence.

/**
 * 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.<br>
 * The absence management has the following settings: holding partial
 * lecture is disable, cancel status of lectures is disabled, authorized
 * absence are enabled with them as default authorized, teachers can
 * authorized absences.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void lecturesRollCall_defaultAuthorizedAbsence(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    // configure the lectures module
    loginPage.loginAs("administrator", "openolat").resume();
    new NavigationPage(browser).openAdministration().openLecturesSettings().configure(false, false, true, true, true).save();
    // start the test with authorized absence on
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    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(author, 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(author).setDate(today, hour, 0, hour, 59).save();
    // coach at work
    LoginPage coachLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    coachLoginPage.loginAs(author);
    new RollCallInterceptorPage(browser).start().setAbsence(participant1, "1").closeRollCall().confirmCloseRollCall().assertOnClosedTable();
    // participant check it roll call
    LoginPage participantLoginPage = LoginPage.getLoginPage(browser, deploymentUrl);
    participantLoginPage.loginAs(participant1).resume();
    UserToolsPage participantUserTools = new UserToolsPage(browser);
    participantUserTools.openUserToolsMenu().openLectures().assertOnParticipantLecturesList().selectCourseAsParticipant(title).assertOnParticipantLectureBlocks().assertOnParticipantLectureBlockAuthorised(author, 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 12 with AuthoringEnvPage

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

the class PortfolioV2Test method collectWikiMediaInWikiResource.

/**
 * Create a wiki as resource, add and fill a page. The author
 * picks the page as media and go in its media center to see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collectWikiMediaInWikiResource(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "PF-Wiki-" + UUID.randomUUID();
    // create a wiki and launch it
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.wiki).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // create a page in the wiki
    String page = "LMS-" + UUID.randomUUID();
    String content = "Learning Management System";
    WikiPage wiki = WikiPage.getWiki(browser);
    // create page and add it as artefact to portfolio
    String mediaTitle = "My own wiki page";
    wiki.createPage(page, content).addAsMedia().fillForumMedia(mediaTitle, "A post I write");
    UserToolsPage userTools = new UserToolsPage(browser);
    MediaCenterPage mediaCenter = userTools.openUserToolsMenu().openPortfolioV2().openMediaCenter();
    mediaCenter.assertOnMedia(mediaTitle).selectMedia(mediaTitle).assertOnMediaDetails(mediaTitle);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) WikiPage(org.olat.selenium.page.wiki.WikiPage) MediaCenterPage(org.olat.selenium.page.portfolio.MediaCenterPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 13 with AuthoringEnvPage

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

the class CourseTest method createCourse.

/**
 * An author create a course, jump to it, open the editor
 * add an info messages course element, publish the course
 * and view it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Selen-" + UUID.randomUUID();
    // create course
    RepositoryEditDescriptionPage editDescription = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab();
    // from description editor, back to the course
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit();
    // create a course element of type info messages
    PublisherPageFragment publisher = editor.assertOnEditor().createNode("info").publish();
    // publish
    publisher.assertOnPublisher().nextSelectNodes().selectAccess(UserAccess.guest).nextAccess().selectCatalog(false).nextCatalog().finish();
    // back to the course
    CoursePageFragment publishedCourse = editor.clickToolbarBack();
    // review the course
    publishedCourse.assertOnCoursePage().clickTree();
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) PublisherPageFragment(org.olat.selenium.page.course.PublisherPageFragment) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 14 with AuthoringEnvPage

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

the class CourseTest method concurrentEditCourse.

/**
 * An author create a course, add a second user as co-author
 * of the course, and edit the course.<br>
 * The co-author select the course and try to edit it, unsuccessfully.
 * It try to edit the course directly from the author list without
 * success.<br>
 * The author closes the editor and the co-author is allowed to edit.
 * The author cannot edit i anymore...
 *
 * @param loginPage Login page of the author
 * @param coAuthorBrowser the browser for the coauthor
 */
@Test
@RunAsClient
public void concurrentEditCourse(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver coAuthorBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO coAuthor = new UserRestClient(deploymentUrl).createAuthor("Rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Coedit-" + UUID.randomUUID();
    // create course
    authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
    // add a second owner
    MembersPage members = new CoursePageFragment(browser).members();
    members.addMember().searchMember(coAuthor, true).nextUsers().nextOverview().selectRepositoryEntryRole(true, false, false).nextPermissions().finish();
    // open the editor
    CoursePageFragment coursePage = members.clickToolbarBack();
    CourseEditorPageFragment editor = coursePage.edit();
    // the second author come in
    LoginPage coAuthroLoginPage = LoginPage.getLoginPage(coAuthorBrowser, deploymentUrl);
    coAuthroLoginPage.loginAs(coAuthor.getLogin(), coAuthor.getPassword()).resume();
    // go to authoring
    NavigationPage coAuthorNavBar = new NavigationPage(coAuthorBrowser);
    coAuthorNavBar.assertOnNavigationPage().openAuthoringEnvironment().selectResource(title);
    // try to edit
    CoursePageFragment coAuthorCourse = new CoursePageFragment(coAuthorBrowser);
    coAuthorCourse.tryToEdit().assertOnWarning();
    // retry in list
    coAuthorNavBar.openAuthoringEnvironment().editResource(title);
    new CourseEditorPageFragment(coAuthorBrowser).assertOnWarning();
    // author close the course editor
    editor.clickToolbarBack();
    coursePage.assertOnCoursePage();
    // co-author edit the course
    CourseEditorPageFragment coAuthorEditor = coAuthorCourse.edit().assertOnEditor();
    // author try
    coursePage.tryToEdit().assertOnWarning();
    // co-author close the editor
    coAuthorEditor.clickToolbarBack().assertOnCoursePage();
    // author reopens the editor
    coursePage.edit().assertOnEditor();
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) 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 15 with AuthoringEnvPage

use of org.olat.selenium.page.repository.AuthoringEnvPage 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)34 Test (org.junit.Test)34 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)34 UserRestClient (org.olat.test.rest.UserRestClient)34 UserVO (org.olat.user.restapi.UserVO)34 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)30 NavigationPage (org.olat.selenium.page.NavigationPage)20 LoginPage (org.olat.selenium.page.LoginPage)18 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)14 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)12 Calendar (java.util.Calendar)8 MembersPage (org.olat.selenium.page.course.MembersPage)8 LectureRepositoryAdminListPage (org.olat.selenium.page.lecture.LectureRepositoryAdminListPage)8 LectureRepositoryAdminPage (org.olat.selenium.page.lecture.LectureRepositoryAdminPage)8 URL (java.net.URL)6 RollCallInterceptorPage (org.olat.selenium.page.lecture.RollCallInterceptorPage)6 RepositoryEditDescriptionPage (org.olat.selenium.page.repository.RepositoryEditDescriptionPage)6 File (java.io.File)4 Date (java.util.Date)2 BookingPage (org.olat.selenium.page.core.BookingPage)2