Skip to content

Commit

Permalink
[JENKINS-38928] Wait for splash to appear
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe committed Oct 27, 2016
1 parent 4721f1d commit 0e6815a
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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.