Exemplo n.º 1
0
  /**
   * Tests view versions.
   *
   * @param docPage the current doc page
   * @return the current doc page
   */
  protected DocumentBasePage testViewVersions(DocumentBasePage docPage) {

    // Go to archived versions sub tab
    ArchivedVersionsSubPage archivedVersionsPage =
        docPage.getHistoryTab().getArchivedVersionsSubTab();

    // Check version labels
    List<String> versionLabels = archivedVersionsPage.getVersionLabels();
    List<String> expectedVersionLabels = new ArrayList<String>();
    expectedVersionLabels.add("1.0");
    expectedVersionLabels.add("2.0");
    assertEquals(expectedVersionLabels, versionLabels);

    // View version 1.0 and check its title
    DocumentBasePage versionPage = archivedVersionsPage.viewVersion("1.0");
    versionPage.checkDocTitle("Test file: modif 1 (Version 1.0)");

    // Go back to doc
    docPage = versionPage.goToDocumentByBreadcrumb("Test file: modif 2");

    // Go to archived versions sub tab
    archivedVersionsPage = docPage.getHistoryTab().getArchivedVersionsSubTab();

    // View version 2.0 and check its title
    versionPage = archivedVersionsPage.viewVersion("2.0");
    versionPage.checkDocTitle("Test file: modif 2 (Version 2.0)");

    // Go back to doc and return it
    return versionPage.goToDocumentByBreadcrumb("Test file: modif 2");
  }
Exemplo n.º 2
0
  /**
   * Tests restore version.
   *
   * @param docPage the current doc page
   * @return the current doc page
   */
  protected DocumentBasePage testRestoreVersion(DocumentBasePage docPage) {

    // Go to archived versions sub tab
    ArchivedVersionsSubPage archivedVersionsPage =
        docPage.getHistoryTab().getArchivedVersionsSubTab();

    // Restore version 1.0 and check its title
    DocumentBasePage restoredVersionPage = archivedVersionsPage.restoreVersion("1.0");
    restoredVersionPage.checkDocTitle("Test file: modif 1");

    // Return doc
    return restoredVersionPage;
  }