playwright-ruby-client 1.56.0 → 1.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/console_message.md +9 -0
  3. data/documentation/docs/api/element_handle.md +2 -0
  4. data/documentation/docs/api/frame.md +1 -0
  5. data/documentation/docs/api/locator.md +22 -0
  6. data/documentation/docs/api/page.md +1 -2
  7. data/documentation/docs/api/worker.md +20 -0
  8. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +19 -0
  9. data/documentation/docs/article/guides/rails_integration.md +43 -2
  10. data/documentation/docs/include/api_coverage.md +3 -5
  11. data/documentation/package.json +2 -2
  12. data/documentation/yarn.lock +9003 -12370
  13. data/lib/playwright/channel_owners/api_request_context.rb +24 -2
  14. data/lib/playwright/channel_owners/browser_context.rb +5 -2
  15. data/lib/playwright/channel_owners/element_handle.rb +6 -2
  16. data/lib/playwright/channel_owners/frame.rb +9 -3
  17. data/lib/playwright/channel_owners/page.rb +30 -10
  18. data/lib/playwright/channel_owners/worker.rb +19 -0
  19. data/lib/playwright/console_message_impl.rb +3 -4
  20. data/lib/playwright/events.rb +1 -0
  21. data/lib/playwright/locator_impl.rb +25 -5
  22. data/lib/playwright/version.rb +2 -2
  23. data/lib/playwright/web_socket_transport.rb +1 -1
  24. data/lib/playwright.rb +4 -0
  25. data/lib/playwright_api/android.rb +4 -4
  26. data/lib/playwright_api/android_device.rb +4 -4
  27. data/lib/playwright_api/api_request_context.rb +4 -4
  28. data/lib/playwright_api/browser.rb +4 -4
  29. data/lib/playwright_api/browser_context.rb +4 -4
  30. data/lib/playwright_api/browser_type.rb +4 -4
  31. data/lib/playwright_api/cdp_session.rb +4 -4
  32. data/lib/playwright_api/console_message.rb +6 -0
  33. data/lib/playwright_api/dialog.rb +4 -4
  34. data/lib/playwright_api/element_handle.rb +8 -6
  35. data/lib/playwright_api/frame.rb +6 -5
  36. data/lib/playwright_api/js_handle.rb +4 -4
  37. data/lib/playwright_api/locator.rb +22 -3
  38. data/lib/playwright_api/page.rb +15 -18
  39. data/lib/playwright_api/playwright.rb +4 -4
  40. data/lib/playwright_api/request.rb +4 -4
  41. data/lib/playwright_api/response.rb +8 -8
  42. data/lib/playwright_api/route.rb +4 -4
  43. data/lib/playwright_api/tracing.rb +4 -4
  44. data/lib/playwright_api/web_socket.rb +4 -4
  45. data/lib/playwright_api/worker.rb +21 -4
  46. data/playwright.gemspec +2 -0
  47. data/sig/playwright.rbs +10 -12
  48. metadata +30 -5
  49. data/documentation/docs/api/accessibility.md +0 -66
  50. data/lib/playwright/accessibility_impl.rb +0 -50
  51. data/lib/playwright_api/accessibility.rb +0 -57
@@ -1,5 +1,5 @@
1
1
  require 'base64'
2
- require 'cgi'
2
+ require 'cgi/escape'
3
3
 
4
4
  module Playwright
5
5
  define_channel_owner :APIRequestContext do
@@ -197,7 +197,7 @@ module Playwright
197
197
  end
198
198
 
199
199
  private def query_string_to_array(query_string)
200
- params = CGI.parse(query_string)
200
+ params = cgi_parse(query_string)
201
201
 
202
202
  params.map do |key, values|
203
203
  values.map do |value|
@@ -206,6 +206,28 @@ module Playwright
206
206
  end.flatten
207
207
  end
208
208
 
