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