module Playwright::WebSocket
Overview
The WebSocket class represents websocket connections in the page.
Defined in:
playwright/websocket.crInstance Method Summary
- #add_listener(type : EventType, listener : Listener(EventType))
-
#is_closed : Bool
Indicates that the web socket has been closed.
- #remove_listener(type : EventType, listener : Listener(EventType))
-
#url : String
Contains the URL of the WebSocket.
- #wait_for_event(event : EventType, predicate : Event(EventType) -> Bool) : Deferred(Event(EventType))
-
#wait_for_event(event : EventType, options : WaitForEventOptions | Nil) : Deferred(Event(EventType))
Returns the event data value.
- #wait_for_event(event : EventType) : Deferred(Event(EventType))
Instance Method Detail
def wait_for_event(event : EventType, predicate : Event(EventType) -> Bool) : Deferred(Event(EventType))
#
abstract
def wait_for_event(event : EventType, options : WaitForEventOptions | Nil) : Deferred(Event(EventType))
#
Returns the event data value. 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.