209
+ # https://bugs.ruby-lang.org/issues/21258
210
+ # CGI.parse is defined in 'cgi' library.
211
+ # But it produces an error in Ruby 2.4 environment: undefined method `delete_prefix' for "CONTENT_LENGTH":String
212
+ # So we implement our own version of CGI.parse here.
213
+ private def cgi_parse(query)
214
+ # https://github.com/ruby/cgi/blob/master/lib/cgi/core.rb#L396
215
+ params = {}
216
+
217
+ query.split(/[&;]/).each do |pairs|
218
+ key, value = pairs.split('=',2).map do |v|
219
+ CGI.unescape(v)
220
+ end
221
+
222
+ next unless key
223
+ params[key] ||= []
224
+ next unless value
225
+ params[key] << value
226
+ end
227
+
228
+ params
229
+ end
230
+
209
231
  private def object_to_array(hash)
210
232
  hash&.map do |key, value|
211
233
  { name: key, value: value.to_s }
@@ -30,7 +30,7 @@ module Playwright
30
30
  on_service_worker(ChannelOwners::Worker.from(params['worker']))
31
31
  })
32
32
  @channel.on('console', ->(params) {
33
- on_console_message(ConsoleMessageImpl.new(params, ChannelOwners::Page.from_nullable(params['page'])))
33
+ on_console_message(ConsoleMessageImpl.new(params, ChannelOwners::Page.from_nullable(params['page']), ChannelOwners::Worker.from_nullable(params['worker'])))
34
34
  })
35
35
  @channel.on('pageError', ->(params) {
36
36
  on_page_error(
@@ -162,10 +162,13 @@ module Playwright
162
162
  end
163
163
 
164
164
  private def on_console_message(message)
165
- emit(Events::BrowserContext::Console, message)
165
+ if (worker = message.worker)
166
+ worker.emit(Events::Worker::Console, message)
167
+ end
166
168
  if (page = message.page)
167
169
  page.emit(Events::Page::Console, message)
168
170
  end
171
+ emit(Events::BrowserContext::Console, message)
169
172
  end
170
173
 
171
174
  private def on_dialog(dialog)
@@ -110,7 +110,8 @@ module Playwright
110
110
  noWaitAfter: nil,
111
111
  position: nil,
112
112
  timeout: nil,
113
- trial: nil)
113
+ trial: nil,
114
+ steps: nil)
114
115
 
115
116
  params = {
116
117
  button: button,
@@ -122,6 +123,7 @@ module Playwright
122
123
  position: position,
123
124
  timeout: _timeout(timeout),
124
125
  trial: trial,
126
+ steps: steps,
125
127
  }.compact
126
128
  @channel.send_message_to_server('click', params)
127
129
 
@@ -136,7 +138,8 @@ module Playwright
136
138
  noWaitAfter: nil,
137
139
  position: nil,
138
140
  timeout: nil,
139
- trial: nil)
141
+ trial: nil,
142
+ steps: nil)
140
143
 
141
144
  params = {
142
145
  button: button,
@@ -147,6 +150,7 @@ module Playwright
147
150
  position: position,
148
151
  timeout: _timeout(timeout),
149
152
  trial: trial,
153
+ steps: steps,
150
154
  }.compact
151
155
  @channel.send_message_to_server('dblclick', params)
152
156
 
@@ -337,7 +337,8 @@ module Playwright
337
337
  position: nil,
338
338
  strict: nil,
339
339
  timeout: nil,
340
- trial: nil)
340
+ trial: nil,
341
+ steps: nil)
341
342
 
342
343
  params = {
343
344
  selector: selector,
@@ -351,6 +352,7 @@ module Playwright
351
352
  strict: strict,
352
353
  timeout: _timeout(timeout),
353
354
  trial: trial,
355
+ steps: steps,
354
356
  }.compact
355
357
  @channel.send_message_to_server('click', params)
356
358
 
@@ -366,7 +368,8 @@ module Playwright
366
368
  strict: nil,
367
369
  targetPosition: nil,
368
370
  timeout: nil,
