use of org.xwiki.administration.test.po.AdministrablePage in project xwiki-platform by xwiki.
the class AdministrationIT method verifyGlobalAndSpaceSections.
/**
* This method makes the following tests :
*
* <ul>
* <li>Validate presence of default sections for global and space sections.</li>
* <li>Validate presence of application administration sections at global level only.</li>
* </ul>
*/
@Test
public void verifyGlobalAndSpaceSections() {
// Navigate to a (non existent for test performance reasons) page in view mode.
getUtil().gotoPage("NonExistentSpace", "NonExistentPage");
// Verify that pages have an Admin menu and navigate to the admin UI.
AdministrablePage page = new AdministrablePage();
AdministrationPage administrationPage = page.clickAdministerWiki();
assertEquals("Global Administration: Home", administrationPage.getDocumentTitle());
assertTrue(administrationPage.getBreadcrumbContent().endsWith("/Global Administration"));
// TODO: Move these tests in their own modules, i.e. the modules that brought the Administration UI extension.
Arrays.asList("Users", "Groups", "Rights", "Registration", "Themes", "Presentation", "Templates", "Localization", "Import", "Export", "Editing", "emailSend", "emailStatus", "emailGeneral", "analytics").stream().forEach(new Consumer<String>() {
@Override
public void accept(String sectionId) {
assertTrue(String.format("Seection %s is missing.", sectionId), administrationPage.hasSection(sectionId));
}
});
// These are page-only sections.
assertTrue(administrationPage.hasNotSection("PageAndChildrenRights"));
assertTrue(administrationPage.hasNotSection("PageRights"));
// Select XWiki space administration.
AdministrationPage spaceAdministrationPage = AdministrationPage.gotoSpaceAdministrationPage("XWiki");
assertEquals("Page Administration: XWiki", spaceAdministrationPage.getDocumentTitle());
assertTrue(spaceAdministrationPage.getBreadcrumbContent().endsWith("/Page Administration"));
assertTrue(spaceAdministrationPage.hasSection("Themes"));
assertTrue(spaceAdministrationPage.hasSection("Presentation"));
assertTrue(spaceAdministrationPage.hasSection("PageAndChildrenRights"));
assertTrue(spaceAdministrationPage.hasSection("PageRights"));
// All these sections should not be present (they provide global configuration).
Arrays.asList("Users", "Groups", "Rights", "Registration", "Templates", "Localization", "Import", "Export", "Editing", "emailSend", "emailStatus", "emailGeneral", "analytics").stream().forEach(new Consumer<String>() {
@Override
public void accept(String sectionId) {
assertTrue(String.format("Seection %s is present.", sectionId), administrationPage.hasNotSection(sectionId));
}
});
}
Aggregations