Search in sources :

Example 11 with IgnoreBrowsers

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());
}
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 12 with IgnoreBrowsers

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());
}
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 13 with IgnoreBrowsers

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());
}
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 14 with IgnoreBrowsers

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());
}
Also used : ProfileEditPage(org.xwiki.user.test.po.ProfileEditPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

Example 15 with IgnoreBrowsers

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());
}
Also used : DatePicker(org.xwiki.test.ui.po.editor.DatePicker) DateClassFieldEditPane(org.xwiki.appwithinminutes.test.po.DateClassFieldEditPane) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)80 Test (org.junit.Test)76 AbstractTest (org.xwiki.test.ui.AbstractTest)43 ViewPage (org.xwiki.test.ui.po.ViewPage)26 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)12 LongTextClassFieldEditPane (org.xwiki.appwithinminutes.test.po.LongTextClassFieldEditPane)11 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)10 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)9 MimeMessage (javax.mail.internet.MimeMessage)7 TestUtils (org.xwiki.test.ui.TestUtils)6 HistoryPane (org.xwiki.test.ui.po.HistoryPane)6 LiveTableElement (org.xwiki.test.ui.po.LiveTableElement)6 LoginPage (org.xwiki.test.ui.po.LoginPage)6 PreferencesUserProfilePage (org.xwiki.user.test.po.PreferencesUserProfilePage)6 ApplicationHomePage (org.xwiki.appwithinminutes.test.po.ApplicationHomePage)5 EntryEditPage (org.xwiki.appwithinminutes.test.po.EntryEditPage)5 InvitationGuestActionsPage (org.xwiki.invitation.test.po.InvitationGuestActionsPage)5 ChangePasswordPage (org.xwiki.user.test.po.ChangePasswordPage)5 URL (java.net.URL)4 WebElement (org.openqa.selenium.WebElement)4