Skip to main content
Context waiting methods for the Playwright driver.

waitForEvent

Waits for event to fire and passes its value into the predicate function.
Returns when the predicate returns truthy value. Will throw an error if the context closes before the event is fired.
Upstream docs
event
string
required
optionsOrPredicate
PlaywrightWaitForEventOptions | ((event: unknown) => boolean)
result
unknown
Return value
await context.waitForEvent('...');