use of org.olat.selenium.page.user.UserAdminPage in project OpenOLAT by OpenOLAT.
the class UserTest method importExistingUsers.
/**
* Import 1 new user and 1 existing, change the password and the last name
* of the existing user.
*
* @param loginPage
* @param existingUserBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void importExistingUsers(@InitialPage LoginPage loginPage, @Drone @User WebDriver existingUserBrowser, @Drone @Student WebDriver newUserBrowser) throws IOException, URISyntaxException {
UserVO user1 = new UserRestClient(deploymentUrl).createRandomUser("tsukune");
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
UserAdminPage userAdminPage = navBar.openUserManagement().openImportUsers();
// start import wizard
ImportUserPage importWizard = userAdminPage.startImport();
String uuid = UUID.randomUUID().toString();
String username1 = "moka-" + uuid;
StringBuilder csv = new StringBuilder();
UserVO newUser = importWizard.append(username1, "rosario02", "Moka", "Akashiya", csv);
user1 = importWizard.append(user1, "Aono", "openolat2", csv);
importWizard.fill(csv.toString()).nextData().assertGreen(1).assertWarn(1).updatePasswords().updateUsers().nextOverview().nextGroups().finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
// existing user log in with its new password and check if its name was updated
LoginPage userLoginPage = LoginPage.getLoginPage(existingUserBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(user1.getLogin(), "openolat2").resume().assertLoggedInByLastName("Aono");
// new user log in
LoginPage newLoginPage = LoginPage.getLoginPage(newUserBrowser, deploymentUrl);
// tools
newLoginPage.loginAs(newUser.getLogin(), "rosario02").resume().assertLoggedInByLastName("Akashiya");
}
use of org.olat.selenium.page.user.UserAdminPage in project openolat by klemens.
the class UserTest method importUsers.
/**
* Import 2 new users and check if the first can log in.
*
* @param loginPage
* @param userBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void importUsers(@InitialPage LoginPage loginPage, @Drone @User WebDriver userBrowser) throws IOException, URISyntaxException {
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
UserAdminPage userAdminPage = navBar.openUserManagement().openImportUsers();
// start import wizard
ImportUserPage importWizard = userAdminPage.startImport();
String uuid = UUID.randomUUID().toString();
String username1 = "moka-" + uuid;
String username2 = "mizore-" + uuid;
StringBuilder csv = new StringBuilder();
UserVO user1 = importWizard.append(username1, "rosario01", "Moka", "Akashiya", csv);
importWizard.append(username2, "vampire01", "Mizore", "Shirayuki", csv);
importWizard.fill(csv.toString()).nextData().assertGreen(2).nextOverview().nextGroups().finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
// user log in
LoginPage userLoginPage = LoginPage.getLoginPage(userBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(username1, "rosario01").resume().assertLoggedIn(user1);
}
use of org.olat.selenium.page.user.UserAdminPage in project openolat by klemens.
the class UserTest method deleteUser.
/**
* Test if deleted user cannot login anymore. An administrator
* create a user. This user log in and log out. The administrator
* use the direct delete workflow in user management to delete
* it.<br>
* The user try to log in again, unsuccessfully. The
* administrator doesn't find it anymore in the user
* search of the user management tab.
*/
@Test
@RunAsClient
public void deleteUser(@InitialPage LoginPage loginPage, @Drone @User WebDriver userBrowser) {
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
String uuid = UUID.randomUUID().toString();
String username = "miku-" + uuid;
String lastName = "Hatsune" + uuid;
UserVO userVo = UserAdminPage.createUserVO(username, "Miku", lastName, "miku-" + uuid + "@openolat.com", "miku01");
UserAdminPage userAdminPage = navBar.openUserManagement().openCreateUser().fillUserForm(userVo).assertOnUserEditView(username);
// user log in
LoginPage userLoginPage = LoginPage.getLoginPage(userBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(username, "miku01").resume().assertLoggedIn(userVo);
// log out
new UserToolsPage(userBrowser).logout();
// admin delete
userAdminPage.openDirectDeleteUser().searchUserToDelete(username).selectAndDeleteUser(lastName);
// user try the login
userLoginPage = LoginPage.getLoginPage(userBrowser, deploymentUrl);
userLoginPage.loginDenied(username, "miku01");
// assert on error message
By errorMessageby = By.cssSelector("div.modal-body.alert.alert-danger");
OOGraphene.waitElement(errorMessageby, 2, userBrowser);
// administrator search the deleted user
userAdminPage.openSearchUser().searchByUsername(username).assertNotInUserList(username);
}
use of org.olat.selenium.page.user.UserAdminPage in project openolat by klemens.
the class UserTest method createUser.
/**
* The administrator create an user, the user log in.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createUser(@InitialPage LoginPage loginPage, @Drone @User WebDriver userBrowser) throws IOException, URISyntaxException {
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
String uuid = UUID.randomUUID().toString();
String username = "miku-" + uuid;
UserVO userVo = UserAdminPage.createUserVO(username, "Miku", "Hatsune", "miku-" + uuid + "@openolat.com", "miku01");
UserAdminPage userAdminPage = navBar.openUserManagement().openCreateUser().fillUserForm(userVo).assertOnUserEditView(username);
userAdminPage.openSearchUser().searchByUsername(username).assertOnUserInList(username).selectByUsername(username).assertOnUserEditView(username);
// user log in
LoginPage userLoginPage = LoginPage.getLoginPage(userBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(username, "miku01").resume().assertLoggedIn(userVo);
}
use of org.olat.selenium.page.user.UserAdminPage in project OpenOLAT by OpenOLAT.
the class UserTest method importUsers.
/**
* Import 2 new users and check if the first can log in.
*
* @param loginPage
* @param userBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void importUsers(@InitialPage LoginPage loginPage, @Drone @User WebDriver userBrowser) throws IOException, URISyntaxException {
// login
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
UserAdminPage userAdminPage = navBar.openUserManagement().openImportUsers();
// start import wizard
ImportUserPage importWizard = userAdminPage.startImport();
String uuid = UUID.randomUUID().toString();
String username1 = "moka-" + uuid;
String username2 = "mizore-" + uuid;
StringBuilder csv = new StringBuilder();
UserVO user1 = importWizard.append(username1, "rosario01", "Moka", "Akashiya", csv);
importWizard.append(username2, "vampire01", "Mizore", "Shirayuki", csv);
importWizard.fill(csv.toString()).nextData().assertGreen(2).nextOverview().nextGroups().finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
// user log in
LoginPage userLoginPage = LoginPage.getLoginPage(userBrowser, deploymentUrl);
// tools
userLoginPage.loginAs(username1, "rosario01").resume().assertLoggedIn(user1);
}
Aggregations