コード例 #1
0
 /**
  * Creates a new folder at the Path specified, Starting from the RepositoryPage Page. Assumes User
  * is logged in and a specific Site is open.
  *
  * @param driver WebDrone Instance
  * @param folderName String Name of the folder to be created
  * @param folderTitle String Title of the folder to be created
  * @param folderDesc String Description of the folder to be created
  * @return RepositoryPage
  */
 public static HtmlPage createFolderInRepositoryWithValidation(
     WebDrone driver, String folderName, String folderTitle, String folderDesc) {
   HtmlPage htmlPage =
       ShareUserSitePage.createFolderWithValidation(driver, folderName, folderTitle, folderDesc);
   if (htmlPage instanceof DocumentLibraryPage) {
     RepositoryPage repositoryPage = htmlPage.render();
     return repositoryPage;
   }
   return htmlPage;
 }
コード例 #2
0
  /**
   * This method is used to create content with name, title and description. User should be logged
   * in
   *
   * @param drone
   * @param contentDetails
   * @param contentType
   * @return {@link RepositoryPage}
   * @throws Exception
   */
  public static HtmlPage createContentInFolderWithValidation(
      WebDrone drone, ContentDetails contentDetails, ContentType contentType, String... folderPath)
      throws Exception {
    // Open Folder in repository Library
    RepositoryPage repositoryPage = navigateFoldersInRepositoryPage(drone, folderPath);

    try {
      CreatePlainTextContentPage contentPage =
          repositoryPage.getNavigation().selectCreateContent(contentType).render();

      HtmlPage page = contentPage.createWithValidation(contentDetails).render();

      if (page instanceof DocumentDetailsPage) {
        DocumentDetailsPage detailsPage = page.render();
        repositoryPage = detailsPage.navigateToFolderInRepositoryPage().render();

        return repositoryPage;
      }
      return page;
    } catch (Exception e) {
      throw new SkipException("Error in creating content." + e.getMessage());
    }
  }