369
- trial: nil)
371
+ trial: nil,
372
+ steps: nil)
370
373
 
371
374
  params = {
372
375
  source: source,
@@ -378,6 +381,7 @@ module Playwright
378
381
  targetPosition: targetPosition,
379
382
  timeout: _timeout(timeout),
380
383
  trial: trial,
384
+ steps: steps,
381
385
  }.compact
382
386
  @channel.send_message_to_server('dragAndDrop', params)
383
387
 
@@ -394,7 +398,8 @@ module Playwright
394
398
  position: nil,
395
399
  strict: nil,
396
400
  timeout: nil,
397
- trial: nil)
401
+ trial: nil,
402
+ steps: nil)
398
403
 
399
404
  params = {
400
405
  selector: selector,
@@ -407,6 +412,7 @@ module Playwright
407
412
  strict: strict,
408
413
  timeout: _timeout(timeout),
409
414
  trial: trial,
415
+ steps: steps,
410
416
  }.compact
411
417
  @channel.send_message_to_server('dblclick', params)
412
418
 
@@ -11,7 +11,6 @@ module Playwright
11
11
  private def after_initialize
12
12
  @browser_context = @parent
13
13
  @timeout_settings = TimeoutSettings.new(@browser_context.send(:_timeout_settings))
14
- @accessibility = AccessibilityImpl.new(@channel)
15
14
  @keyboard = KeyboardImpl.new(@channel)
16
15
  @mouse = MouseImpl.new(@channel)
17
16
  @touchscreen = TouchscreenImpl.new(@channel)
@@ -79,7 +78,6 @@ module Playwright
79
78
  end
80
79
 
81
80
  attr_reader \
82
- :accessibility,
83
81
  :keyboard,
84
82
  :mouse,
85
83
  :touchscreen,
@@ -536,7 +534,8 @@ module Playwright
536
534
  position: nil,
537
535
  strict: nil,
538
536
  timeout: nil,
539
- trial: nil)
537
+ trial: nil,
538
+ steps: nil)
540
539
 
541
540
  @main_frame.click(
542
541
  selector,
@@ -550,6 +549,7 @@ module Playwright
550
549
  strict: strict,
551
550
  timeout: timeout,
552
551
  trial: trial,
552
+ steps: steps,
553
553
  )
554
554
  end
555
555
 
@@ -562,7 +562,8 @@ module Playwright
562
562
  strict: nil,
563
563
  targetPosition: nil,
564
564
  timeout: nil,
565
- trial: nil)
565
+ trial: nil,
566
+ steps: nil)
566
567
 
567
568
  @main_frame.drag_and_drop(
568
569
  source,
@@ -573,7 +574,9 @@ module Playwright
573
574
  strict: strict,
574
575
  targetPosition: targetPosition,
575
576
  timeout: timeout,
576
- trial: trial)
577
+ trial: trial,
578
+ steps: steps,
579
+ )
577
580
  end
578
581
 
579
582
  def dblclick(
@@ -586,7 +589,8 @@ module Playwright
586
589
  position: nil,
587
590
  strict: nil,
588
591
  timeout: nil,
589
- trial: nil)
592
+ trial: nil,
593
+ steps: nil)
590
594
  @main_frame.dblclick(
591
595
  selector,
592
596
  button: button,
@@ -598,6 +602,7 @@ module Playwright
598
602
  strict: strict,
599
603
  timeout: timeout,
600
604
  trial: trial,
605
+ steps: steps,
601
606
  )
602
607
  end
603
608
 
@@ -641,7 +646,7 @@ module Playwright
641
646
  def console_messages
642
647
  messages = @channel.send_message_to_server('consoleMessages')
643
648
  messages.map do |message|
644
- ConsoleMessageImpl.new(message, self)
649
+ ConsoleMessageImpl.new(message, self, nil)
645
650
  end
646
651
  end
647
652
 
@@ -901,8 +906,23 @@ module Playwright
901
906
  @video ||= Video.new(self)
902
907
  end
