/**
  * Test updating an existing file with a new uploaded file. The test covers major and minor
  * version changes
  *
  * @throws Exception
  */
 private void createData() throws Exception {
   SitePage page = resolvePage(driver).render();
   documentLibPage = page.getSiteNav().selectDocumentLibrary().render();
   documentLibPage = documentLibPage.getNavigation().selectDetailedView().render();
   UploadFilePage uploadForm = documentLibPage.getNavigation().selectFileUpload().render();
   documentLibPage = uploadForm.uploadFile(testLockedFile.getCanonicalPath()).render();
   NewFolderPage newFolderPage = documentLibPage.getNavigation().selectCreateNewFolder();
   documentLibPage = newFolderPage.createNewFolder(folderName, folderDescription).render();
   uploadForm = documentLibPage.getNavigation().selectFileUpload().render();
   documentLibPage = uploadForm.uploadFile(file.getCanonicalPath()).render();
   documentLibPage = documentLibPage.getNavigation().selectDetailedView().render();
   doclibUrl = driver.getCurrentUrl();
 }
Exemple #2
0
  /**
   * Upload new logo picture admin user is logged in, Application option is selected
   *
   * @param filePath String
   * @return {@link AdminConsolePage}
   */
  public HtmlPage uploadPicture(String filePath) {

    try {
      UploadFilePage uploadFilePage = getCurrentPage().render();
      WebElement button = findAndWait(FILE_UPLOAD_BUTTON);
      button.click();
      WebElement element =
          findAndWait(
              By.cssSelector("#template_x002e_dnd-upload_x002e_console_x0023_default-title-span"));
      if (element.isDisplayed()) {
        uploadFilePage.upload(filePath).render();
        clickApplyButton();
      }

    } catch (NoSuchElementException te) {
      if (logger.isTraceEnabled()) {
        logger.trace("Unable to find the Upload button css " + te);
      }
    }

    return getCurrentPage();
  }