Search in sources :

Example 11 with GroupPage

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

the class BusinessGroupTest method enrollment.

/**
 * An author create a course and a business group in the members
 * management. It has max. participants set to 1 and no waiting list.
 * Than it returns in the course editor to create an enrollment
 * course element. It configure it and select the group created before.<br>
 *
 * Three users goes to the course and try to enroll. One will become
 * a participant, the 2 others get an error message.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void enrollment(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("kanu");
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Enrollment-2-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a group in members management
    String groupName = "Enroll - " + UUID.randomUUID();
    CoursePageFragment authorCourse = CoursePageFragment.getCourse(browser);
    MembersPage membersPage = authorCourse.members().selectBusinessGroups().createBusinessGroup(groupName, "-", 1, false, false);
    // back to the members page
    navBar.openCourse(courseTitle);
    authorCourse = membersPage.clickToolbarBack();
    // create an enrollment course element
    String enNodeTitle = "Enroll - 2";
    CourseEditorPageFragment courseEditor = authorCourse.edit().createNode("en").nodeTitle(enNodeTitle);
    // select the group created above
    EnrollmentConfigurationPage enrolmentConfig = new EnrollmentConfigurationPage(browser);
    enrolmentConfig.selectConfiguration().selectBusinessGroups();
    // publish the course
    courseEditor.publish().quickPublish(UserAccess.registred);
    GroupPage authorGroup = navBar.openGroups(browser).selectGroup(groupName).openAdministration().openAdminMembers().setVisibility(false, true, false).openMembers().assertParticipantList();
    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());
    }
    int errors = 0;
    for (Enrollment enrollment : participantDrivers) {
        if (enrollment.getEnrollmentPage().hasError()) {
            errors++;
        }
    }
    // author check the lists
    authorGroup.openMembers();
    // must a participant and 2 in waiting list
    int participants = 0;
    for (Enrollment enrollment : participantDrivers) {
        if (authorGroup.isInMembersParticipantList(enrollment.getUser())) {
            participants++;
        }
    }
    Assert.assertEquals(1, participants);
    Assert.assertEquals(participantDrivers.length - 1, errors);
}
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) MembersPage(org.olat.selenium.page.course.MembersPage) EnrollmentConfigurationPage(org.olat.selenium.page.course.EnrollmentConfigurationPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 12 with GroupPage

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

the class BusinessGroupTest method groupMembersVisibility.

/**
 * An author create a group, set the visibility to
 * show owners and participants. Add a member to the
 * group.
 *
 * The participant log in, search the group and open it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void groupMembersVisibility(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
    UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Aoi");
    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");
    MembersWizardPage members = group.openAdministration().openAdminMembers().setVisibility(true, true, false).addMember();
    members.searchMember(participant, false).nextUsers().nextOverview().nextPermissions().finish();
    LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
    // tools
    participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
    NavigationPage participantNavBar = new NavigationPage(participantBrowser);
    participantNavBar.openGroups(participantBrowser).selectGroup(groupName);
    WebElement contentEl = participantBrowser.findElement(By.id("o_main_center_content_inner"));
    String content = contentEl.getText();
    Assert.assertTrue(content.contains(groupName));
}
Also used : MembersWizardPage(org.olat.selenium.page.group.MembersWizardPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupPage(org.olat.selenium.page.group.GroupPage) WebElement(org.openqa.selenium.WebElement) 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 13 with GroupPage

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

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 14 with GroupPage

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

the class AssessmentTest method taskWithGroupsAndStandardSettings.

/**
 * An author create a course for a group task with the default
 * settings, all steps are selected, grading with only passed,
 * 3 groups, 2 tasks, 1 solution...</br>
 * A group has 2 participants, the first select a task, the
 * second submit 2 documents, one with the embedded editor,
 * one with the upload mechanism.</br>
 * The author reviews the documents, use the assessment tool
 * for group within the course element to set passed to the
 * group.</br>
 * The 2 participants check if they successfully passed the task.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void taskWithGroupsAndStandardSettings(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser, @Drone @Participant WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course-with-group-task-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type Test with the test that we create above
    String gtaNodeTitle = "Group task 1";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("gta").nodeTitle(gtaNodeTitle);
    GroupTaskConfigurationPage gtaConfig = new GroupTaskConfigurationPage(browser);
    gtaConfig.selectWorkflow().openBusinessGroupChooser().createBusinessGroup("Group to task - 1").createBusinessGroup("Group to task - 2").createBusinessGroup("Group to task - 3").confirmBusinessGroupsSelection().saveWorkflow().selectAssignment();
    URL task1Url = JunitTestHelper.class.getResource("file_resources/task_1_a.txt");
    File task1File = new File(task1Url.toURI());
    String taskName1 = "Task-1";
    gtaConfig.uploadTask(taskName1, task1File);
    URL task2Url = JunitTestHelper.class.getResource("file_resources/task_1_b.txt");
    File task2File = new File(task2Url.toURI());
    String taskName2 = "Task-2-b";
    gtaConfig.uploadTask(taskName2, task2File).saveTasks().selectSolution();
    URL solutionUrl = JunitTestHelper.class.getResource("file_resources/solution_1.txt");
    File solutionFile = new File(solutionUrl.toURI());
    gtaConfig.uploadSolution("The Best Solution", solutionFile);
    courseEditor.publish().quickPublish(UserAccess.guest);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    GroupPage groupPage = membersPage.selectBusinessGroups().selectBusinessGroup("Group to task - 1").openAdministration().openAdminMembers();
    groupPage.addMember().searchMember(kanu, true).nextUsers().nextOverview().nextPermissions().finish();
    groupPage.addMember().searchMember(ryomou, true).nextUsers().nextOverview().nextPermissions().finish();
    groupPage.close();
    // go to the course
    CoursePageFragment coursePage = membersPage.clickToolbarBack();
    coursePage.clickTree().selectWithTitle(gtaNodeTitle);
    // Participant log in
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou).resume();
    // open the course
    NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
    ryomouNavBar.openMyCourses().select(courseTitle);
    // go to the group task
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    GroupTaskPage ryomouTask = new GroupTaskPage(ryomouBrowser);
    ryomouTask.assertAssignmentAvailable().selectTask(taskName2).assertSubmissionAvailable();
    // Participant 2 log in
    LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
    kanuLoginPage.loginAs(kanu).resume();
    // open the course
    NavigationPage kanuNavBar = new NavigationPage(kanuBrowser);
    kanuNavBar.openMyCourses().select(courseTitle);
    // go to the group task
    CoursePageFragment kanuTestCourse = new CoursePageFragment(kanuBrowser);
    kanuTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    URL submit1Url = JunitTestHelper.class.getResource("file_resources/submit_1.txt");
    File submit1File = new File(submit1Url.toURI());
    String submittedFilename = "my_solution.html";
    String submittedText = "This is my solution";
    GroupTaskPage kanuTask = new GroupTaskPage(kanuBrowser);
    kanuTask.assertTask(taskName2).assertSubmissionAvailable().submitFile(submit1File).submitText(submittedFilename, submittedText).submitDocuments();
    // back to author
    coursePage.clickTree().selectWithTitle(gtaNodeTitle);
    GroupTaskToCoachPage groupToCoach = new GroupTaskToCoachPage(browser);
    groupToCoach.selectBusinessGroupToCoach("Group to task - 1").assertSubmittedDocument("my_solution.html").assertSubmittedDocument("submit_1.txt").reviewed().openGroupAssessment().groupAssessment(Boolean.TRUE, null);
    // participant check if they passed
    kanuTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    kanuTask.assertPassed();
    ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    ryomouTask.assertPassed();
}
Also used : GroupPage(org.olat.selenium.page.group.GroupPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) GroupTaskPage(org.olat.selenium.page.course.GroupTaskPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupTaskConfigurationPage(org.olat.selenium.page.course.GroupTaskConfigurationPage) MembersPage(org.olat.selenium.page.course.MembersPage) File(java.io.File) GroupTaskToCoachPage(org.olat.selenium.page.course.GroupTaskToCoachPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 15 with GroupPage

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

the class BusinessGroupTest method groupCalendar_addEditEvent.

/**
 * A coach create a group, enable the calendar, create an event
 * and save it. Reopen it, edit it and save it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void groupCalendar_addEditEvent(@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-1-" + UUID.randomUUID();
    GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A very little group to delete");
    group.openAdministration().openAdminTools().enableCalendarTool();
    // add an event to the calendar
    CalendarPage calendar = group.openCalendar().assertOnCalendar().addEvent(2).setDescription("Hello", "Very important event", "here or there").save().assertOnEvent("Hello");
    // edit the event
    calendar.openDetails("Hello").edit().setDescription("Bye", null, null).save();
    // check the changes
    calendar.assertOnEvent("Bye");
}
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)

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