/**
  * Discarding the changes made in google doc.
  *
  * @param filename String
  * @return SharePage
  */
 public static GoogleSignUpPage openSignUpPage(WebDrone driver, String filename) {
   DocumentLibraryPage docLibPage = driver.getCurrentPage().render();
   GoogleDocsAuthorisation googleAuth =
       docLibPage.getFileDirectoryInfo(filename).selectEditInGoogleDocs().render();
   Assert.assertTrue(googleAuth.isAuthorisationDisplayed());
   return googleAuth.submitAuth().render();
 }
 /**
  * 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();
 }
  /**
   * Saves the google doc with the given comments as minor or major version.
   *
   * @param drone WebDrone
   * @param comments String
   * @param isMinorVersion boolean
   * @return GoogleDocsUpdateFilePage
   */
  public static GoogleDocsUpdateFilePage saveGoogleDocWithVersionAndComment(
      WebDrone drone, String comments, boolean isMinorVersion) {
    EditInGoogleDocsPage googleDocsPage = drone.getCurrentPage().render();
    GoogleDocsUpdateFilePage googleUpdateFile = googleDocsPage.selectSaveToAlfresco().render();

    if (isMinorVersion) {
      googleUpdateFile.selectMinorVersionChange();
    } else {
      googleUpdateFile.selectMajorVersionChange();
    }

    if (!StringUtils.isEmpty(comments)) {
      googleUpdateFile.setComment(comments);
    }

    return googleUpdateFile;
  }
 /**
  * This method provides the sign in page to log into google docs.
  *
  * @param googleAuth GoogleDocsAuthorisation
  * @return EditInGoogleDocsPage
  */
 public static EditInGoogleDocsPage signInGoogleDocs(
     WebDrone driver, GoogleDocsAuthorisation googleAuth) throws InterruptedException {
   int i = 0;
   GoogleSignUpPage signUpPage = googleAuth.submitAuth().render();
   signUpPage.signUp(googleUserName, googlePassword);
   if (isGoogleDocsV3) {
     switchToGoogleWindow(driver);
   }
   while (!(driver.getCurrentPage() instanceof EditInGoogleDocsPage)) {
     webDriverWait(driver, 10000);
     i++;
     if (i == retrySearchCount) {
       break;
     }
   }
   return FactorySharePage.resolvePage(driver).render();
 }