Handles the execution of scheduled tasks, each of which may be an asynchronous operation. The control flow will ensure tasks are executed in the ordered scheduled, starting each task only once those before it have completed.
clearHistory()code »
deprecated
Clears this instance's task history.
Deprecated: Now a no-op; will be removed in 2.46.0.
deprecated
Returns a summary of the recent task activity for this instance. This includes the most recently completed task, as well as any parent tasks. In the returned summary, the task at index N is considered a sub-task of the task at index N+1.
Deprecated: Now a no-op; will be removed in 2.46.0.
Returns
Array<string>
A summary of this instance's recent task activity.
<T>
wait(condition, opt_timeout, opt_message)code »
Schedules a task that shall wait for a condition to hold. Each condition function may return any value, but it will always be evaluated as a boolean.
Condition functions may schedule sub-tasks with this instance, however, their execution time will be factored into whether a wait has timed out.
In the event a condition returns a Promise, the polling loop will wait for it to be resolved before evaluating whether the condition has been satisfied. The resolution time for a promise is factored into whether a wait has timed out.
If the condition function throws, or returns a rejected promise, the wait task will fail.
If the condition is defined as a promise, the flow will block on that promise's resolution, up to timeout
milliseconds. If timeout === 0
, the flow will block indefinitely on the promise's resolution.
Parameters
- condition
(webdriver.promise.Promise<T>|function(): ?)
The condition to poll, or a promise to wait on.
- opt_timeout
number=
How long to wait, in milliseconds, for the condition to hold before timing out; defaults to 0.
- opt_message
string=
An optional error message to include if the wait times out; defaults to the empty string.
Returns
webdriver.promise.Promise<T>
A promise that will be fulfilled when the condition has been satisified. The promise shall be rejected if the wait times out waiting for the condition.
Throws
TypeError
If condition is not a function or promise or if timeout is not a number >= 0.