Package org.xwiki.test.ui.administration.elements

Examples of org.xwiki.test.ui.administration.elements.PreferencesUserProfilePage


    /** Functionality check: changing the password. */
    @Test
    public void testChangePassword()
    {
        // Change the password
        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        String newPassword = RandomStringUtils.randomAlphanumeric(6);
        changePasswordPage.changePassword(newPassword, newPassword);
        changePasswordPage.submit();

        // Logout
View Full Code Here


    /** Functionality check: changing the user type. */
    @Test
    public void testChangeUserProfile()
    {
        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        // Setting to Simple user
        PreferencesEditPage preferencesEditPage = preferencesPage.editPreferences();
        preferencesEditPage.setSimpleUserType();
        preferencesEditPage.clickSaveAndView();
        preferencesPage = this.customProfilePage.switchToPreferences();
        Assert.assertEquals(SIMPLE_USER, this.customProfilePage.getUserType());

        // Setting to Advanced user
        preferencesEditPage = preferencesPage.editPreferences();
        preferencesEditPage.setAdvancedUserType();
        preferencesEditPage.clickSaveAndView();
        this.customProfilePage.switchToPreferences();
        Assert.assertEquals(ADVANCED_USER, this.customProfilePage.getUserType());
    }
View Full Code Here

    /** Functionality check: changing the default editor. */
    @Test
    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, this.customProfilePage.getDefaultEditorToUse());

        // Setting to WYSIWYG Editor
        this.customProfilePage.gotoPage();
        preferencesPage = this.customProfilePage.switchToPreferences();
        preferencesEditPage = preferencesPage.editPreferences();
        preferencesEditPage.setDefaultEditorWysiwyg();
        preferencesEditPage.clickSaveAndView();
        preferencesPage = this.customProfilePage.switchToPreferences();
        Assert.assertEquals(WYSIWYG_EDITOR, this.customProfilePage.getDefaultEditorToUse());

        // Setting to Default Editor
        this.customProfilePage.gotoPage();
        preferencesPage = this.customProfilePage.switchToPreferences();
        preferencesEditPage = preferencesPage.editPreferences();
        preferencesEditPage.setDefaultEditorDefault();
        preferencesEditPage.clickSaveAndView();
        preferencesPage = this.customProfilePage.switchToPreferences();
        Assert.assertEquals(DEFAULT_EDITOR, this.customProfilePage.getDefaultEditorToUse());
    }
View Full Code Here

    }

    @Test
    public void testChangePasswordWithTwoDifferentPasswords()
    {
        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.changePassword(PASSWORD_1, PASSWORD_2);
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_MISMATCH, alert.getText());
        alert.accept();
View Full Code Here

    }

    @Test
    public void testChangePasswordWithoutEnteringPasswords()
    {
        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_IS_EMPTY, alert.getText());
        alert.accept();
    }
View Full Code Here

    public void testChangePasswordOfAnotherUserWithTwoDifferentPasswords()
    {
        // Login as Admin and change the password of another user
        getUtil().getURLToLoginAsAdminAndGotoPage(this.customProfilePage.getURL());
        getUtil().recacheSecretToken();
        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.changePassword(PASSWORD_1, PASSWORD_2);
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_MISMATCH, alert.getText());
        alert.accept();
View Full Code Here

TOP

Related Classes of org.xwiki.test.ui.administration.elements.PreferencesUserProfilePage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.