Search in sources :

Example 1 with LocalizationAdministrationSectionPage

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();
}
Also used : LocalizationAdministrationSectionPage(org.xwiki.administration.test.po.LocalizationAdministrationSectionPage) AdministrationPage(org.xwiki.administration.test.po.AdministrationPage)

Example 2 with LocalizationAdministrationSectionPage

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)");
}
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 3 with LocalizationAdministrationSectionPage

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();
}
Also used : LocalizationAdministrationSectionPage(org.xwiki.administration.test.po.LocalizationAdministrationSectionPage) AdministrationPage(org.xwiki.administration.test.po.AdministrationPage)

Aggregations

AdministrationPage (org.xwiki.administration.test.po.AdministrationPage)3 LocalizationAdministrationSectionPage (org.xwiki.administration.test.po.LocalizationAdministrationSectionPage)3 Test (org.junit.Test)1 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)1 ViewPage (org.xwiki.test.ui.po.ViewPage)1 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)1