use of org.xwiki.test.ui.po.BreadcrumbElement in project xwiki-platform by xwiki.
the class CreatePageNestedDocumentsTest method assertCreatedNestedDocument.
private void assertCreatedNestedDocument(DocumentReference pageReference, ViewPage viewPage) {
SpaceReference spaceReference = pageReference.getLastSpaceReference();
BreadcrumbElement breadcrumb = viewPage.getBreadcrumb();
if (breadcrumb.canBeExpanded()) {
breadcrumb.expand();
}
assertEquals("/" + getUtil().getURLFragment(spaceReference), breadcrumb.getPathAsString());
assertEquals(spaceReference.getName(), viewPage.getDocumentTitle());
assertEquals(getUtil().serializeReference(pageReference), viewPage.getMetaDataValue("reference"));
}
use of org.xwiki.test.ui.po.BreadcrumbElement in project xwiki-platform by xwiki.
the class BreadcrumbsTest method verifyBreadcrumbInLongHierarchy.
@Test
public void verifyBreadcrumbInLongHierarchy() throws Exception {
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("A", "B", "C", "D", "E", "F", "G", "H"), "WebHome");
ViewPage page = getUtil().createPage(documentReference, "Content", getTestMethodName());
BreadcrumbElement breadcrumb = page.getBreadcrumb();
// Verify that the breadcrumb is limited
assertEquals("/A/…/F/G/" + getTestMethodName(), breadcrumb.getPathAsString());
// Verify we can expand it
breadcrumb.expand();
assertEquals("/A/B/C/D/E/F/G/" + getTestMethodName(), breadcrumb.getPathAsString());
// Clean
getUtil().deletePage(documentReference);
}
Aggregations