use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.
the class MessageStreamTest method verifyGlobalAndSpaceAdministrationSections.
@Test
public void verifyGlobalAndSpaceAdministrationSections() {
// Go to the wiki's administration page directly (the goal of this test is not to test the navigation
// from the Drawer menu to the Administration page).
AdministrationPage wikiAdministrationPage = AdministrationPage.gotoPage();
// The MessageStream section should be present
assertTrue(wikiAdministrationPage.hasSection("MessageStream"));
// Go to a space's administration page (we use the XWiki space).
AdministrationPage spaceAdministrationPage = AdministrationPage.gotoSpaceAdministrationPage("XWiki");
// The MessageStream section should not be present since it's only a wiki level option
assertTrue(spaceAdministrationPage.hasNotSection("MessageStream"));
}
use of org.xwiki.administration.test.po.AdministrationPage 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));
}
});
}
use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.
the class FlamingoThemeTest method editFlamingoTheme.
@Test
public void editFlamingoTheme() throws Exception {
// Go to the presentation section of the administration
AdministrationPage administrationPage = AdministrationPage.gotoPage();
ThemesAdministrationSectionPage presentationAdministrationSectionPage = administrationPage.clickThemesSection();
// Select the 'Charcoal' color theme
presentationAdministrationSectionPage.setColorTheme("Charcoal");
assertEquals("Charcoal", presentationAdministrationSectionPage.getCurrentColorTheme());
// Click on the 'customize' button
presentationAdministrationSectionPage.clickOnCustomize();
EditThemePage editThemePage = new EditThemePage();
// Wait for the preview to be fully loaded
assertTrue(editThemePage.isPreviewBoxLoading());
editThemePage.waitUntilPreviewIsLoaded();
// First, disable auto refresh because it slows down the test
// (and can even make it fails if the computer is slow)
editThemePage.setAutoRefresh(false);
verifyAllVariablesCategoriesArePresent(editThemePage);
verifyVariablesCategoriesDoesNotDisappear(editThemePage);
verifyThatPreviewWorks(editThemePage);
// We do not have a way top clear the browser's cache with selenium
// (see http://stackoverflow.com/questions/19310888/clear-browser-cache-using-selenium-webdriver).
// So we cannot ensure that saving an existing theme works.
}
use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.
the class FlamingoThemeTest method createNewTheme.
/**
* @since 6.3RC1
*/
@Test
public void createNewTheme() throws Exception {
// Go to the presentation section of the administration
AdministrationPage administrationPage = AdministrationPage.gotoPage();
ThemesAdministrationSectionPage presentationAdministrationSectionPage = administrationPage.clickThemesSection();
// Click on "manage color theme"
presentationAdministrationSectionPage.manageColorThemes();
ThemeApplicationWebHomePage themeApplicationWebHomePage = new ThemeApplicationWebHomePage();
// Ensure the current theme is correct
assertEquals("Charcoal", themeApplicationWebHomePage.getCurrentTheme());
// Ensure the other themes are correct
List<String> otherThemes = themeApplicationWebHomePage.getOtherThemes();
assertTrue(otherThemes.contains("Marina"));
assertTrue(otherThemes.contains("Garden"));
assertTrue(otherThemes.contains("Kitty"));
assertFalse(otherThemes.contains("Charcoal"));
// Create a new theme
EditThemePage editThemePage = themeApplicationWebHomePage.createNewTheme("Test");
editThemePage.waitUntilPreviewIsLoaded();
// First, disable auto refresh because it slows down the test
// (and can even make it fails if the computer is slow)
editThemePage.setAutoRefresh(false);
// Set variables
editThemePage.selectVariableCategory("Base colors");
editThemePage.setVariableValue("xwiki-page-content-bg", "#ff0000");
editThemePage.selectVariableCategory("Typography");
editThemePage.setVariableValue("font-family-base", "Monospace");
editThemePage.selectVariableCategory("Advanced");
// Insert lessCode too
editThemePage.setTextareaValue("lessCode", ".main{ color: #0000ff; }");
// Save the theme
editThemePage.clickSaveAndView();
// Go back to the theme application
themeApplicationWebHomePage = ThemeApplicationWebHomePage.gotoPage();
// Set the new theme as current
themeApplicationWebHomePage.useTheme("Test");
// Verify that the new theme is used
assertEquals("Test", themeApplicationWebHomePage.getCurrentTheme());
// Look at the values
assertEquals("rgba(255, 0, 0, 1)", themeApplicationWebHomePage.getPageBackgroundColor());
assertEquals("monospace", themeApplicationWebHomePage.getFontFamily().toLowerCase());
// Test 'lessCode' is correctly handled
assertEquals("rgba(0, 0, 255, 1)", themeApplicationWebHomePage.getTextColor());
// Switch back to Charcoal
themeApplicationWebHomePage.useTheme("Charcoal");
// Remove the theme
ViewThemePage themePage = themeApplicationWebHomePage.seeTheme("Test");
themePage.waitUntilPreviewIsLoaded();
ConfirmationPage confirmationPage = themePage.delete();
confirmationPage.confirmDeletePage().waitUntilIsTerminated();
}
use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.
the class ApplicationsPanelAdministrationPage method gotoPage.
public static ApplicationsPanelAdministrationPage gotoPage() {
AdministrationPage administrationPage = AdministrationPage.gotoPage();
assertTrue(administrationPage.hasSection("panels.applications"));
administrationPage.clickSection("Look & Feel", "Applications Panel");
return new ApplicationsPanelAdministrationPage();
}
Aggregations