use of org.xwiki.index.tree.test.po.DocumentTreeElement in project xwiki-platform by xwiki.
the class AllDocsTest method treeViewTab.
/**
* Validate the tree view.
*/
@Test
public void treeViewTab() throws Exception {
// Create a tree structure.
String spaceName = getTestClassName();
getUtil().createPage(spaceName, "WebHome", null, null);
getUtil().createPageWithAttachment(Arrays.asList(spaceName, "A", "B"), "C", null, "Child Page", null, null, "file.txt", getClass().getResourceAsStream("/file.txt"), TestUtils.SUPER_ADMIN_CREDENTIALS);
DocumentTreeElement tree = AllDocsPage.gotoPage().clickTreeTab();
TreeNodeElement root = tree.getDocumentNode(spaceName, "WebHome");
assertEquals(spaceName, root.getLabel());
assertFalse(tree.hasDocument(spaceName, "A", "WebHome"));
root.open().waitForIt();
TreeNodeElement alice = tree.getDocumentNode(spaceName, "A", "WebHome");
assertEquals("A", alice.getLabel());
assertFalse(tree.hasDocument(spaceName, "A", "B", "WebHome"));
alice.open().waitForIt();
TreeNodeElement bob = tree.getDocumentNode(spaceName, "A", "B", "WebHome");
assertEquals("B", bob.getLabel());
assertFalse(tree.hasDocument(spaceName, "A", "B", "C"));
bob.open().waitForIt();
TreeNodeElement child = tree.getDocumentNode(spaceName, "A", "B", "C");
assertEquals("Child Page", child.getLabel());
assertFalse(tree.hasAttachment(spaceName, "A", "B", "C", "file.txt"));
// Open the Attachments node.
child.open().waitForIt().getChildren().get(0).open().waitForIt();
TreeNodeElement file = tree.getAttachmentNode(spaceName, "A", "B", "C", "file.txt");
assertEquals("file.txt", file.getLabel());
}
use of org.xwiki.index.tree.test.po.DocumentTreeElement in project xwiki-platform by xwiki.
the class AllDocsTest method treeViewTabWithSpecialCharactersInEntityNames.
/**
* @see "XWIKI-5187: XWiki Explorer doesn't support very well spaces and pages with special characters in their
* names"
*/
@Test
public void treeViewTabWithSpecialCharactersInEntityNames() {
// Create a tree structure.
String spaceName = getTestMethodName() + ".0";
getUtil().createPage(Arrays.asList(spaceName, "Level.1", "Level{[(2)]}", "Level@3"), "End", null, null);
DocumentTreeElement tree = AllDocsPage.gotoPage().clickTreeTab();
tree.openToDocument(spaceName, "Level.1", "Level{[(2)]}", "Level@3", "End");
assertTrue(tree.hasDocument(spaceName, "Level.1", "WebHome"));
assertTrue(tree.hasDocument(spaceName, "Level.1", "Level{[(2)]}", "WebHome"));
assertTrue(tree.hasDocument(spaceName, "Level.1", "Level{[(2)]}", "Level@3", "WebHome"));
}
Aggregations