<commit_before>package org.keycloak.testsuite.console.page.users;

import org.keycloak.testsuite.console.page.fragment.OnOffSwitch;
import static org.keycloak.testsuite.page.Form.setInputValue;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 *
 * @author tkyjovsk
 */
public class UserCredentials extends User {

    @Override
    public String getUriFragment() {
        return super.getUriFragment() + "/user-credentials";
    }

    @FindBy(id = "password")
    private WebElement newPasswordInput;

    @FindBy(id = "confirmPassword")
    private WebElement confirmPasswordInput;

    @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='temporaryPassword']]")
    private OnOffSwitch temporaryOnOffSwitch;

    @FindBy(xpath = ".//button[contains(@data-ng-click, 'resetPassword')]")
    private WebElement resetPasswordButton;

    public void setNewPassword(String newPassword) {
        setInputValue(newPasswordInput, newPassword);
    }

    public void setConfirmPassword(String confirmPassword) {
        setInputValue(confirmPasswordInput, confirmPassword);
    }

    public void setTemporary(boolean temporary) {
        temporaryOnOffSwitch.setOn(temporary);
    }

    public void clickResetPasswordAndConfirm() {
        resetPasswordButton.click();
        modalDialog.ok();
    }
    
    public void resetPassword(String newPassword) {
        resetPassword(newPassword, newPassword);
    }
    public void resetPassword(String newPassword, String confirmPassword) {
        setNewPassword(newPassword);
        setConfirmPassword(confirmPassword);
        clickResetPasswordAndConfirm();
    }
    
}<commit_msg>Fix PasswordPolicyTest (cherry picked from commit 87b125e)<commit_after>package org.keycloak.testsuite.console.page.users;

import org.keycloak.testsuite.console.page.fragment.OnOffSwitch;
import static org.keycloak.testsuite.page.Form.setInputValue;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import static org.keycloak.testsuite.util.WaitUtils.*;

/**
 *
 * @author tkyjovsk
 */
public class UserCredentials extends User {

    @Override
    public String getUriFragment() {
        return super.getUriFragment() + "/user-credentials";
    }

    @FindBy(id = "password")
    private WebElement newPasswordInput;

    @FindBy(id = "confirmPassword")
    private WebElement confirmPasswordInput;

    @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='temporaryPassword']]")
    private OnOffSwitch temporaryOnOffSwitch;

    @FindBy(xpath = ".//div[not(contains(@class, 'ng-hide'))]/button[contains(@data-ng-click, 'resetPassword')]")
    private WebElement resetPasswordButton;

    public void setNewPassword(String newPassword) {
        setInputValue(newPasswordInput, newPassword);
    }

    public void setConfirmPassword(String confirmPassword) {
        setInputValue(confirmPasswordInput, confirmPassword);
    }

    public void setTemporary(boolean temporary) {
        temporaryOnOffSwitch.setOn(temporary);
    }

    public void clickResetPasswordAndConfirm() {
        waitGuiForElement(resetPasswordButton);
        resetPasswordButton.click();
        modalDialog.ok();
    }
    
    public void resetPassword(String newPassword) {
        resetPassword(newPassword, newPassword);
    }
    public void resetPassword(String newPassword, String confirmPassword) {
        setNewPassword(newPassword);
        setConfirmPassword(confirmPassword);
        clickResetPasswordAndConfirm();
    }
    
}
{'fraction_non_alphanumeric': 0.10309859154929578, 'fraction_numerical': 0.0014084507042253522, 'mean_word_length': 3.9388038942976356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '24106', 'n_tokens_mistral': 1013, 'n_tokens_neox': 978, 'n_words': 181}