903
908
 
904
- def snapshot_for_ai(timeout: nil)
905
- @channel.send_message_to_server('snapshotForAI', timeout: @timeout_settings.timeout(timeout))
909
+ def snapshot_for_ai(timeout: nil, mode: nil, track: nil)
910
+ option_mode = mode || 'full'
911
+ unless ['full', 'incremental'].include?(option_mode)
912
+ raise ArgumentError.new("mode must be either 'full' or 'incremental'")
913
+ end
914
+
915
+ options = {
916
+ timeout: @timeout_settings.timeout(timeout),
917
+ mode: option_mode,
918
+ }
919
+ options[:track] = track if track
920
+ result = @channel.send_message_to_server_result('snapshotForAI', options)
921
+ if option_mode == 'full'
922
+ result['full']
923
+ elsif option_mode == 'incremental'
924
+ result['incremental']
925
+ end
906
926
  end
907
927
 
908
928
  def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
@@ -1032,7 +1052,7 @@ module Playwright
1032
1052
  expect_event(Events::Page::Worker, predicate: predicate, timeout: timeout, &block)
1033
1053
  end
1034
1054
 
1035
- # called from Frame with send(:timeout_settings)
1055
+ # called from Frame with send(:_timeout_settings)
1036
1056
  private def _timeout_settings
1037
1057
  @timeout_settings
1038
1058
  end
@@ -4,6 +4,10 @@ module Playwright
4
4
 
5
5
  private def after_initialize
6
6
  @channel.once('close', ->(_) { on_close })
7
+
8
+ set_event_to_subscription_mapping({
9
+ Events::Worker::Console => "console",
10
+ })
7
11
  end
8
12
 
9
13
  private def on_close
@@ -23,5 +27,20 @@ module Playwright
23
27
  def evaluate_handle(expression, arg: nil)
24
28
  JavaScript::Expression.new(expression, arg).evaluate_handle(@channel)
25
29
  end
30
+
31
+ def expect_event(event, predicate: nil, timeout: nil, &block)
32
+ waiter = Waiter.new(self, wait_name: "Worker.expect_event(#{event})")
33
+ timeout_value = timeout || @page&.send(:_timeout_settings)&.timeout || @context&.send(:_timeout_settings)&.timeout
34
+ waiter.reject_on_timeout(timeout_value, "Timeout #{timeout_value}ms exceeded while waiting for event \"#{event}\"")
35
+
36
+ unless event == Events::Worker::Close
37
+ waiter.reject_on_event(self, Events::Worker::Close, TargetClosedError.new)
38
+ end
39
+
40
+ waiter.wait_for_event(self, event, predicate: predicate)
41
+ block&.call
42
+
43
+ waiter.result.value!
44
+ end
26
45
  end
27
46
  end
@@ -1,13 +1,12 @@
1
1
  module Playwright
2
2
  define_api_implementation :ConsoleMessageImpl do
3
- def initialize(event, page)
3
+ def initialize(event, page, worker)
4
4
  @event = event
5
5
  @page = page
6
+ @worker = worker
6
7
  end
7
8
 
8
- def page
9
- @page
10
- end
9
+ attr_reader :page, :worker
11
10
 
12
11
  def type
13
12
  @event['type']
@@ -74,6 +74,7 @@ end
74
74
 
75
75
  Worker: {
76
76
  Close: 'close',
77
+ Console: 'console',
77
78
  },
78
79
 
79
80
  ElectronApplication: {
@@ -126,7 +126,8 @@ module Playwright
126
126
  noWaitAfter: nil,
127
127
  position: nil,
128
128
  timeout: nil,
129
- trial: nil)
129
+ trial: nil,
130
+ steps: nil)
130
131
 
131
132
  @frame.click(@selector,
132
133
  strict: true,
@@ -138,7 +139,8 @@ module Playwright
138
139
  noWaitAfter: noWaitAfter,
139
140
  position: position,
140
141
  timeout: timeout,
141
- trial: trial)
142
+ trial: trial,
143
+ steps: steps)
142
144
  end
