Search in sources :

Example 11 with AdministrationPage

use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.

the class KeyboardShortcutsTest method testKeyboardShortcuts.

@Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void testKeyboardShortcuts() {
    ViewPage vp = getUtil().gotoPage("Sandbox", "WebHome");
    // Test default edit mode (WYSIWYG for Sandbox.WebHome) key
    vp.sendKeys("e");
    // Test Cancel key
    vp.sendKeys(Keys.chord(Keys.ALT, "c"));
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInViewMode());
    // Test Wiki edit key
    vp.sendKeys("k");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInWikiEditMode());
    // Test WYSIWYG edit mode key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("g");
    // Test Inline Form edit mode key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("f");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInInlineEditMode());
    // Test Rights edit mode key on a terminal document
    vp = getUtil().gotoPage("Sandbox", "TestPage1");
    vp.sendKeys("r");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInRightsEditMode());
    // Test Rights edit mode key on a non terminal document
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("r");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInAdminMode());
    AdministrationPage administrationPage = new AdministrationPage();
    Assert.assertTrue(administrationPage.hasSection("PageRights"));
    // Test Object edit mode key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("o");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInObjectEditMode());
    // Test Class edit mode key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("s");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInClassEditMode());
    // Test Delete key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys(Keys.DELETE);
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInDeleteMode());
    // Test Rename key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys(Keys.F2);
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInRenameMode());
    // Test View Source key
    vp = getUtil().gotoPage("Sandbox", "WebHome");
    vp.sendKeys("d");
    vp.waitUntilPageIsLoaded();
    Assert.assertTrue(getUtil().isInSourceViewMode());
}
Also used : AdministrationPage(org.xwiki.administration.test.po.AdministrationPage) ViewPage(org.xwiki.test.ui.po.ViewPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Example 12 with AdministrationPage

use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.

the class LanguageTest method setLanguageSettings.

private static void setLanguageSettings(boolean isMultiLingual, String defaultLanguage, List<String> supportedLanguages) {
    AdministrationPage adminPage = AdministrationPage.gotoPage();
    LocalizationAdministrationSectionPage sectionPage = adminPage.clickLocalizationSection();
    sectionPage.setMultiLingual(isMultiLingual);
    if (defaultLanguage != null) {
        sectionPage.setDefaultLanguage(defaultLanguage);
    }
    if (supportedLanguages != null) {
        sectionPage.setSupportedLanguages(supportedLanguages);
    }
    sectionPage.clickSave();
}
Also used : LocalizationAdministrationSectionPage(org.xwiki.administration.test.po.LocalizationAdministrationSectionPage) AdministrationPage(org.xwiki.administration.test.po.AdministrationPage)

Example 13 with AdministrationPage

use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.

the class LanguageTest method testChangeLanguageInMonolingualModeUsingTheAdministrationPreference.

@Test
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146")
public void testChangeLanguageInMonolingualModeUsingTheAdministrationPreference() {
    WikiEditPage edit = WikiEditPage.gotoPage("Test", "LanguageTest");
    edit.setContent("{{velocity}}context = ($xcontext.language), doc = ($doc.language), " + "default = ($doc.defaultLanguage), tdoc = ($tdoc.language), " + "tdocdefault = ($tdoc.defaultLanguage){{/velocity}}");
    ViewPage vp = edit.clickSaveAndView();
    // Current language must be "en"
    Assert.assertEquals("Invalid content", vp.getContent(), "context = (en), doc = (), default = (en), tdoc = (), tdocdefault = (en)");
    // Change default language to "fr"
    AdministrationPage adminPage = AdministrationPage.gotoPage();
    LocalizationAdministrationSectionPage sectionPage = adminPage.clickLocalizationSection();
    sectionPage.setDefaultLanguage("fr");
    sectionPage.clickSave();
    // Now language must be "fr"
    vp = getUtil().gotoPage("Test", "LanguageTest");
    Assert.assertTrue("Page not in French!", isPageInFrench());
    Assert.assertEquals("Invalid content", vp.getContent(), "context = (fr), doc = (), default = (en), tdoc = (), tdocdefault = (en)");
}
Also used : LocalizationAdministrationSectionPage(org.xwiki.administration.test.po.LocalizationAdministrationSectionPage) AdministrationPage(org.xwiki.administration.test.po.AdministrationPage) ViewPage(org.xwiki.test.ui.po.ViewPage) WikiEditPage(org.xwiki.test.ui.po.editor.WikiEditPage) Test(org.junit.Test) IgnoreBrowser(org.xwiki.test.ui.browser.IgnoreBrowser)

Example 14 with AdministrationPage

use of org.xwiki.administration.test.po.AdministrationPage in project xwiki-platform by xwiki.

the class SectionTest method setLanguageSettings.

private void setLanguageSettings(boolean isMultiLingual, String defaultLanguage, String supportedLanguages) {
    AdministrationPage adminPage = AdministrationPage.gotoPage();
    LocalizationAdministrationSectionPage localizationSection = adminPage.clickLocalizationSection();
    localizationSection.setMultiLingual(isMultiLingual);
    localizationSection.setDefaultLanguage(defaultLanguage);
    localizationSection.setSupportedLanguages(supportedLanguages);
    localizationSection.clickSave();
}
Also used : LocalizationAdministrationSectionPage(org.xwiki.administration.test.po.LocalizationAdministrationSectionPage) AdministrationPage(org.xwiki.administration.test.po.AdministrationPage)

Aggregations

AdministrationPage (org.xwiki.administration.test.po.AdministrationPage)14 Test (org.junit.Test)8 AbstractTest (org.xwiki.test.ui.AbstractTest)6 LocalizationAdministrationSectionPage (org.xwiki.administration.test.po.LocalizationAdministrationSectionPage)3 ViewPage (org.xwiki.test.ui.po.ViewPage)3 Before (org.junit.Before)2 ThemesAdministrationSectionPage (org.xwiki.administration.test.po.ThemesAdministrationSectionPage)2 EditThemePage (org.xwiki.flamingo.test.po.EditThemePage)2 SendMailAdministrationSectionPage (org.xwiki.mail.test.po.SendMailAdministrationSectionPage)2 GreenMail (com.icegreen.greenmail.util.GreenMail)1 ServerSetupTest (com.icegreen.greenmail.util.ServerSetupTest)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 UsernamePasswordCredentials (org.apache.commons.httpclient.UsernamePasswordCredentials)1 AdministrablePage (org.xwiki.administration.test.po.AdministrablePage)1 DefaultExtensionDependency (org.xwiki.extension.DefaultExtensionDependency)1 ExtensionId (org.xwiki.extension.ExtensionId)1 DependencyPane (org.xwiki.extension.test.po.DependencyPane)1 ExtensionAdministrationPage (org.xwiki.extension.test.po.ExtensionAdministrationPage)1 ExtensionDependenciesPane (org.xwiki.extension.test.po.ExtensionDependenciesPane)1 ExtensionPane (org.xwiki.extension.test.po.ExtensionPane)1