Class: Playwright::WebSocket

Inherits:
PlaywrightApi show all
Defined in:
lib/playwright_api/web_socket.rb

Overview

The ‘WebSocket` class represents websocket connections in the page.

Instance Method Summary collapse

Methods inherited from PlaywrightApi

from_channel_owner

Instance Method Details

#closed?Boolean

Indicates that the web socket has been closed.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/playwright_api/web_socket.rb', line 6

def closed?
  raise NotImplementedError.new('closed? is not implemented yet.')
end

#urlObject

Contains the URL of the WebSocket.

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/playwright_api/web_socket.rb', line 11

def url
  raise NotImplementedError.new('url is not implemented yet.')
end

#wait_for_event(event, optionsOrPredicate: nil) ⇒ Object

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.

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/playwright_api/web_socket.rb', line 19

def wait_for_event(event, optionsOrPredicate: nil)
  raise NotImplementedError.new('wait_for_event is not implemented yet.')
end