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());
}
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();
}
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)");
}
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();
}
Aggregations