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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations