/* * Test to see an application page is included only if that application exists */ @Test public void testApplicationSection() { // Delete the Blog.Categories page and test it's not present in the admin global menu anymore deletePage("XWiki", "SearchAdmin"); clickAdministerWiki(); assertElementNotPresent( "//*[contains(@class, 'admin-menu')]//a[contains(@href, 'section=Search')]"); restorePage("XWiki", "SearchAdmin"); }
/** * Fails if a user can create a Configurable application without having edit access to the * configuration page (in this case: XWikiPreferences) * * <p>Tests: XWiki.ConfigurableClass */ @Test public void testConfigurableCreatedByUnauthorizedWillNotExecute() { // Make sure the configurable page doesn't exist because otherwise we may fail to overwrite it // with a // non-administrator user. deletePage("Main", "testConfigurableCreatedByUnauthorizedWillNotExecute"); // Create the configurable for global administrator. loginAndRegisterUser("anotherJoker", "bentOnMalice", false); String nonExistingSection = "HopingThereIsNoSectionByThisName"; createConfigurableApplication( "Main", "testConfigurableCreatedByUnauthorizedWillNotExecute", nonExistingSection, true); loginAsAdmin(); open("XWiki", "XWikiPreferences", "admin", "editor=globaladmin§ion=" + nonExistingSection); assertConfigurationNotEditable("Main", "testConfigurableCreatedByUnauthorizedWillNotExecute"); }