use of org.xwiki.test.ui.browser.IgnoreBrowsers 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.test.ui.browser.IgnoreBrowsers 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.test.ui.browser.IgnoreBrowsers 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.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class UserProfileTest method testEditProfile.
/**
* Functionality check: changing profile information.
*/
@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 testEditProfile() {
ProfileEditPage profileEditPage = this.customProfilePage.editProfile();
profileEditPage.setUserFirstName(USER_FIRST_NAME);
profileEditPage.setUserLastName(USER_LAST_NAME);
profileEditPage.setUserCompany(USER_COMPANY);
profileEditPage.setUserAbout(USER_ABOUT);
profileEditPage.setUserEmail(USER_EMAIL);
profileEditPage.setUserPhone(USER_PHONE);
profileEditPage.setUserAddress(USER_ADDRESS);
profileEditPage.setUserBlog(USER_BLOG);
profileEditPage.setUserBlogFeed(USER_BLOGFEED);
profileEditPage.clickSaveAndView();
// Check that the information was updated
Assert.assertEquals(USER_FIRST_NAME, this.customProfilePage.getUserFirstName());
Assert.assertEquals(USER_LAST_NAME, this.customProfilePage.getUserLastName());
Assert.assertEquals(USER_COMPANY, this.customProfilePage.getUserCompany());
Assert.assertEquals(USER_ABOUT, this.customProfilePage.getUserAbout());
Assert.assertEquals(USER_EMAIL, this.customProfilePage.getUserEmail());
Assert.assertEquals(USER_PHONE, this.customProfilePage.getUserPhone());
Assert.assertEquals(USER_ADDRESS, this.customProfilePage.getUserAddress());
Assert.assertEquals(USER_BLOG, this.customProfilePage.getUserBlog());
Assert.assertEquals(USER_BLOGFEED, this.customProfilePage.getUserBlogFeed());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class DateClassFieldTest method testDatePicker.
/**
* Tests that the user can select a date using the date picker.
*/
@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 testDatePicker() {
// First select a date using the picker and assert the value of the date input.
DateClassFieldEditPane dateField = new DateClassFieldEditPane(editor.addField("Date").getName());
DatePicker datePicker = dateField.openDatePicker();
datePicker.setYear("2011");
datePicker.setMonth("October");
datePicker.setDay("13");
datePicker.setHour("8 AM");
datePicker.setMinute("15");
String selectedDate = dateField.getDefaultValue();
// Ignore the number of seconds.
Assert.assertTrue(selectedDate.startsWith("13/10/2011 08:15:"));
// Set the value of the date input and assert the date selected by the picker.
dateField.setDefaultValue("17/03/2020 19:43:34");
// Currently the date picker doesn't know how to parse a date with a specified format. The workaround is to pass
// the date time stamp when generating the date input, but for this the page needs to be saved and reloaded.
editor.clickSaveAndView().edit();
datePicker = new DateClassFieldEditPane("date1").openDatePicker();
Assert.assertEquals("2020", datePicker.getYear());
Assert.assertEquals("March", datePicker.getMonth());
Assert.assertEquals("17", datePicker.getDay());
Assert.assertEquals("7 PM", datePicker.getHour());
Assert.assertEquals("40", datePicker.getMinute());
}
Aggregations