Example #1
0
  @Test
  public void returnToAppFromHeader() {
    appPage.open();
    appPage.openAccount();
    loginPage.login("test-user@localhost", "password");

    Assert.assertTrue(profilePage.isCurrent());
    profilePage.backToApplication();

    Assert.assertTrue(appPage.isCurrent());
  }
Example #2
0
  @Test
  public void changePassword() {
    changePasswordPage.open();
    loginPage.login("test-user@localhost", "password");

    changePasswordPage.changePassword("", "new-password", "new-password");

    Assert.assertTrue(profilePage.isError());

    changePasswordPage.changePassword("password", "new-password", "new-password2");

    Assert.assertTrue(profilePage.isError());

    changePasswordPage.changePassword("password", "new-password", "new-password");

    Assert.assertTrue(profilePage.isSuccess());

    changePasswordPage.logout();

    loginPage.open();
    loginPage.login("test-user@localhost", "password");

    Assert.assertEquals("Invalid username or password.", loginPage.getError());

    loginPage.open();
    loginPage.login("test-user@localhost", "new-password");

    Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType());
  }
Example #3
0
  @Test
  public void returnToAppFromQueryParam() {
    driver.navigate().to(AccountUpdateProfilePage.PATH + "?referrer=test-app");
    loginPage.login("test-user@localhost", "password");
    Assert.assertTrue(profilePage.isCurrent());
    profilePage.backToApplication();

    Assert.assertTrue(appPage.isCurrent());
  }