Search in sources :

Example 1 with PreferencesEditPage

use of org.xwiki.user.test.po.PreferencesEditPage in project xwiki-platform by xwiki.

the class UserProfileTest method testChangeDefaultEditor.

/**
 * Functionality check: changing the default editor.
 */
@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 testChangeDefaultEditor() {
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    // Setting to Text Editor
    PreferencesEditPage preferencesEditPage = preferencesPage.editPreferences();
    preferencesEditPage.setDefaultEditorText();
    preferencesEditPage.clickSaveAndView();
    preferencesPage = this.customProfilePage.switchToPreferences();
    Assert.assertEquals(TEXT_EDITOR, preferencesPage.getDefaultEditor());
    // Setting to WYSIWYG Editor
    this.customProfilePage = ProfileUserProfilePage.gotoPage(this.userName);
    preferencesPage = this.customProfilePage.switchToPreferences();
    preferencesEditPage = preferencesPage.editPreferences();
    preferencesEditPage.setDefaultEditorWysiwyg();
    preferencesEditPage.clickSaveAndView();
    preferencesPage = this.customProfilePage.switchToPreferences();
    Assert.assertEquals(WYSIWYG_EDITOR, preferencesPage.getDefaultEditor());
    // Setting to Default Editor
    this.customProfilePage = ProfileUserProfilePage.gotoPage(this.userName);
    preferencesPage = this.customProfilePage.switchToPreferences();
    preferencesEditPage = preferencesPage.editPreferences();
    preferencesEditPage.setDefaultEditorDefault();
    preferencesEditPage.clickSaveAndView();
    preferencesPage = this.customProfilePage.switchToPreferences();
    Assert.assertEquals(DEFAULT_EDITOR, preferencesPage.getDefaultEditor());
}
Also used : PreferencesEditPage(org.xwiki.user.test.po.PreferencesEditPage) PreferencesUserProfilePage(org.xwiki.user.test.po.PreferencesUserProfilePage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

Example 2 with PreferencesEditPage

use of org.xwiki.user.test.po.PreferencesEditPage in project xwiki-platform by xwiki.

the class UserProfileTest method testChangeUserProfile.

/**
 * Functionality check: changing the user type.
 */
@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 testChangeUserProfile() {
    String timezone = "Europe/Paris";
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    Assert.assertEquals("", preferencesPage.getTimezone());
    // Setting to Simple user and setting the timezone to Europe/Paris
    PreferencesEditPage preferencesEditPage = preferencesPage.editPreferences();
    preferencesEditPage.setSimpleUserType();
    preferencesEditPage.setTimezone(timezone);
    preferencesEditPage.clickSaveAndView();
    preferencesPage = this.customProfilePage.switchToPreferences();
    Assert.assertEquals(SIMPLE_USER, preferencesPage.getUserType());
    Assert.assertEquals(timezone, preferencesPage.getTimezone());
    // Setting to Advanced user
    preferencesEditPage = preferencesPage.editPreferences();
    preferencesEditPage.setAdvancedUserType();
    preferencesEditPage.clickSaveAndView();
    this.customProfilePage.switchToPreferences();
    Assert.assertEquals(ADVANCED_USER, preferencesPage.getUserType());
}
Also used : PreferencesEditPage(org.xwiki.user.test.po.PreferencesEditPage) PreferencesUserProfilePage(org.xwiki.user.test.po.PreferencesUserProfilePage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

Aggregations

Test (org.junit.Test)2 AbstractTest (org.xwiki.test.ui.AbstractTest)2 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)2 PreferencesEditPage (org.xwiki.user.test.po.PreferencesEditPage)2 PreferencesUserProfilePage (org.xwiki.user.test.po.PreferencesUserProfilePage)2