Exemplo n.º 1
0
  @Test
  @IgnoreBrowsers({
    @IgnoreBrowser(
        value = "internet.*",
        version = "8\\.*",
        reason = "See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(
        value = "internet.*",
        version = "9\\.*",
        reason = "See http://jira.xwiki.org/browse/XE-1177")
  })
  public void testRollbackToFirstVersion() throws Exception {
    getUtil().deletePage(SPACE_NAME, PAGE_NAME);

    // Create first version of the page
    ViewPage vp = getUtil().createPage(SPACE_NAME, PAGE_NAME, CONTENT1, TITLE);

    // Adds second version
    WikiEditPage wikiEditPage = vp.editWiki();
    wikiEditPage.setContent(CONTENT2);
    wikiEditPage.clickSaveAndView();

    // TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of
    // a page in
    // view mode) is fixed.
    vp.waitForDocExtraPaneActive("comments");

    // Verify that we can rollback to the first version
    HistoryPane historyTab = vp.openHistoryDocExtraPane();
    vp = historyTab.rollbackToVersion("1.1");

    // Rollback doesn't wait...
    // Wait for the comment tab to be selected since we're currently on the history tab and rolling
    // back is going to load a new page and make the focus active on the comments tab.
    vp.waitForDocExtraPaneActive("comments");

    Assert.assertEquals("First version of Content", vp.getContent());

    historyTab = vp.openHistoryDocExtraPane();
    Assert.assertEquals("Rollback to version 1.1", historyTab.getCurrentVersionComment());
    Assert.assertEquals("Administrator", historyTab.getCurrentAuthor());
  }
Exemplo n.º 2
0
  /** See XWIKI-8781 */
  @Test
  @IgnoreBrowsers({
    @IgnoreBrowser(
        value = "internet.*",
        version = "8\\.*",
        reason = "See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(
        value = "internet.*",
        version = "9\\.*",
        reason = "See http://jira.xwiki.org/browse/XE-1177")
  })
  public void testDeleteLatestVersion() throws Exception {
    getUtil().deletePage(SPACE_NAME, PAGE_NAME);

    // Create first version of the page
    ViewPage vp = getUtil().createPage(SPACE_NAME, PAGE_NAME, CONTENT1, TITLE);

    // Adds second version
    WikiEditPage wikiEditPage = vp.editWiki();
    wikiEditPage.setContent(CONTENT2);
    wikiEditPage.clickSaveAndView();

    // TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of
    // a page in
    // view mode) is fixed.
    vp.waitForDocExtraPaneActive("comments");

    // Verify and delete the latest version.
    HistoryPane historyTab = vp.openHistoryDocExtraPane();
    Assert.assertEquals("2.1", historyTab.getCurrentVersion());
    historyTab = historyTab.deleteVersion("2.1");

    // Verify that the current version is now the previous one.
    Assert.assertEquals("1.1", historyTab.getCurrentVersion());
    Assert.assertEquals("Administrator", historyTab.getCurrentAuthor());
  }