The WebSocket class represents websocket connections in the page.
Indicates that the web socket has been closed.
Contains the URL of the WebSocket.
def expect_event(event, predicate: nil, timeout: nil, &block)
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 webSocket is closed before the event is fired. Returns the event data value.
def wait_for_event(event, predicate: nil, timeout: nil, &block)
NOTE: In most cases, you should use WebSocket#wait_for_event.
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.