Skip to content
Permalink
Browse files
[JENKINS-38928] Wait for splash to appear
  • Loading branch information
Vlatombe committed Oct 27, 2016
1 parent 4721f1d commit 0e6815addd8e22b904f18578d64fb0db003ca505
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/main/java/org/jenkinsci/test/acceptance/po/ConfigurablePageObject.java
@@ -23,11 +23,14 @@
*/
package org.jenkinsci.test.acceptance.po;

import com.google.common.base.Predicate;
import com.google.inject.Injector;
import groovy.lang.Closure;
import org.openqa.selenium.WebDriver;

import java.net.URL;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
@@ -98,7 +101,16 @@ public void save() {

public void apply() {
clickButton("Apply");
elasticSleep(1000);
assertThat(driver, hasContent("Saved"));
waitFor(driver).withTimeout(5, TimeUnit.SECONDS)
.ignoring(
AssertionError.class // Still waiting
)
.until(new Predicate<WebDriver>() {
@Override
public boolean apply(WebDriver driver) {
assertThat(driver, hasContent("Saved"));
return true;
}
});
}
}

0 comments on commit 0e6815a

Please sign in to comment.