Search in sources :

Example 46 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class UserProfileTest method testChangePasswordWithoutEnteringPasswords.

@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 testChangePasswordWithoutEnteringPasswords() {
    ChangePasswordPage changePasswordPage = this.customProfilePage.switchToPreferences().changePassword();
    changePasswordPage.submit();
    Assert.assertEquals("Your new password should be at least 6 characters long.", changePasswordPage.getValidationErrorMessage());
}
Also used : ChangePasswordPage(org.xwiki.user.test.po.ChangePasswordPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

Example 47 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers 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)

Example 48 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class UserProfileTest method testChangePassword.

/**
 * Functionality check: changing the password.
 */
@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 testChangePassword() {
    // Change the password
    PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
    ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
    String newPassword = RandomStringUtils.randomAlphanumeric(6);
    changePasswordPage.changePassword(DEFAULT_PASSWORD, newPassword, newPassword);
    changePasswordPage.submit();
    // Logout
    getUtil().forceGuestUser();
    // Login with the new password and navigate to a page to verify that the user is logged in
    getUtil().loginAndGotoPage(this.userName, newPassword, getUtil().getURL(getTestClassName(), getTestMethodName()));
    ViewPage vp = new ViewPage();
    Assert.assertTrue(vp.isAuthenticated());
    getUtil().recacheSecretToken();
    // Reset the password
    getUtil().loginAsSuperAdminAndGotoPage(this.customProfilePage.getURL());
    preferencesPage = this.customProfilePage.switchToPreferences();
    changePasswordPage = preferencesPage.changePassword();
    changePasswordPage.changePasswordAsAdmin(DEFAULT_PASSWORD, DEFAULT_PASSWORD);
    changePasswordPage.submit();
    Assert.assertEquals("Your password has been successfully changed.", changePasswordPage.getSuccessMessage());
}
Also used : ChangePasswordPage(org.xwiki.user.test.po.ChangePasswordPage) ViewPage(org.xwiki.test.ui.po.ViewPage) 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 49 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class UserProfileTest method testChangeAvatarImage.

/**
 * Functionality check: changing the profile picture.
 */
@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 testChangeAvatarImage() {
    ChangeAvatarPage changeAvatarImage = this.customProfilePage.changeAvatarImage();
    changeAvatarImage.setAvatarImage(IMAGE_NAME);
    changeAvatarImage.submit();
    Assert.assertEquals(IMAGE_NAME, this.customProfilePage.getAvatarImageName());
}
Also used : ChangeAvatarPage(org.xwiki.user.test.po.ChangeAvatarPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

Example 50 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class LiveTableEditorTest method testSaveAndContinue.

/**
 * Tests that Save & Continue works fine.
 */
@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 testSaveAndContinue() {
    editPage.setDescription("wait for WYSIWYG to load");
    editPage.clickSaveAndContinue();
    ApplicationHomePage viewPage = editPage.clickCancel();
    LiveTableElement liveTable = viewPage.getEntriesLiveTable();
    liveTable.waitUntilReady();
    // The column header isn't translated because we haven't generated the document translation bundle.
    Assert.assertTrue(liveTable.hasColumn("xwikiusers.livetable.doc.title"));
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement) ApplicationHomePage(org.xwiki.appwithinminutes.test.po.ApplicationHomePage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test) AbstractTest(org.xwiki.test.ui.AbstractTest)

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