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

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class ProjectLineListCreateTemplatePage extends ProjectPageBase {
	@FindBy(id = "template-name")
	private WebElement templateNameInput;

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

	@FindBy(className = "select2-selection__rendered")
	private WebElement existingTemplatesSelect;

	@FindBy(className = "select2-search__field")
	private WebElement existTemplateField;

	@FindBy(className = "entry")
	private List<WebElement> fieldEntries;

	@FindBy(className = "remove-field-btn") private List<WebElement> removeFieldBtns;

	@FindBy(className = "add-field-btn") private List<WebElement> addFieldBtns;

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

	public static ProjectLineListCreateTemplatePage goToPage(WebDriver driver) {
		get(driver, "/projects/1/linelist/linelist-templates");
		return PageFactory.initElements(driver, ProjectLineListCreateTemplatePage.class);
	}

	public boolean isSaveBtnEnabled() {
		return saveTemplateBtn.isEnabled();
	}

	public void setNewTemplateName(String name) {
		templateNameInput.clear();
		templateNameInput.sendKeys(name);
	}

	public void addExistingTemplate(String templateName) {
		WebDriverWait wait = new WebDriverWait(driver, 10);
		existingTemplatesSelect.click();
		wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("select2-selection__rendered")));
		existTemplateField.sendKeys(templateName, Keys.ENTER);
		// Wait for page to update
		waitForTime(500);
	}

	public void addNewField(int afterField, String fieldValue) {
		addFieldBtns.get(afterField).click();
		// wait for field to be added
		waitForTime(100);
		fieldEntries.get(afterField + 1).findElement(By.className("field-label")).sendKeys(fieldValue);
	}<commit_msg>Updated wait time<commit_after>package ca.corefacility.bioinformatics.irida.ria.integration.pages.projects;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class ProjectLineListCreateTemplatePage extends ProjectPageBase {
	@FindBy(id = "template-name")
	private WebElement templateNameInput;

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

	@FindBy(className = "select2-selection__rendered")
	private WebElement existingTemplatesSelect;

	@FindBy(className = "select2-search__field")
	private WebElement existTemplateField;

	@FindBy(className = "entry")
	private List<WebElement> fieldEntries;

	@FindBy(className = "remove-field-btn") private List<WebElement> removeFieldBtns;

	@FindBy(className = "add-field-btn") private List<WebElement> addFieldBtns;

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

	public static ProjectLineListCreateTemplatePage goToPage(WebDriver driver) {
		get(driver, "/projects/1/linelist/linelist-templates");
		return PageFactory.initElements(driver, ProjectLineListCreateTemplatePage.class);
	}

	public boolean isSaveBtnEnabled() {
		return saveTemplateBtn.isEnabled();
	}

	public void setNewTemplateName(String name) {
		templateNameInput.clear();
		templateNameInput.sendKeys(name);
	}

	public void addExistingTemplate(String templateName) {
		WebDriverWait wait = new WebDriverWait(driver, 10);
		existingTemplatesSelect.click();
		wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("select2-selection__rendered")));
		existTemplateField.sendKeys(templateName, Keys.ENTER);
		// Wait for page to update
		waitForTime(500);
	}

	public void addNewField(int afterField, String fieldValue) {
		addFieldBtns.get(afterField).click();
		// wait for field to be added
		waitForTime(500);
		fieldEntries.get(afterField + 1).findElement(By.className("field-label")).sendKeys(fieldValue);
	}
{'fraction_non_alphanumeric': 0.10597215985630894, 'fraction_numerical': 0.0058374494836102376, 'mean_word_length': 6.6415094339622645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '686307', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1341, 'n_words': 242}