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.
Return value
Playwright Context — waiting methods