Skip to content

Commit

Permalink
forward compatibility for core-8340 (#1328)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
  • Loading branch information
mawinter69 and timja committed Aug 13, 2023
1 parent d40610b commit e1f0439
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.jenkinsci.test.acceptance.po.Job;
import org.jenkinsci.test.acceptance.po.PageAreaImpl;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.TimeoutException;

/**
* Build timeout plugin setting in the job config page.
Expand Down Expand Up @@ -50,7 +51,12 @@ private void chooseStrategy(String name) {
public void abortBuild() {
if (addAction != null) {
addAction.click();
clickLink("Abort the build");
try {
waitFor(by.button("Abort the build"));
clickButton("Abort the build");
} catch (TimeoutException te) {
clickLink("Abort the build");
}
}
}

Expand All @@ -60,7 +66,12 @@ public void writeDescription() {
}
catch (NoSuchElementException ex) {
addAction.click();
clickLink("Writing the build description");
try {
waitFor(by.button("Writing the build description"));
clickButton("Writing the build description");
} catch (TimeoutException te) {
clickLink("Writing the build description");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void selectDropdownMenu(String displayName) {
waitFor(we).pollingEvery(Duration.ofMillis(100)).withTimeout(Duration.ofSeconds(1)).until(we::isDisplayed);
we.click();
// wait until the menu is hidden
waitFor(we).pollingEvery(Duration.ofMillis(100)).withTimeout(Duration.ofSeconds(1)).until(() -> !we.isDisplayed());
waitFor(we).pollingEvery(Duration.ofMillis(100)).withTimeout(Duration.ofSeconds(1)).until(Control::isHiddenOrStale);
}

/**
Expand Down

0 comments on commit e1f0439

Please sign in to comment.