<commit_before>package ca.corefacility.bioinformatics.irida.ria.integration.pages.projects;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import ca.corefacility.bioinformatics.irida.ria.integration.pages.AbstractPage;
import ca.corefacility.bioinformatics.irida.ria.integration.pages.LoginPage;

/**
 * Page to represent the project add new sample page.
 */
public class ProjectAddSamplePage extends AbstractPage {
	public static final String RELATIVE_URL = "/projects/1/samples/new";
	@FindBy(name = "sampleName")
	private WebElement sampleNameInput;

	@FindBy(id = "save-btn")
	private WebElement createBtn;

	@FindBy(id = "sampleName-error") private WebElement sampleNameError;

	@FindBy(css = "a.select2-choice")
	private WebElement organismSelect2;

	@FindBy(css = ".select2-search input")
	private WebElement organismInput;

	public ProjectAddSamplePage(WebDriver driver) {
		super(driver);
	}

	public static ProjectAddSamplePage gotoAsProjectManager(WebDriver driver) {
		LoginPage.loginAsUser(driver);
		get(driver, RELATIVE_URL);
		return PageFactory.initElements(driver, ProjectAddSamplePage.class);
	}

	public static ProjectAddSamplePage gotoAsSystemAdmin(WebDriver driver) {
		LoginPage.loginAsAdmin(driver);
		get(driver, RELATIVE_URL);
		return PageFactory.initElements(driver, ProjectAddSamplePage.class);
	}

	public void enterSampleName(String name) {
		sampleNameInput.clear();
		sampleNameInput.sendKeys(name);
		waitForTime(400);
	}

	public void createSample() {
		createBtn.click();
		waitForElementVisible(By.id("sample-page-title"));<commit_msg>Updated wait time for changing errors.<commit_after>package ca.corefacility.bioinformatics.irida.ria.integration.pages.projects;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import ca.corefacility.bioinformatics.irida.ria.integration.pages.AbstractPage;
import ca.corefacility.bioinformatics.irida.ria.integration.pages.LoginPage;

/**
 * Page to represent the project add new sample page.
 */
public class ProjectAddSamplePage extends AbstractPage {
	public static final String RELATIVE_URL = "/projects/1/samples/new";
	@FindBy(name = "sampleName")
	private WebElement sampleNameInput;

	@FindBy(id = "save-btn")
	private WebElement createBtn;

	@FindBy(id = "sampleName-error") private WebElement sampleNameError;

	@FindBy(css = "a.select2-choice")
	private WebElement organismSelect2;

	@FindBy(css = ".select2-search input")
	private WebElement organismInput;

	public ProjectAddSamplePage(WebDriver driver) {
		super(driver);
	}

	public static ProjectAddSamplePage gotoAsProjectManager(WebDriver driver) {
		LoginPage.loginAsUser(driver);
		get(driver, RELATIVE_URL);
		return PageFactory.initElements(driver, ProjectAddSamplePage.class);
	}

	public static ProjectAddSamplePage gotoAsSystemAdmin(WebDriver driver) {
		LoginPage.loginAsAdmin(driver);
		get(driver, RELATIVE_URL);
		return PageFactory.initElements(driver, ProjectAddSamplePage.class);
	}

	public void enterSampleName(String name) {
		sampleNameInput.clear();
		sampleNameInput.sendKeys(name);
		waitForTime(600);
	}

	public void createSample() {
		createBtn.click();
		waitForElementVisible(By.id("sample-page-title"));
{'fraction_non_alphanumeric': 0.10440034512510785, 'fraction_numerical': 0.004026459591601955, 'mean_word_length': 6.200828157349896, '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': '265436', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1055, 'n_words': 204}