diff --git a/src/test/java/org/olat/selenium/UserTest.java b/src/test/java/org/olat/selenium/UserTest.java index 7cd810c4e57e44749d1339fb67c30ff82ff5d5c2..ca6f8f51b4b0330722130dc2f288cb9230782383 100644 --- a/src/test/java/org/olat/selenium/UserTest.java +++ b/src/test/java/org/olat/selenium/UserTest.java @@ -519,11 +519,12 @@ public class UserTest { String username2 = "mizore-" + uuid; StringBuilder csv = new StringBuilder(); - importWizard.append(username1, "rosario01", "Moka", "Akashiya", csv); + UserVO user1 = importWizard.append(username1, "rosario01", "Moka", "Akashiya", csv); importWizard.append(username2, "vampire01", "Mizore", "Shirayuki", csv); importWizard .fill(csv.toString()) .next() // -> preview + .assertGreen(2) .next() // -> groups .next() // -> emails .finish(); @@ -536,6 +537,6 @@ public class UserTest { userLoginPage .loginAs(username1, "rosario01") .resume() - .assertLoggedIn(username1); + .assertLoggedIn(user1); } } diff --git a/src/test/java/org/olat/selenium/page/LoginPage.java b/src/test/java/org/olat/selenium/page/LoginPage.java index 3bbf05ff8bf8d246494cba4e2249f951d84ae841..c82430671da9255fe8d1f681531a7dde3ed3ac0f 100644 --- a/src/test/java/org/olat/selenium/page/LoginPage.java +++ b/src/test/java/org/olat/selenium/page/LoginPage.java @@ -79,14 +79,6 @@ public class LoginPage { Assert.assertTrue(name.contains(user.getLastName())); } - public void assertLoggedIn(String username) { - WebElement usernameEl = browser.findElement(usernameFooterBy); - Assert.assertNotNull(usernameEl); - Assert.assertTrue(usernameEl.isDisplayed()); - String value = usernameEl.getText(); - Assert.assertTrue(value.contains(username)); - } - /** * Login and accept the disclaimer if there is one. * diff --git a/src/test/java/org/olat/selenium/page/user/ImportUserPage.java b/src/test/java/org/olat/selenium/page/user/ImportUserPage.java index 74bca1f1fe5f7c91a6d703727837c59a1e041c2b..acac1fc0ae260bb738bf1203b1be53f3aef178c3 100644 --- a/src/test/java/org/olat/selenium/page/user/ImportUserPage.java +++ b/src/test/java/org/olat/selenium/page/user/ImportUserPage.java @@ -21,9 +21,11 @@ package org.olat.selenium.page.user; import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; +import java.util.List; import org.junit.Assert; import org.olat.selenium.page.graphene.OOGraphene; +import org.olat.user.restapi.UserVO; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.Platform; @@ -74,7 +76,7 @@ public class ImportUserPage { * @param lastName * @param sb */ - public void append(String username, String password, String firstName, String lastName, StringBuilder sb) { + public UserVO append(String username, String password, String firstName, String lastName, StringBuilder sb) { String email = username.replace("-", "") + "@frentix.com"; String institution = "frentix GmbH"; @@ -90,6 +92,20 @@ public class ImportUserPage { .append(institution).append(" ") .append(institutionNumber).append(" ") .append(institutionEmail).append('\n'); + + UserVO userVo = new UserVO(); + userVo.setLogin(username); + userVo.setFirstName(firstName); + userVo.setLastName(lastName); + userVo.setEmail(email); + return userVo; + } + + public ImportUserPage assertGreen(int numOfGreen) { + By greenBy = By.cssSelector(".o_dnd_label i.o_icon_new"); + List<WebElement> greenEls = browser.findElements(greenBy); + Assert.assertEquals(numOfGreen, greenEls.size()); + return this; } /**