@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));
   }
 }
  /**
   * 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"));
  }