use of org.olat.selenium.page.group.GroupPage in project OpenOLAT by OpenOLAT.
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));
}
use of org.olat.selenium.page.group.GroupPage in project OpenOLAT by OpenOLAT.
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);
}
use of org.olat.selenium.page.group.GroupPage in project OpenOLAT by OpenOLAT.
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();
}
use of org.olat.selenium.page.group.GroupPage in project openolat by klemens.
the class BusinessGroupTest method createGroupWithWaitingList.
/**
* An author creates a group, it opens the tab groups and then "My groups". It
* creates a group, enters a number of participants "1", enable the waiting
* list. In members visibility, it see coaches, participants and waiting
* list visible to members.<br>
* A participant and than a student come, book the group. The first enters
* the group, the second the waiting list.<br>
* The author go in the members list to check if it's in the coach list,
* the participant in the participants list and the student in the waiting
* list.
*
* Should show group starting page, with menu items Administration and Bookings visible
*
* @param loginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createGroupWithWaitingList(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver studentBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createRandomUser("Selena");
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
UserVO student = new UserRestClient(deploymentUrl).createRandomUser("Asuka");
loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
// go to groups
String groupName = "Group-1-" + UUID.randomUUID();
GroupPage group = navBar.openGroups(browser).createGroup(groupName, "A group with a waiting list").openAdministration().openEditDetails().setMaxNumberOfParticipants(1).setWaitingList().saveDetails();
// add booking ( token one )
String token = "secret";
String description = "The password is secret";
group.openBookingConfig().openAddDropMenu().addTokenMethod().configureTokenMethod(token, description).assertOnToken(token);
// members see members
group = GroupPage.getGroup(browser).openAdminMembers().setVisibility(true, true, true).openMembers();
// participant search published groups
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
// tools
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// groups
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openGroups(participantBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(participantBrowser).assertOnInfosPage(groupName);
// student search published groups
LoginPage studentLoginPage = LoginPage.getLoginPage(studentBrowser, deploymentUrl);
// tools
studentLoginPage.loginAs(student.getLogin(), student.getPassword()).resume();
// groups
NavigationPage studentNavBar = new NavigationPage(studentBrowser);
studentNavBar.openGroups(studentBrowser).publishedGroups().bookGroup(groupName).bookToken(token);
// are we that we are in the right group?
GroupPage.getGroup(studentBrowser).assertOnWaitingList(groupName);
group = GroupPage.getGroup(browser).openMembers().assertMembersInOwnerList(author).assertMembersInParticipantList(participant).assertMembersInWaitingList(student);
}
use of org.olat.selenium.page.group.GroupPage in project openolat by klemens.
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");
}
Aggregations