Method: Playwright::WebSocket#wait_for_event

Defined in:
lib/playwright_api/web_socket.rb

#wait_for_event(event, predicate: nil, timeout: nil, &block) ⇒ Object

NOTE: In most cases, you should use [‘method: WebSocket.waitForEvent`].

Waits for given ‘event` to fire. If predicate is provided, it passes event’s value into the ‘predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is closed before the `event` is fired.



33
34
35
# File 'lib/playwright_api/web_socket.rb', line 33

def wait_for_event(event, predicate: nil, timeout: nil, &block)
  wrap_impl(@impl.wait_for_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
end