Skip to main content

method TestContext.prototype.waitFor

#TestContext.prototype.waitFor<T>(
condition: () => T,
): Promise<Awaited<T>>

This method polls a condition function until that function either returns successfully or the operation times out.

Type Parameters #

#T

Parameters #

#condition: () => T

An assertion function that is invoked periodically until it completes successfully or the defined polling timeout elapses. Successful completion is defined as not throwing or rejecting. This function does not accept any arguments, and is allowed to return any value.

#options: TestContextWaitForOptions
optional

An optional configuration object for the polling operation.

Return Type #

Promise<Awaited<T>>

Fulfilled with the value returned by condition.

Did you find what you needed?

Privacy policy