use of org.xwiki.administration.test.po.LocalizationAdministrationSectionPage 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.LocalizationAdministrationSectionPage 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.LocalizationAdministrationSectionPage 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