use of org.xwiki.tree.test.po.TreeElement in project xwiki-platform by xwiki.
the class VfsTest method testVfsMacro.
@Test
public void testVfsMacro() throws Exception {
// Delete pages that we create in the test
getUtil().rest().deletePage(getTestClassName(), getTestMethodName());
// Scenario:
// - Attach a zip to a wiki page
// - Use the VFS Tree Macro to display the content of that zip
// - Click on a tree node to display the content of a file inside the zip
getUtil().attachFile(getTestClassName(), getTestMethodName(), "test.zip", createZipInputStream(), false);
String content = "{{vfsTree root=\"attach:test.zip\"/}}";
ViewPage vp = getUtil().createPage(getTestClassName(), getTestMethodName(), content, "VFS Test");
// Get hold of the Tree and expand the directory node and the click on the first children node
TreeElement tree = new TreeElement(getDriver().findElement(By.cssSelector(".xtree")));
tree.waitForIt();
TreeNodeElement node = tree.getNode("//directory");
node = node.open();
node.waitForIt();
node.getChildren().get(0).select();
assertEquals("content2", getDriver().findElement(By.tagName("body")).getText());
}
Aggregations