use of org.olat.selenium.page.core.AdministrationPage 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.core.AdministrationPage in project OpenOLAT by OpenOLAT.
the class CourseTest method confirmMembershipForCourse.
/**
* First, an administrator make in administration part
* the confirmation of group's membership mandatory if
* the group is created by an author.<br>
*
* An author create a course and a group and add two
* participants. The first user jump to the course
* with a rest url, log in, confirm its membership
* and see the course.<br>
* The second participant log-in, confirm its membership,
* go the "My courses" and visit the course.
*
* @param loginPage
* @param authorBrowser
* @param participantBrowser
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void confirmMembershipForCourse(@InitialPage LoginPage loginPage, @Drone @Author WebDriver authorBrowser, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
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().setGroupConfirmationForAuthor(true);
// author create a course
String courseTitle = "Membership " + UUID.randomUUID();
LoginPage.getLoginPage(authorBrowser, deploymentUrl).loginAs(author).resume();
NavigationPage authorNavBar = new NavigationPage(authorBrowser);
authorNavBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
String groupName = "Groupship " + UUID.randomUUID();
MembersPage members = CoursePageFragment.getCourse(authorBrowser).members();
// create a group
members.selectBusinessGroups().createBusinessGroup(groupName, "-", 1, false, false);
// return to course
authorNavBar.openCourse(courseTitle);
// add the 2 participants to the group
members.selectMembers().addMember().searchMember(rei, true).nextUsers().nextOverview().selectGroupAsParticipant(groupName).nextPermissions().finish();
members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectGroupAsParticipant(groupName).nextPermissions().finish();
members.clickToolbarBack();
// set the course for members only
CoursePageFragment.getCourse(authorBrowser).accessConfiguration().setUserAccess(UserAccess.registred);
String currentUrl = authorBrowser.getCurrentUrl();
int index = currentUrl.indexOf("/Access");
Assert.assertTrue(index > 0);
String courseUrl = currentUrl.substring(0, index);
// rest url -> login -> accept membership
reiBrowser.get(courseUrl);
new LoginPage(reiBrowser).loginAs(rei.getLogin(), rei.getPassword()).assertOnMembershipConfirmation().confirmMembership();
new CoursePageFragment(reiBrowser).assertOnCoursePage().assertOnTitle(courseTitle);
// participant login -> accept membership -> my courses -> course
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).assertOnMembershipConfirmation().confirmMembership();
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openMyCourses().select(courseTitle);
new CoursePageFragment(participantBrowser).assertOnCoursePage().assertOnTitle(courseTitle);
// reset the settings
administration.setGroupConfirmationForAuthor(false);
}
use of org.olat.selenium.page.core.AdministrationPage in project openolat by klemens.
the class CourseTest method confirmMembershipForCourse.
/**
* First, an administrator make in administration part
* the confirmation of group's membership mandatory if
* the group is created by an author.<br>
*
* An author create a course and a group and add two
* participants. The first user jump to the course
* with a rest url, log in, confirm its membership
* and see the course.<br>
* The second participant log-in, confirm its membership,
* go the "My courses" and visit the course.
*
* @param loginPage
* @param authorBrowser
* @param participantBrowser
* @param reiBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void confirmMembershipForCourse(@InitialPage LoginPage loginPage, @Drone @Author WebDriver authorBrowser, @Drone @Participant WebDriver participantBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
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().setGroupConfirmationForAuthor(true);
// author create a course
String courseTitle = "Membership " + UUID.randomUUID();
LoginPage.getLoginPage(authorBrowser, deploymentUrl).loginAs(author).resume();
NavigationPage authorNavBar = new NavigationPage(authorBrowser);
authorNavBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
String groupName = "Groupship " + UUID.randomUUID();
MembersPage members = CoursePageFragment.getCourse(authorBrowser).members();
// create a group
members.selectBusinessGroups().createBusinessGroup(groupName, "-", 1, false, false);
// return to course
authorNavBar.openCourse(courseTitle);
// add the 2 participants to the group
members.selectMembers().addMember().searchMember(rei, true).nextUsers().nextOverview().selectGroupAsParticipant(groupName).nextPermissions().finish();
members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectGroupAsParticipant(groupName).nextPermissions().finish();
members.clickToolbarBack();
// set the course for members only
CoursePageFragment.getCourse(authorBrowser).accessConfiguration().setUserAccess(UserAccess.registred);
String currentUrl = authorBrowser.getCurrentUrl();
int index = currentUrl.indexOf("/Access");
Assert.assertTrue(index > 0);
String courseUrl = currentUrl.substring(0, index);
// rest url -> login -> accept membership
reiBrowser.get(courseUrl);
new LoginPage(reiBrowser).loginAs(rei.getLogin(), rei.getPassword()).assertOnMembershipConfirmation().confirmMembership();
new CoursePageFragment(reiBrowser).assertOnCoursePage().assertOnTitle(courseTitle);
// participant login -> accept membership -> my courses -> course
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).assertOnMembershipConfirmation().confirmMembership();
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.openMyCourses().select(courseTitle);
new CoursePageFragment(participantBrowser).assertOnCoursePage().assertOnTitle(courseTitle);
// reset the settings
administration.setGroupConfirmationForAuthor(false);
}
use of org.olat.selenium.page.core.AdministrationPage 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);
}
Aggregations