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

import com.hp.autonomy.frontend.selenium.element.FormInput;
import com.hp.autonomy.frontend.selenium.element.ModalView;
import com.hp.autonomy.frontend.selenium.users.Role;
import com.hp.autonomy.frontend.selenium.util.Locator;
import com.hp.autonomy.frontend.selenium.util.Waits;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public abstract class UserCreationModal extends ModalView {
    UserCreationModal(WebDriver driver) {
        super(ModalView.getVisibleModalView(driver), driver);
    }

    public WebElement createButton() {
        return findElement(new Locator()
                .withTagName("button")
                .containingText("Create")
        );
    }

    public FormInput usernameInput() {
        return new FormInput(findElement(By.name("create-users-username")), getDriver());
    }

    public WebElement roleDropdown() {
        return findElement(By.id("create-users-role"));
    }

    public void selectRole(Role role) {
        findElement(new Locator()
                .withTagName("option")
                .containingText(role.toString())
        ).click();
    }

    public abstract void createUser();

    @Override
    public void close() {
        findElement(By.cssSelector("[data-dismiss='modal']")).click();
        Waits.loadOrFadeWait();<commit_msg>Wait for modal to disappear<commit_after>package com.autonomy.abc.selenium.users;

import com.hp.autonomy.frontend.selenium.element.FormInput;
import com.hp.autonomy.frontend.selenium.element.ModalView;
import com.hp.autonomy.frontend.selenium.users.Role;
import com.hp.autonomy.frontend.selenium.util.Locator;
import com.hp.autonomy.frontend.selenium.util.Waits;
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 abstract class UserCreationModal extends ModalView {
    UserCreationModal(WebDriver driver) {
        super(ModalView.getVisibleModalView(driver), driver);
    }

    public WebElement createButton() {
        return findElement(new Locator()
                .withTagName("button")
                .containingText("Create")
        );
    }

    public FormInput usernameInput() {
        return new FormInput(findElement(By.name("create-users-username")), getDriver());
    }

    public WebElement roleDropdown() {
        return findElement(By.id("create-users-role"));
    }

    public void selectRole(Role role) {
        findElement(new Locator()
                .withTagName("option")
                .containingText(role.toString())
        ).click();
    }

    public abstract void createUser();

    @Override
    public void close() {
        findElement(By.cssSelector("[data-dismiss='modal']")).click();
        new WebDriverWait(getDriver(), 10)
                .withMessage("closing user creation modal")
                .until(ExpectedConditions.stalenessOf(this));
{'fraction_non_alphanumeric': 0.11804657179818888, 'fraction_numerical': 0.000646830530401035, 'mean_word_length': 3.236986301369863, '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': '6081169', 'n_tokens_mistral': 931, 'n_tokens_neox': 882, 'n_words': 148}