Skip to content

Commit

Permalink
Merge pull request #1492 from phac-nml/fix-flaky-PipelinesPhylogenomi…
Browse files Browse the repository at this point in the history
…csPageIT

test: Fix flaky PipelinesPhylogenomicsPageIT
  • Loading branch information
ericenns authored Jun 2, 2023
2 parents 9b07817 + 451aefb commit db37def
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* [Developer]: Added script to do initial cleanup of sequence files from file system. [See PR 1469](https://github.com/phac-nml/irida/pull/1469)
* [UI]: Add identifier to project drop-down on project synchronization page. See [PR 1474](https://github.com/phac-nml/irida/pull/1474)
* [Developer]: Added functionality to delete sequence files from file storage when removed from sample. [See PR 1476](https://github.com/phac-nml/irida/pull/1476)
* [Developer]: Fixed flaky text in `PipelinesPhylogenomicsPageIT#testPageSetup` test. See [PR 1490](https://github.com/phac-nml/irida/pull/1492)

## [23.01.3] - 2023/05/09
* [Developer]: Fixed issue with metadata uploader removing existing data. See [PR 1489](https://github.com/phac-nml/irida/pull/1489)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
Expand Down Expand Up @@ -187,18 +188,21 @@ public boolean isModifiedAlertVisible() {
}

public void saveModifiedTemplateAs(String name) {
driver.manage().window().maximize();
// Fixes issue where save button scrolled off page.
driver.findElement(By.tagName("body")).sendKeys(Keys.HOME);
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20L));
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(2L));
WebElement alertBox = driver.findElement(By.className("t-modified-alert"));

// Scroll to the modified alert
WebElement modifiedSaveAsButton = driver.findElement(By.className("t-modified-saveas"));
Actions actions = new Actions(driver);
actions.moveToElement(modifiedSaveAsButton);
actions.perform();

modifiedSaveAsButton.click();
WebElement saveTemplatePopover = wait.until(
ExpectedConditions.visibilityOfElementLocated(By.className("t-save-params-form")));
modifiedNameInput.sendKeys(name);
saveTemplatePopover.findElement(By.tagName("button")).click();
wait.until(ExpectedConditions.invisibilityOf(modifiedAlert.get(0)));
wait.until(ExpectedConditions.invisibilityOf(alertBox));
}

public String getSelectedParametersTemplateName() {
Expand Down

0 comments on commit db37def

Please sign in to comment.