143
145
 
144
146
  def dblclick(
@@ -149,7 +151,8 @@ module Playwright
149
151
  noWaitAfter: nil,
150
152
  position: nil,
151
153
  timeout: nil,
152
- trial: nil)
154
+ trial: nil,
155
+ steps: nil)
153
156
 
154
157
  @frame.dblclick(@selector,
155
158
  strict: true,
@@ -160,7 +163,8 @@ module Playwright
160
163
  noWaitAfter: noWaitAfter,
161
164
  position: position,
162
165
  timeout: timeout,
163
- trial: trial)
166
+ trial: trial,
167
+ steps: steps)
164
168
  end
165
169
 
166
170
  def dispatch_event(type, eventInit: nil, timeout: nil)
@@ -173,7 +177,8 @@ module Playwright
173
177
  sourcePosition: nil,
174
178
  targetPosition: nil,
175
179
  timeout: nil,
176
- trial: nil)
180
+ trial: nil,
181
+ steps: nil)
177
182
 
178
183
  @frame.drag_and_drop(
179
184
  @selector,
@@ -185,6 +190,7 @@ module Playwright
185
190
  timeout: timeout,
186
191
  trial: trial,
187
192
  strict: true,
193
+ steps: steps,
188
194
  )
189
195
  end
190
196
 
@@ -256,6 +262,20 @@ module Playwright
256
262
  )
257
263
  end
258
264
 
265
+ def description
266
+ if @selector =~ / >> internal:describe=("(?:[^"\\]|\\.)*")$/
267
+ begin
268
+ description = JSON.parse($1)
269
+ if description.is_a?(String)
270
+ return description
271
+ end
272
+ rescue JSON::ParserError
273
+ end
274
+ end
275
+
276
+ nil
277
+ end
278
+
259
279
  def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil, visible: nil)
