Search in sources :

Example 1 with UserPasswordPage

use of org.olat.selenium.page.user.UserPasswordPage in project OpenOLAT by OpenOLAT.

the class UserTest method userChangeItsPassword.

/**
 * Change the password, log out and try to log in again
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void userChangeItsPassword(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
    loginPage.loginAs(user.getLogin(), user.getPassword()).resume();
    UserToolsPage userTools = new UserToolsPage(browser);
    userTools.openUserToolsMenu().openPassword();
    String newPassword = UUID.randomUUID().toString();
    UserPasswordPage password = UserPasswordPage.getUserPasswordPage(browser);
    password.setNewPassword(user.getPassword(), newPassword);
    userTools.logout();
    loginPage.loginAs(user.getLogin(), newPassword).resume().assertLoggedIn(user);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) UserPasswordPage(org.olat.selenium.page.user.UserPasswordPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 2 with UserPasswordPage

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

the class UserTest method userChangeItsPassword.

/**
 * Change the password, log out and try to log in again
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void userChangeItsPassword(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
    loginPage.loginAs(user.getLogin(), user.getPassword()).resume();
    UserToolsPage userTools = new UserToolsPage(browser);
    userTools.openUserToolsMenu().openPassword();
    String newPassword = UUID.randomUUID().toString();
    UserPasswordPage password = UserPasswordPage.getUserPasswordPage(browser);
    password.setNewPassword(user.getPassword(), newPassword);
    userTools.logout();
    loginPage.loginAs(user.getLogin(), newPassword).resume().assertLoggedIn(user);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) UserPasswordPage(org.olat.selenium.page.user.UserPasswordPage) 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)2 Test (org.junit.Test)2 UserPasswordPage (org.olat.selenium.page.user.UserPasswordPage)2 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)2 UserRestClient (org.olat.test.rest.UserRestClient)2 UserVO (org.olat.user.restapi.UserVO)2