|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.pageobjects.elements.query.Poller
@PublicApi public final class Poller
Utility class to poll and wait for a particular states of timeout-based queries inheriting from PollingQuery.
PollingQuery,
TimedQuery,
TimedCondition| Nested Class Summary | |
|---|---|
static class |
Poller.WaitTimeout
|
| Method Summary | ||
|---|---|---|
static Poller.WaitTimeout |
by(long timeoutInMillis)
Custom assertion timeout expressed in milliseconds. |
|
static Poller.WaitTimeout |
by(long timeout,
TimeUnit unit)
Custom assertion timeout expressed in a number of time units. |
|
static Poller.WaitTimeout |
byDefaultTimeout()
Timeout indicating that the assertion method will wait for the default timeout of exercised timed query for the condition to become true. |
|
static Poller.WaitTimeout |
now()
Timeout indicating that the assertion method will evaluate the assertion condition immediately, without waiting. |
|
static
|
waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query. |
|
static
|
waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout. |
|
static
|
waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query. |
|
static
|
waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout. |
|
static
|
waitUntilEquals(String message,
T expectedValue,
TimedQuery<T> query)
Wait until given query evaluates to actual value that is equal to expectedValue by default timeout, with custom error message. |
|
static
|
waitUntilEquals(T expectedValue,
TimedQuery<T> query)
Wait until given query evaluates to actual value that is equal to expectedValue by default timeout. |
|
static void |
waitUntilFalse(String message,
TimedQuery<Boolean> condition)
Wait until given condition is false by default timeout, with custom error message. |
|
static void |
waitUntilFalse(TimedQuery<Boolean> condition)
Wait until given condition is false by default timeout |
|
static void |
waitUntilTrue(String message,
TimedQuery<Boolean> condition)
Wait until given condition is true by default timeout, with custom error message. |
|
static void |
waitUntilTrue(TimedQuery<Boolean> condition)
Wait until given condition is true by default timeout |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void waitUntilTrue(TimedQuery<Boolean> condition)
true by default timeout
condition - condition to exercise
public static void waitUntilTrue(String message,
TimedQuery<Boolean> condition)
true by default timeout, with custom error message.
message - error messagecondition - condition to exercisepublic static void waitUntilFalse(TimedQuery<Boolean> condition)
false by default timeout
condition - condition to exercise
public static void waitUntilFalse(String message,
TimedQuery<Boolean> condition)
false by default timeout, with custom error message.
message - error messagecondition - condition to exercise
public static <T> T waitUntilEquals(T expectedValue,
TimedQuery<T> query)
expectedValue - expected valuequery - query to evaluate
public static <T> T waitUntilEquals(String message,
T expectedValue,
TimedQuery<T> query)
message - error messageexpectedValue - expected valuequery - query to evaluate
public static <T> T waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
query - timed query to evaluatematcher - a matcher representing the assertion condition
Matcher,
Matchers
public static <T> T waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
message - message displayed in case of failurequery - timed query to evaluatematcher - a matcher representing the assertion condition
Matcher,
Matchers
public static <T> T waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
To specify desired timeout, use one of four provided timeouts: now(), byDefaultTimeout(),
#by(long), by(long, java.util.concurrent.TimeUnit).
query - timed query to evaluatematcher - a matcher representing the assertion conditiontimeout - time limit for this wait
Matcher,
Matchers,
now(),
by(long),
by(long, java.util.concurrent.TimeUnit),
byDefaultTimeout()
public static <T> T waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout.
Use any matcher from the libraries available (e.g. Hamcrest, JUnit etc.), or a custom one.
To specify desired timeout, use one of four provided timeouts: now(), byDefaultTimeout(),
#by(long), by(long, java.util.concurrent.TimeUnit).
message - message displayed for failed assertionquery - timed query to verifymatcher - a matcher representing the assertion conditiontimeout - timeout of the assertion
Matcher,
Matchers,
now(),
by(long),
by(long, java.util.concurrent.TimeUnit),
byDefaultTimeout()public static Poller.WaitTimeout now()
public static Poller.WaitTimeout byDefaultTimeout()
true.
public static Poller.WaitTimeout by(long timeoutInMillis)
TimedAssertions.by(500L);
passed to an assertion method will make it wait 500 milliseconds for given condition to become true.
timeoutInMillis - number of milliseconds to wait for the assertion condition
public static Poller.WaitTimeout by(long timeout,
TimeUnit unit)
TimedAssertions.by(5, TimeUnit.SECONDS);
passed to an assertion method will make it wait 5 seconds for given condition to become true.
timeout - timeout countunit - unit of the timeout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||