Skip to content
Snippets Groups Projects
Commit bdf06159 authored by srosse's avatar srosse
Browse files

OO-1949: selenium test for membership confirmation of a group with jump in url

parent d7387979
No related branches found
No related tags found
No related merge requests found
......@@ -371,7 +371,13 @@ public class BusinessGroupTest {
*
* A standard user create a group and add a participant.
* The participant log-in and confirm its membership and
* visit the group.
* 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
......@@ -381,9 +387,11 @@ public class BusinessGroupTest {
@RunAsClient
public void confirmMembershipByGroup(@InitialPage LoginPage loginPage,
@Drone @User WebDriver ryomouBrowser,
@Drone @Participant WebDriver participantBrowser)
@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
......@@ -409,12 +417,20 @@ public class BusinessGroupTest {
.openGroups(ryomouBrowser)
.createGroup(groupName, "Confirmation group");
MembersWizardPage members = group
.openAdministration()
.openAdminMembers()
.addMember();
members.searchMember(participant, false)
String groupUrl = group
.openAdministration()
.getGroupURL();
group.openAdminMembers()
.addMember()
.searchMember(participant, false)
.next()
.next()
.next()
.finish();
group.addMember()
.searchMember(rei, false)
.next()
.next()
.next()
......@@ -432,6 +448,18 @@ public class BusinessGroupTest {
.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);
}
......
......@@ -62,11 +62,18 @@ public class LoginPage {
private WebDriver browser;
public static LoginPage getLoginPage(WebDriver browser, URL deployemntUrl) {
LoginPage page = new LoginPage();
page.browser = browser;
page.browser.navigate().to(deployemntUrl);
LoginPage page = new LoginPage(browser);
browser.navigate().to(deployemntUrl);
return page;
}
public LoginPage() {
//
}
public LoginPage(WebDriver browser) {
this.browser = browser;
}
public LoginPage assertOnLoginPage() {
Assert.assertTrue(browser.findElement(loginFormBy).isDisplayed());
......
......@@ -180,6 +180,18 @@ public class GroupPage {
return this;
}
/**
* Grap the REST url of the group (only, you need
* to be in administration > description changes.
* @return
*/
public String getGroupURL() {
By urlBy = By.cssSelector("p.o_sel_group_url");
WebElement urlEl = browser.findElement(urlBy);
String url = urlEl.getText();
return url;
}
public void close() {
By closeBy = By.cssSelector("a i.o_icon_close_tool");
browser.findElement(closeBy).click();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment