Reputation: 41
I'm trying to use waitUntil() method from TestFX to wait until a dialog appears on the screen. I found the example provided by the Wiki, but it doesn't seem to work with me. Can anyone help me to figure this out?
Upvotes: 2
Views: 2944
Reputation: 1872
You can use this method also:
import org.testfx.util.WaitForAsyncUtils;
WaitForAsyncUtils.waitFor(10, TimeUnit.SECONDS, new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return find(".dialog-pane").isVisible();
}
});
With this solution you can also define the TimeUnit.
Upvotes: 3
Reputation: 41
I managed to resolve this by using:
import org.hamcrest.Matchers;
import org.loadui.testfx.controls.impl.VisibleNodesMatcher;
waitUntil(".dialog-pane", Matchers.is(VisibleNodesMatcher.visible()));
Upvotes: 2