/**
  * This method is used to delete the given user profile.
  *
  * @param testUser String
  * @param drone WebDrone
  * @return {@link UserSearchPage}
  */
 protected UserSearchPage deleteUser(WebDrone drone, String testUser) {
   if (isAlfrescoVersionCloud(drone)) {
     throw new UnsupportedOperationException("Delete user is available in cloud");
   }
   DashBoardPage dashBoard = drone.getCurrentPage().render();
   UserSearchPage page = dashBoard.getNav().getUsersPage().render();
   page = page.searchFor(testUser).render();
   UserProfilePage userProfile = page.clickOnUser(testUser).render();
   return userProfile.deleteUser().render();
 }
Пример #2
0
 @Test(dependsOnMethods = "loginWithFakeCredentials")
 public void checkCSRFToken() throws Exception {
   drone.navigateTo(shareUrl);
   ShareUtil.loginAs(drone, shareUrl, username, password);
   String csrfToken1 = getCookieValue();
   Assert.assertNotNull(csrfToken1);
   drone.refresh();
   DashBoardPage dPage = (DashBoardPage) drone.getCurrentPage().render();
   dPage.render();
   String csrfToken2 = getCookieValue();
   Assert.assertNotNull(csrfToken2);
   if (alfrescoVersion.isCloud()) {
     Assert.assertFalse(csrfToken1.equals(csrfToken2));
   }
 }
Пример #3
0
  /**
   * Log a user into Alfresco with valid credentials and then logout
   *
   * @throws Exception if error
   */
  @Test
  public void loginAndLogout() throws Exception {
    drone.navigateTo(shareUrl);
    LoginPage page = drone.getCurrentPage().render();
    Assert.assertTrue(page.isBrowserTitle("login"));
    Assert.assertFalse(page.hasErrorMessage());

    DashBoardPage dashboardPage =
        (DashBoardPage) ShareUtil.loginAs(drone, shareUrl, username, password);
    dashboardPage.render();
    Assert.assertFalse(page.isBrowserTitle("login"));
    Assert.assertTrue(dashboardPage.isBrowserTitle("dashboard"));
    Assert.assertTrue(dashboardPage.isLoggedIn());
    SharePage pageResponse = dashboardPage.getNav().logout().render();
    Assert.assertTrue(pageResponse.isBrowserTitle("login"));
  }