-
Notifications
You must be signed in to change notification settings - Fork 44
Waits and timeouts
Waits are used in case when tests have to wait for some time, event or condition to be passed. Best practice is to use conditional waiting so test continues only in case when specific condition passed so developer can be sure that test is in proper state. Unfortunately there are situation when such a condition doesn't exist. In that case it's fine to pause test for some fixed time period.
RedDeer imlements these two main wait classes to perform conditional waiting. Optionally timeout for waiting can be specified using TimePeriod enum. If timeout is not specified TimePeriod.NORMAL is used as default timeout value. Both methods throws WaitTimeoutExpiredException when waiting expires for timeout
WaitUntil(WaitCondition condition); - waits until specified condition is fulfilled
WaitWhile (WaitCondition condition); - waits while specified condition is fulfilled