<commit_before>package com.autonomy.abc.selenium.users;

import com.autonomy.abc.selenium.config.Application;
import com.autonomy.abc.selenium.element.GritterNotice;
import com.autonomy.abc.selenium.menu.NavBarTabId;
import com.autonomy.abc.selenium.page.ElementFactory;
import com.autonomy.abc.selenium.page.HSOElementFactory;
import com.autonomy.abc.selenium.page.admin.HSOUsersPage;
import com.autonomy.abc.selenium.page.admin.UsersPage;
import com.autonomy.abc.selenium.util.Factory;
import com.hp.autonomy.frontend.selenium.element.ModalView;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class HSOUserService extends UserService {
    private HSOUsersPage usersPage;
    private HSOElementFactory elementFactory;

    public HSOUserService(Application application, ElementFactory elementFactory) {
        super(application, elementFactory);
        this.elementFactory = (HSOElementFactory) elementFactory;
    }

    @Override
    public HSOUsersPage goToUsers() {
        getBody().getSideNavBar().switchPage(NavBarTabId.USER_MGMT);
        setUsersPage(elementFactory.getUsersPage());
        return elementFactory.getUsersPage();
    }

    @Override
    public HSOUser createNewUser(NewUser newUser, Role role, Factory<WebDriver> webDriverFactory) {
        UsersPage usersPage = goToUsers();
        usersPage.createUserButton().click();
        HSOUser user = (HSOUser) newUser.signUpAs(role, usersPage, webDriverFactory);
        usersPage.closeModal();
        return user;
    }

    @Override
    public void deleteOtherUsers(){
        usersPage = goToUsers();
        for(WebElement trashCan : usersPage.findElements(By.className("users-deleteUser"))){
            trashCan.click();
            ModalView.getVisibleModalView(getDriver()).okButton().click();
            new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Deleted user"));
            usersPage.loadOrFadeWait();
        }
    }

    public void deleteUser(User user){
        usersPage.getUserRow(user).findElement(By.className("users-deleteUser")).click();
        usersPage.loadOrFadeWait();
        ModalView.getVisibleModalView(getDriver()).okButton().click();
        new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Deleted user"));
    }

    public void changeRole(User user, Role newRole) {
        WebElement roleLink = usersPage.roleLinkFor(user);
        roleLink.click();
        usersPage.setRoleValueFor(user, newRole);
        usersPage.submitPendingEditFor(user);
        new WebDriverWait(getDriver(),10).until(ExpectedConditions.visibilityOf(roleLink));
    }

    public void resetAuthentication(HSOUser user) {
        usersPage.resetAuthenticationButton(user).click();
        usersPage.loadOrFadeWait();
        ModalView.getVisibleModalView(getDriver()).okButton().click();
        new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Reset authentication for " + user.getUsername()));
    }

    public User editUsername(User user, String newUsername) {
        WebElement pencil = usersPage.editUsernameLink(user);
        pencil.click();
        usersPage.editUsernameInput(user).setAndSubmit(newUsername);
        new WebDriverWait(getDriver(),10).until(ExpectedConditions.visibilityOf(pencil));
        usersPage.loadOrFadeWait();
        user.setUsername(newUsername);
        return user;
    }
}<commit_msg>Forgot to commit change to stop tests from failing<commit_after>package com.autonomy.abc.selenium.users;

import com.autonomy.abc.selenium.config.Application;
import com.autonomy.abc.selenium.element.GritterNotice;
import com.autonomy.abc.selenium.menu.NavBarTabId;
import com.autonomy.abc.selenium.page.ElementFactory;
import com.autonomy.abc.selenium.page.HSOElementFactory;
import com.autonomy.abc.selenium.page.admin.HSOUsersPage;
import com.autonomy.abc.selenium.page.admin.UsersPage;
import com.autonomy.abc.selenium.util.Factory;
import com.hp.autonomy.frontend.selenium.element.ModalView;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class HSOUserService extends UserService {
    private HSOUsersPage usersPage;
    private HSOElementFactory elementFactory;

    public HSOUserService(Application application, ElementFactory elementFactory) {
        super(application, elementFactory);
        this.elementFactory = (HSOElementFactory) elementFactory;
    }

    @Override
    public HSOUsersPage goToUsers() {
        getBody().getSideNavBar().switchPage(NavBarTabId.USER_MGMT);
        setUsersPage(elementFactory.getUsersPage());
        return elementFactory.getUsersPage();
    }

    @Override
    public HSOUser createNewUser(NewUser newUser, Role role, Factory<WebDriver> webDriverFactory) {
        UsersPage usersPage = goToUsers();
        usersPage.createUserButton().click();
        HSOUser user = (HSOUser) newUser.signUpAs(role, usersPage, webDriverFactory);
        usersPage.closeModal();
        return user;
    }

    @Override
    public void deleteOtherUsers(){
        usersPage = goToUsers();
        for(WebElement trashCan : usersPage.findElements(By.className("users-deleteUser"))){
            trashCan.click();
            ModalView.getVisibleModalView(getDriver()).okButton().click();
            new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Deleted user"));
            usersPage.loadOrFadeWait();
        }
    }

    public void deleteUser(User user){
        usersPage.getUserRow(user).findElement(By.className("users-deleteUser")).click();
        usersPage.loadOrFadeWait();
        ModalView.getVisibleModalView(getDriver()).okButton().click();
        new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Deleted user"));
    }

    public void changeRole(User user, Role newRole) {
        WebElement roleLink = usersPage.roleLinkFor(user);
        roleLink.click();
        usersPage.setRoleValueFor(user, newRole);
        usersPage.submitPendingEditFor(user);
        new WebDriverWait(getDriver(),10).until(ExpectedConditions.visibilityOf(roleLink));
    }

    public void resetAuthentication(HSOUser user) {
        usersPage.resetAuthenticationButton(user).click();
        usersPage.loadOrFadeWait();
        ModalView.getVisibleModalView(getDriver()).okButton().click();
        new WebDriverWait(getDriver(),10).until(GritterNotice.notificationContaining("Reset authentication for " + user.getUsername()));
    }

    public User editUsername(User user, String newUsername) {
        WebElement pencil = usersPage.editUsernameLink(user);
        pencil.click();
        usersPage.editUsernameInput(user).setAndSubmit(newUsername);
        new WebDriverWait(getDriver(),10).until(ExpectedConditions.visibilityOf(pencil));
        usersPage.loadOrFadeWait();
        ((HSOUser) user).setUsername(newUsername);
        return user;
    }
}
{'fraction_non_alphanumeric': 0.10992662328672297, 'fraction_numerical': 0.0027689325764917623, 'mean_word_length': 4.080168776371308, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6441715', 'n_tokens_mistral': 2098, 'n_tokens_neox': 2027, 'n_words': 309}