module Playwright::WebSocket

Overview

The WebSocket class represents websocket connections in the page.

Defined in:

playwright/websocket.cr

Instance Method Summary

Instance Method Detail

abstract def add_listener(type : EventType, listener : Listener(EventType)) #

[View source]
abstract def is_closed : Bool #

Indicates that the web socket has been closed.


[View source]
abstract def remove_listener(type : EventType, listener : Listener(EventType)) #

[View source]
abstract def url : String #

Contains the URL of the WebSocket.


[View source]
def wait_for_event(event : EventType, predicate : Event(EventType) -> Bool) : Deferred(Event(EventType)) #

[View source]
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.


[View source]
def wait_for_event(event : EventType) : Deferred(Event(EventType)) #

[View source]