Package net.thucydides.core.scheduling
Class ThucydidesFluentWait<T>
java.lang.Object
net.thucydides.core.scheduling.ThucydidesFluentWait<T>
- All Implemented Interfaces:
org.openqa.selenium.support.ui.Wait<T>
- Direct Known Subclasses:
FluentWaitWithRefresh
,NormalFluentWait
public abstract class ThucydidesFluentWait<T>
extends java.lang.Object
implements org.openqa.selenium.support.ui.Wait<T>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ThucydidesFluentWait(T input, java.time.Clock clock, org.openqa.selenium.support.ui.Sleeper sleeper)
-
Method Summary
Modifier and Type Method Description abstract void
doWait()
protected java.time.Clock
getClock()
protected T
getInput()
protected org.openqa.selenium.support.ui.Sleeper
getSleeper()
ThucydidesFluentWait<T>
ignoring(java.lang.Class<? extends java.lang.RuntimeException>... types)
PollingSchedule
pollingEvery(int amount)
ThucydidesFluentWait<T>
pollingEvery(long duration, java.util.concurrent.TimeUnit unit)
protected java.lang.RuntimeException
timeoutException(java.lang.String message, java.lang.RuntimeException lastException)
<V> V
until(java.util.function.Function<? super T,V> isTrue)
ThucydidesFluentWait<T>
withMessage(java.lang.String message)
Sets the message to be displayed when time expires.ThucydidesFluentWait<T>
withMessage(java.util.function.Supplier<java.lang.String> messageSupplier)
Sets the message to be evaluated and displayed when time expires.ThucydidesFluentWait<T>
withTimeout(long duration, java.util.concurrent.TimeUnit unit)
ThucydidesFluentWait<T>
withTimeout(java.time.Duration timeout)
TimeoutSchedule
withTimeoutOf(int amount)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
timeout
protected java.time.Duration timeout -
interval
protected java.time.Duration interval
-
-
Constructor Details
-
ThucydidesFluentWait
public ThucydidesFluentWait(T input, java.time.Clock clock, org.openqa.selenium.support.ui.Sleeper sleeper)
-
-
Method Details
-
getClock
protected java.time.Clock getClock() -
getInput
-
getSleeper
protected org.openqa.selenium.support.ui.Sleeper getSleeper() -
until
- Specified by:
until
in interfaceorg.openqa.selenium.support.ui.Wait<T>
-
doWait
public abstract void doWait() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
ignoring
public ThucydidesFluentWait<T> ignoring(java.lang.Class<? extends java.lang.RuntimeException>... types) -
withTimeout
-
withTimeout
-
withMessage
Sets the message to be displayed when time expires.- Parameters:
message
- to be appended to default.- Returns:
- A self reference.
-
withMessage
public ThucydidesFluentWait<T> withMessage(java.util.function.Supplier<java.lang.String> messageSupplier)Sets the message to be evaluated and displayed when time expires.- Parameters:
messageSupplier
- to be evaluated on failure and appended to default.- Returns:
- A self reference.
-
pollingEvery
-
timeoutException
protected java.lang.RuntimeException timeoutException(java.lang.String message, java.lang.RuntimeException lastException) -
withTimeoutOf
-
pollingEvery
-