Search in sources :

Example 1 with ImportUserPage

use of org.olat.selenium.page.user.ImportUserPage 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");
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserAdminPage(org.olat.selenium.page.user.UserAdminPage) ImportUserPage(org.olat.selenium.page.user.ImportUserPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 2 with ImportUserPage

use of org.olat.selenium.page.user.ImportUserPage 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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserAdminPage(org.olat.selenium.page.user.UserAdminPage) ImportUserPage(org.olat.selenium.page.user.ImportUserPage) LoginPage(org.olat.selenium.page.LoginPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 3 with ImportUserPage

use of org.olat.selenium.page.user.ImportUserPage 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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserAdminPage(org.olat.selenium.page.user.UserAdminPage) ImportUserPage(org.olat.selenium.page.user.ImportUserPage) LoginPage(org.olat.selenium.page.LoginPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 4 with ImportUserPage

use of org.olat.selenium.page.user.ImportUserPage in project openolat by klemens.

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");
}
Also used : UserVO(org.olat.user.restapi.UserVO) UserAdminPage(org.olat.selenium.page.user.UserAdminPage) ImportUserPage(org.olat.selenium.page.user.ImportUserPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)4 Test (org.junit.Test)4 LoginPage (org.olat.selenium.page.LoginPage)4 ImportUserPage (org.olat.selenium.page.user.ImportUserPage)4 UserAdminPage (org.olat.selenium.page.user.UserAdminPage)4 UserVO (org.olat.user.restapi.UserVO)4 UserRestClient (org.olat.test.rest.UserRestClient)2