Search in sources :

Example 16 with GroupPage

use of org.olat.selenium.page.group.GroupPage in project OpenOLAT by OpenOLAT.

the class BusinessGroupTest method enrollmentWithWaitingList.

/**
 * An author create a course, with an enrollment course element. It
 * configure it and create a group with max. participant set to 1 and
 * enables the waiting list.<br>
 *
 * Three users goes to the course and try to enroll. One will become
 * a participant, the 2 others land in the waiting list.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void enrollmentWithWaitingList(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("kanu");
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    // create a course
    String courseTitle = "Enrolment-1-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type Enrolment
    String enNodeTitle = "Enrolment-1";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("en").nodeTitle(enNodeTitle);
    // configure enrolment with a group that we create
    String groupName = "Enrolment group - 1 " + UUID.randomUUID();
    EnrollmentConfigurationPage enrolmentConfig = new EnrollmentConfigurationPage(browser);
    enrolmentConfig.selectConfiguration().createBusinessGroup(groupName, "-", 1, true, false);
    // publish the course
    courseEditor.publish().quickPublish(UserAccess.registred);
    courseEditor.clickToolbarBack();
    GroupPage authorGroup = navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true, true, true).openMembers().assertParticipantList();
    // Rei open the course
    Enrollment[] participantDrivers = new Enrollment[] { new Enrollment(ryomou, ryomouBrowser), new Enrollment(rei, reiBrowser), new Enrollment(kanu, kanuBrowser) };
    for (Enrollment enrollment : participantDrivers) {
        WebDriver driver = enrollment.getDriver();
        LoginPage.getLoginPage(driver, deploymentUrl).loginAs(enrollment.getUser()).resume();
        NavigationPage participantNavBar = new NavigationPage(driver);
        participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
        // go to the enrollment
        CoursePageFragment participantCourse = new CoursePageFragment(driver);
        participantCourse.clickTree().selectWithTitle(enNodeTitle);
        EnrollmentPage enrollmentPage = new EnrollmentPage(driver);
        enrollmentPage.assertOnEnrolmentPage();
        enrollment.setEnrollmentPage(enrollmentPage);
    }
    // enroll
    for (Enrollment enrollment : participantDrivers) {
        enrollment.getEnrollmentPage().enrollNoWait();
    }
    // wait
    for (Enrollment enrollment : participantDrivers) {
        OOGraphene.waitBusy(enrollment.getDriver());
    }
    // author check the lists
    authorGroup.openMembers();
    // must a participant and 2 in waiting list
    int participants = 0;
    int waitingList = 0;
    for (Enrollment enrollment : participantDrivers) {
        if (authorGroup.isInMembersParticipantList(enrollment.getUser()))
            participants++;
        if (authorGroup.isInMembersInWaitingList(enrollment.getUser()))
            waitingList++;
    }
    Assert.assertEquals(1, participants);
    Assert.assertEquals(2, waitingList);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) GroupPage(org.olat.selenium.page.group.GroupPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) UserRestClient(org.olat.test.rest.UserRestClient) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) EnrollmentPage(org.olat.selenium.page.course.EnrollmentPage) EnrollmentConfigurationPage(org.olat.selenium.page.course.EnrollmentConfigurationPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 17 with GroupPage

use of org.olat.selenium.page.group.GroupPage in project OpenOLAT by OpenOLAT.

the class BusinessGroupTest method collaborativeTools.

/**
 * Configure group tools: create a group, go to administration > tools
 * select the informations for members and write some message. Select
 * all tools: contact, calendar, folder, forum, chat, wiki and portfolio.<br>
 *
 * Check that all these functions are available.
 *
 * @param loginPage
 * @param participantBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void collaborativeTools(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    // go to groups
    String groupName = "Group-1-" + UUID.randomUUID();
    GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A very little group");
    group.openAdministration().openAdminTools().enableTools();
    // check the news
    group.openNews().createMessage().setMessage("Information 0", "A very important info").next().finish().assertOnMessageTitle("Information 0");
    // check calendar
    group.openCalendar().assertOnCalendar();
    // check members @see other selenium test dedicated to this one
    // check contact
    group.openContact().assertOnContact();
    // check folder
    String directoryName = "New directory";
    group.openFolder().assertOnFolderCmp().createDirectory(directoryName).assertOnDirectory(directoryName).createHTMLFile("New file", "Some really cool content.").assertOnFile("new file.html");
    // check forum
    String threadBodyMarker = UUID.randomUUID().toString();
    group.openForum().createThread("New thread in a group", "Very interessant discussion in a group" + threadBodyMarker, null).assertMessageBody(threadBodyMarker);
    // check chat @see other selenium test dedicated to this one
    // check wiki
    String wikiMarker = UUID.randomUUID().toString();
    group.openWiki().createPage("Group page", "Content for the group's wiki " + wikiMarker).assertOnContent(wikiMarker);
    // check portfolio
    String pageTitle = "Portfolio page " + UUID.randomUUID();
    String sectionTitle = "Section " + UUID.randomUUID();
    group.openPortfolio().assertOnBinder().selectTableOfContent().selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle).createEntry(pageTitle).selectEntries().assertOnPageInEntries(pageTitle).selectTableOfContent().assertOnPageInToc(pageTitle);
}
Also used : UserVO(org.olat.user.restapi.UserVO) GroupPage(org.olat.selenium.page.group.GroupPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 18 with GroupPage

use of org.olat.selenium.page.group.GroupPage 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)

Example 19 with GroupPage

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

the class BusinessGroupTest method groupCalendar_recurringEvent.

/**
 * A coach create a group, enable the calendar, create a recurring event
 * and save it. Reopen it, edit it and save it, confirm that it will
 * only change a single occurence of the recurring event. After change
 * the begin and end hour of all others events.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void groupCalendar_recurringEvent(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO coach = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(coach.getLogin(), coach.getPassword()).resume();
    // go to groups
    String groupName = "iCal-2-" + UUID.randomUUID();
    GroupPage group = navBar.openGroups(browser).createGroup(groupName, "Calendar with a recurring event");
    group.openAdministration().openAdminTools().enableCalendarTool();
    int startdDate = 2;
    // add an event to the calendar
    CalendarPage calendar = group.openCalendar().assertOnCalendar().addEvent(startdDate).setDescription("Recurring", "Very important event 4-5 times", "In the way").setAllDay(false).setBeginEnd(10, 11).setRecurringEvent(KalendarEvent.WEEKLY, 28).save().assertOnEvents("Recurring", 4);
    // pick an occurence of the recurring event and modify it
    calendar.openDetailsOccurence("Recurring", 9).edit().setDescription("Special", null, null).save().confirmModifyOneOccurence().assertOnEvents("Special", 1).assertOnEvents("Recurring", 3);
    // pick the first occurence and change all events but the modified above
    calendar.openDetailsOccurence("Recurring", 2).edit().setBeginEnd(11, 12).assertOnEvents("Special", 1).save().confirmModifyAllOccurences().assertOnEventsAt("Recurring", 3, 11);
}
Also used : UserVO(org.olat.user.restapi.UserVO) GroupPage(org.olat.selenium.page.group.GroupPage) CalendarPage(org.olat.selenium.page.core.CalendarPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 20 with GroupPage

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

the class BusinessGroupTest method enrollmentWithWaitingList.

/**
 * An author create a course, with an enrollment course element. It
 * configure it and create a group with max. participant set to 1 and
 * enables the waiting list.<br>
 *
 * Three users goes to the course and try to enroll. One will become
 * a participant, the 2 others land in the waiting list.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void enrollmentWithWaitingList(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("kanu");
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    // create a course
    String courseTitle = "Enrolment-1-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type Enrolment
    String enNodeTitle = "Enrolment-1";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("en").nodeTitle(enNodeTitle);
    // configure enrolment with a group that we create
    String groupName = "Enrolment group - 1 " + UUID.randomUUID();
    EnrollmentConfigurationPage enrolmentConfig = new EnrollmentConfigurationPage(browser);
    enrolmentConfig.selectConfiguration().createBusinessGroup(groupName, "-", 1, true, false);
    // publish the course
    courseEditor.publish().quickPublish(UserAccess.registred);
    courseEditor.clickToolbarBack();
    GroupPage authorGroup = navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(true, true, true).openMembers().assertParticipantList();
    // Rei open the course
    Enrollment[] participantDrivers = new Enrollment[] { new Enrollment(ryomou, ryomouBrowser), new Enrollment(rei, reiBrowser), new Enrollment(kanu, kanuBrowser) };
    for (Enrollment enrollment : participantDrivers) {
        WebDriver driver = enrollment.getDriver();
        LoginPage.getLoginPage(driver, deploymentUrl).loginAs(enrollment.getUser()).resume();
        NavigationPage participantNavBar = new NavigationPage(driver);
        participantNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
        // go to the enrollment
        CoursePageFragment participantCourse = new CoursePageFragment(driver);
        participantCourse.clickTree().selectWithTitle(enNodeTitle);
        EnrollmentPage enrollmentPage = new EnrollmentPage(driver);
        enrollmentPage.assertOnEnrolmentPage();
        enrollment.setEnrollmentPage(enrollmentPage);
    }
    // enroll
    for (Enrollment enrollment : participantDrivers) {
        enrollment.getEnrollmentPage().enrollNoWait();
    }
    // wait
    for (Enrollment enrollment : participantDrivers) {
        OOGraphene.waitBusy(enrollment.getDriver());
    }
    // author check the lists
    authorGroup.openMembers();
    // must a participant and 2 in waiting list
    int participants = 0;
    int waitingList = 0;
    for (Enrollment enrollment : participantDrivers) {
        if (authorGroup.isInMembersParticipantList(enrollment.getUser()))
            participants++;
        if (authorGroup.isInMembersInWaitingList(enrollment.getUser()))
            waitingList++;
    }
    Assert.assertEquals(1, participants);
    Assert.assertEquals(2, waitingList);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) GroupPage(org.olat.selenium.page.group.GroupPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) UserRestClient(org.olat.test.rest.UserRestClient) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) EnrollmentPage(org.olat.selenium.page.course.EnrollmentPage) EnrollmentConfigurationPage(org.olat.selenium.page.course.EnrollmentConfigurationPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)22 Test (org.junit.Test)22 GroupPage (org.olat.selenium.page.group.GroupPage)22 UserRestClient (org.olat.test.rest.UserRestClient)22 UserVO (org.olat.user.restapi.UserVO)22 NavigationPage (org.olat.selenium.page.NavigationPage)16 LoginPage (org.olat.selenium.page.LoginPage)10 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)8 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)8 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)6 EnrollmentPage (org.olat.selenium.page.course.EnrollmentPage)6 MembersPage (org.olat.selenium.page.course.MembersPage)6 WebDriver (org.openqa.selenium.WebDriver)6 CalendarPage (org.olat.selenium.page.core.CalendarPage)4 File (java.io.File)2 URL (java.net.URL)2 AdministrationPage (org.olat.selenium.page.core.AdministrationPage)2 IMPage (org.olat.selenium.page.core.IMPage)2 GroupTaskConfigurationPage (org.olat.selenium.page.course.GroupTaskConfigurationPage)2 GroupTaskPage (org.olat.selenium.page.course.GroupTaskPage)2