260
280
  LocatorImpl.new(
261
281
  frame: @frame,
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.56.0'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.56.1'
4
+ VERSION = '1.57.1'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.57.0'
6
6
  end
@@ -6,7 +6,7 @@ module Playwright
6
6
  # ref: https://github.com/microsoft/playwright-python/blob/master/playwright/_impl/_transport.py
7
7
  class WebSocketTransport
8
8
  # @param ws_endpoint [String] EndpointURL of WebSocket
9
- def initialize(ws_endpoint:, headers:)
9
+ def initialize(ws_endpoint:, headers: {})
10
10
  @ws_endpoint = ws_endpoint
11
11
  @headers = headers
12
12
  @debug = ENV['DEBUG'].to_s == 'true' || ENV['DEBUG'].to_s == '1'
data/lib/playwright.rb CHANGED
@@ -104,6 +104,10 @@ module Playwright
104
104
 
105
105
  # @Deprecated. Playwright >= 1.54 does not support this method.
106
106
  module_function def connect_to_playwright_server(ws_endpoint, &block)
107
+ if Gem::Version.new(COMPATIBLE_PLAYWRIGHT_VERSION) >= Gem::Version.new('1.54.0')
108
+ raise NotImplementedError, 'connect_to_playwright_server is deprecated and not supported in Playwright >= 1.54. Use connect_to_browser_server instead.'
109
+ end
110
+
107
111
  require 'playwright/web_socket_client'
108
112
  require 'playwright/web_socket_transport'
109
113
 
@@ -45,8 +45,8 @@ module Playwright
45
45
 
46
46
  # -- inherited from EventEmitter --
47
47
  # @nodoc
48
- def once(event, callback)
49
- event_emitter_proxy.once(event, callback)
48
+ def off(event, callback)
49
+ event_emitter_proxy.off(event, callback)
50
50
  end
51
51
 
52
52
  # -- inherited from EventEmitter --
@@ -57,8 +57,8 @@ module Playwright
57
57
 
58
58
  # -- inherited from EventEmitter --
59
59
  # @nodoc
60
- def off(event, callback)
61
- event_emitter_proxy.off(event, callback)
60
+ def once(event, callback)
61
+ event_emitter_proxy.once(event, callback)
62
62
  end
63
63
 
64
64
  private def event_emitter_proxy
@@ -206,8 +206,8 @@ module Playwright
206
206
 
207
207
  # -- inherited from EventEmitter --
208
208
  # @nodoc
209
- def once(event, callback)
210
- event_emitter_proxy.once(event, callback)
209
+ def off(event, callback)
210
+ event_emitter_proxy.off(event, callback)
211
211
  end
212
212
 
213
213
  # -- inherited from EventEmitter --
@@ -218,8 +218,8 @@ module Playwright
218
218
 
219
219
  # -- inherited from EventEmitter --
220
220
  # @nodoc
221
- def off(event, callback)
222
- event_emitter_proxy.off(event, callback)
221
+ def once(event, callback)
222
+ event_emitter_proxy.once(event, callback)
223
223
  end
224
224
 
225
225
  private def event_emitter_proxy
@@ -288,8 +288,8 @@ module Playwright
288
288
 
289
289
  # -- inherited from EventEmitter --
290
290
  # @nodoc
291
- def once(event, callback)
292
- event_emitter_proxy.once(event, callback)
291
+ def off(event, callback)
292
+ event_emitter_proxy.off(event, callback)
293
293
  end
294
294
 
295
295
  # -- inherited from EventEmitter --
@@ -300,8 +300,8 @@ module Playwright
300
300
 
301
301
  # -- inherited from EventEmitter --
302
302
  # @nodoc
303
- def off(event, callback)
304
- event_emitter_proxy.off(event, callback)
303
+ def once(event, callback)
304
+ event_emitter_proxy.once(event, callback)
305
305
  end
306
306
 
307
307
  private def event_emitter_proxy
@@ -205,8 +205,8 @@ module Playwright
205
205
 
206
206
  # -- inherited from EventEmitter --
207
207
  # @nodoc
208
- def once(event, callback)
209
- event_emitter_proxy.once(event, callback)
208
+ def off(event, callback)
209
+ event_emitter_proxy.off(event, callback)
210
210
  end
211
211
 
212
212
  # -- inherited from EventEmitter --
@@ -217,8 +217,8 @@ module Playwright
217
217
 
218
218
  # -- inherited from EventEmitter --
219
219
  # @nodoc
220
- def off(event, callback)
221
- event_emitter_proxy.off(event, callback)
220
+ def once(event, callback)
221
+ event_emitter_proxy.once(event, callback)
222
222
  end
223
223
 
224
224
  private def event_emitter_proxy
@@ -490,8 +490,8 @@ module Playwright
490
490
 
491
491
  # -- inherited from EventEmitter --
492
492
  # @nodoc
493
- def once(event, callback)
494
- event_emitter_proxy.once(event, callback)
493
+ def off(event, callback)
494
+ event_emitter_proxy.off(event, callback)
495
495
  end
496
496
 
497
497
  # -- inherited from EventEmitter --
@@ -502,8 +502,8 @@ module Playwright
502
502
 
503
503
  # -- inherited from EventEmitter --
504
504
  # @nodoc
505
- def off(event, callback)
506
- event_emitter_proxy.off(event, callback)
505
+ def once(event, callback)
506
+ event_emitter_proxy.once(event, callback)
507
507
  end
508
508
 
509
509
  private def event_emitter_proxy
@@ -182,8 +182,8 @@ module Playwright
182
182
 
183
183
  # -- inherited from EventEmitter --
184
184
  # @nodoc
185
- def once(event, callback)
186
- event_emitter_proxy.once(event, callback)
185
+ def off(event, callback)
186
+ event_emitter_proxy.off(event, callback)
187
187
  end
188
188
 
189
189
  # -- inherited from EventEmitter --
@@ -194,8 +194,8 @@ module Playwright
194
194
 
195
195
  # -- inherited from EventEmitter --
196
196
  # @nodoc
197
- def off(event, callback)
198
- event_emitter_proxy.off(event, callback)
197
+ def once(event, callback)
198
+ event_emitter_proxy.once(event, callback)
199
199
  end
200
200
 
201
201
  private def event_emitter_proxy
@@ -33,8 +33,8 @@ module Playwright
33
33
 
34
34
  # -- inherited from EventEmitter --
35
35
  # @nodoc
36
- def once(event, callback)
37
- event_emitter_proxy.once(event, callback)
36
+ def off(event, callback)
37
+ event_emitter_proxy.off(event, callback)
38
38
  end
39
39
 
40
40
  # -- inherited from EventEmitter --
@@ -45,8 +45,8 @@ module Playwright
45
45
 
46
46
  # -- inherited from EventEmitter --
47
47
  # @nodoc
48
- def off(event, callback)
49
- event_emitter_proxy.off(event, callback)
48
+ def once(event, callback)
49
+ event_emitter_proxy.once(event, callback)
50
50
  end
51
51
 
52
52
  private def event_emitter_proxy
@@ -48,5 +48,11 @@ module Playwright
48
48
  def type
49
49
  wrap_impl(@impl.type)
50
50
  end
51
+
52
+ #
53
+ # The web worker or service worker that produced this console message, if any. Note that console messages from web workers also have non-null [`method: ConsoleMessage.page`].
54
+ def worker
55
+ wrap_impl(@impl.worker)
56
+ end
51
57
  end
52
58
  end
@@ -70,8 +70,8 @@ module Playwright
70
70
 
71
71
  # -- inherited from EventEmitter --
72
72
  # @nodoc
73
- def once(event, callback)
74
- event_emitter_proxy.once(event, callback)
73
+ def off(event, callback)
74
+ event_emitter_proxy.off(event, callback)
75
75
  end
76
76
 
77
77
  # -- inherited from EventEmitter --
@@ -82,8 +82,8 @@ module Playwright
82
82
 
83
83
  # -- inherited from EventEmitter --
84
84
  # @nodoc
85
- def off(event, callback)
86
- event_emitter_proxy.off(event, callback)
85
+ def once(event, callback)
86
+ event_emitter_proxy.once(event, callback)
87
87
  end
88
88
 
89
89
  private def event_emitter_proxy
@@ -100,9 +100,10 @@ module Playwright
100
100
  modifiers: nil,
101
101
  noWaitAfter: nil,
102
102
  position: nil,
103
+ steps: nil,
103
104
  timeout: nil,
104
105
  trial: nil)
