Skip to content

Commit cb036a7

Browse files
authored
wait for the notification to disappear (#2166)
The notification will only appear if the build is not parameterized, otherwise we navigate to a different page to enter the parameters and on sumbission that redirect back to the job page.
1 parent 94d69e4 commit cb036a7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/main/java/org/jenkinsci/test/acceptance/po

src/main/java/org/jenkinsci/test/acceptance/po/Job.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.jenkinsci.test.acceptance.controller.LocalController;
3535
import org.jenkinsci.test.acceptance.junit.Resource;
3636
import org.junit.AssumptionViolatedException;
37+
import org.openqa.selenium.By;
3738
import org.openqa.selenium.WebDriver;
3839
import org.openqa.selenium.WebElement;
3940
import org.zeroturnaround.zip.ZipUtil;
@@ -339,6 +340,9 @@ public Build scheduleBuild(Map<String, ?> params) {
339340
int nb = getJson().get("nextBuildNumber").intValue();
340341
if (parameters.isEmpty()) {
341342
clickLink("Build Now");
343+
// the notification bar can place itslef over other elements
344+
// so wait for it to be added and then disappear
345+
waitFor(waitFor(By.id("notification-bar"))).until(bar -> !bar.isDisplayed());
342346
} else {
343347
clickLink("Build with Parameters");
344348
try {
@@ -348,7 +352,6 @@ public Build scheduleBuild(Map<String, ?> params) {
348352
throw new Error(e);
349353
}
350354
}
351-
352355
return build(nb);
353356
}
354357

0 commit comments

Comments
 (0)