Search in sources :

Example 1 with PreferencesUserProfilePage

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

the class UserProfileTest method testChangePasswordOfAnotherUserWithTwoDifferentPasswords.

@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 testChangePasswordOfAnotherUserWithTwoDifferentPasswords() {
    // Login as superadmin (to have Admin rights) and change the password of another user.
    getUtil().loginAsSuperAdminAndGotoPage(this.customProfilePage.getURL());
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
    changePasswordPage.changePasswordAsAdmin(PASSWORD_1, PASSWORD_2);
    changePasswordPage.submit();
    Assert.assertEquals("The two passwords do not match.", changePasswordPage.getValidationErrorMessage());
}
Also used : ChangePasswordPage(org.xwiki.user.test.po.ChangePasswordPage) 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 PreferencesUserProfilePage

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

the class UserProfileTest method testChangePasswordWithTwoDifferentPasswords.

@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 testChangePasswordWithTwoDifferentPasswords() {
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
    changePasswordPage.changePassword(DEFAULT_PASSWORD, PASSWORD_1, PASSWORD_2);
    changePasswordPage.submit();
    Assert.assertEquals("The two passwords do not match.", changePasswordPage.getValidationErrorMessage());
}
Also used : ChangePasswordPage(org.xwiki.user.test.po.ChangePasswordPage) 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 3 with PreferencesUserProfilePage

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

the class UserProfileTest method testChangePasswordWithWrongOriginalPassword.

@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 testChangePasswordWithWrongOriginalPassword() {
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
    changePasswordPage.changePassword("badPassword", PASSWORD_1, PASSWORD_1);
    changePasswordPage.submit();
    Assert.assertEquals("Current password is invalid.", changePasswordPage.getErrorMessage());
}
Also used : ChangePasswordPage(org.xwiki.user.test.po.ChangePasswordPage) 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 4 with PreferencesUserProfilePage

use of org.xwiki.user.test.po.PreferencesUserProfilePage 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 5 with PreferencesUserProfilePage

use of org.xwiki.user.test.po.PreferencesUserProfilePage 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)6 AbstractTest (org.xwiki.test.ui.AbstractTest)6 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)6 PreferencesUserProfilePage (org.xwiki.user.test.po.PreferencesUserProfilePage)6 ChangePasswordPage (org.xwiki.user.test.po.ChangePasswordPage)4 PreferencesEditPage (org.xwiki.user.test.po.PreferencesEditPage)2 ViewPage (org.xwiki.test.ui.po.ViewPage)1