105
- wrap_impl(@impl.click(button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
106
+ wrap_impl(@impl.click(button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
106
107
  end
107
108
 
108
109
  #
@@ -130,9 +131,10 @@ module Playwright
130
131
  modifiers: nil,
131
132
  noWaitAfter: nil,
132
133
  position: nil,
134
+ steps: nil,
133
135
  timeout: nil,
134
136
  trial: nil)
135
- wrap_impl(@impl.dblclick(button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
137
+ wrap_impl(@impl.dblclick(button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
136
138
  end
137
139
 
138
140
  #
@@ -574,8 +576,8 @@ module Playwright
574
576
 
575
577
  # -- inherited from EventEmitter --
576
578
  # @nodoc
577
- def once(event, callback)
578
- event_emitter_proxy.once(event, callback)
579
+ def off(event, callback)
580
+ event_emitter_proxy.off(event, callback)
579
581
  end
580
582
 
581
583
  # -- inherited from EventEmitter --
@@ -586,8 +588,8 @@ module Playwright
586
588
 
587
589
  # -- inherited from EventEmitter --
588
590
  # @nodoc
589
- def off(event, callback)
590
- event_emitter_proxy.off(event, callback)
591
+ def once(event, callback)
592
+ event_emitter_proxy.once(event, callback)
591
593
  end
592
594
 
593
595
  private def event_emitter_proxy