use of org.xwiki.test.ui.po.DeletePageOutcomePage in project xwiki-platform by xwiki.
the class DeletePageTest method deleteOkWhenConfirming.
@Test
public void deleteOkWhenConfirming() {
ConfirmationPage confirmationPage = this.viewPage.delete();
// This tests for regression of XWIKI-1388
assertNotNull("The interface should not show the user as logged out while deleting page", confirmationPage.getCurrentUser());
confirmationPage.clickYes();
DeletingPage deletingPage = new DeletingPage();
deletingPage.waitUntilIsTerminated();
// Note: it's better to wait instead of using isSuccess() since there could be some timeframe between
// the hiding of the progress UI and the display of the success message.
deletingPage.waitUntilSuccessMessage();
assertEquals(CONFIRMATION, deletingPage.getSuccessMessage());
DeletePageOutcomePage deleteOutcome = deletingPage.getDeletePageOutcomePage();
assertEquals(LOGGED_USERNAME, deleteOutcome.getPageDeleter());
assertEquals(DOCUMENT_NOT_FOUND, deleteOutcome.getMessage());
}
use of org.xwiki.test.ui.po.DeletePageOutcomePage in project xwiki-platform by xwiki.
the class DeletePageTest method deleteTerminalAndNonTerminalPages.
/**
* Verify that when you delete a terminal and a non terminal page sharing the same location, both deleted versions
* are present in the recycle bin list when you hit the location afterwards.
* @see: "XWIKI-12563: Cannot restore a terminal page from its location"
* @since 7.2RC1
*/
@Test
public void deleteTerminalAndNonTerminalPages() {
DocumentReference terminalPageRef = new DocumentReference("xwiki", Arrays.asList(getTestClassName()), getTestMethodName());
DocumentReference nonTerminalPageRef = new DocumentReference("xwiki", Arrays.asList(getTestClassName(), getTestMethodName()), "WebHome");
// Clean up.
getUtil().deletePage(terminalPageRef);
getUtil().deletePage(nonTerminalPageRef);
// Create the non terminal page.
ViewPage nonTerminalPage = getUtil().createPage(nonTerminalPageRef, "Content", "Title");
// Delete it
nonTerminalPage.delete().clickYes();
DeletingPage deletingPage = new DeletingPage();
deletingPage.waitUntilIsTerminated();
// Look at the recycle bin
DeletePageOutcomePage deletePageOutcomePage = deletingPage.getDeletePageOutcomePage();
assertFalse(deletePageOutcomePage.hasTerminalPagesInRecycleBin());
// Create the terminal page.
ViewPage terminalPage = getUtil().createPage(terminalPageRef, "Content", "Title");
// Delete it
terminalPage.delete().clickYes();
deletingPage.waitUntilIsTerminated();
// Look at the recycle bin
deletePageOutcomePage = deletingPage.getDeletePageOutcomePage();
assertTrue(deletePageOutcomePage.hasTerminalPagesInRecycleBin());
// Delete both version in the recycle bin
deletePageOutcomePage.clickDeletePage();
deletePageOutcomePage.clickDeleteTerminalPage();
}
Aggregations