playwright-ruby-client 1.21.0 → 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/docs/api/element_handle.md +19 -6
- data/documentation/docs/api/experimental/android.md +1 -1
- data/documentation/docs/api/file_chooser.md +1 -1
- data/documentation/docs/api/frame.md +12 -5
- data/documentation/docs/api/locator.md +29 -7
- data/documentation/docs/api/page.md +14 -7
- data/documentation/docs/api/route.md +2 -0
- data/documentation/docs/include/api_coverage.md +1 -0
- data/lib/playwright/javascript/value_parser.rb +17 -2
- data/lib/playwright/javascript/value_serializer.rb +13 -2
- data/lib/playwright/javascript/visitor_info.rb +26 -0
- data/lib/playwright/locator_impl.rb +10 -0
- data/lib/playwright/playwright_api.rb +26 -6
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/android.rb +8 -8
- data/lib/playwright_api/android_device.rb +6 -6
- data/lib/playwright_api/api_request_context.rb +6 -6
- data/lib/playwright_api/browser.rb +6 -6
- data/lib/playwright_api/browser_context.rb +10 -10
- data/lib/playwright_api/browser_type.rb +6 -6
- data/lib/playwright_api/cdp_session.rb +6 -6
- data/lib/playwright_api/console_message.rb +6 -6
- data/lib/playwright_api/dialog.rb +6 -6
- data/lib/playwright_api/element_handle.rb +25 -12
- data/lib/playwright_api/file_chooser.rb +1 -1
- data/lib/playwright_api/frame.rb +18 -11
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +26 -7
- data/lib/playwright_api/page.rb +20 -13
- data/lib/playwright_api/playwright.rb +8 -8
- data/lib/playwright_api/request.rb +6 -6
- data/lib/playwright_api/response.rb +6 -6
- data/lib/playwright_api/route.rb +8 -6
- data/lib/playwright_api/selectors.rb +6 -6
- data/lib/playwright_api/tracing.rb +6 -6
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/worker.rb +6 -6
- metadata +4 -3
@@ -35,20 +35,20 @@ module Playwright
|
|
35
35
|
|
36
36
|
# -- inherited from EventEmitter --
|
37
37
|
# @nodoc
|
38
|
-
def
|
39
|
-
event_emitter_proxy.
|
38
|
+
def off(event, callback)
|
39
|
+
event_emitter_proxy.off(event, callback)
|
40
40
|
end
|
41
41
|
|
42
42
|
# -- inherited from EventEmitter --
|
43
43
|
# @nodoc
|
44
|
-
def
|
45
|
-
event_emitter_proxy.
|
44
|
+
def once(event, callback)
|
45
|
+
event_emitter_proxy.once(event, callback)
|
46
46
|
end
|
47
47
|
|
48
48
|
# -- inherited from EventEmitter --
|
49
49
|
# @nodoc
|
50
|
-
def
|
51
|
-
event_emitter_proxy.
|
50
|
+
def on(event, callback)
|
51
|
+
event_emitter_proxy.on(event, callback)
|
52
52
|
end
|
53
53
|
|
54
54
|
private def event_emitter_proxy
|
@@ -44,20 +44,20 @@ module Playwright
|
|
44
44
|
|
45
45
|
# -- inherited from EventEmitter --
|
46
46
|
# @nodoc
|
47
|
-
def
|
48
|
-
event_emitter_proxy.
|
47
|
+
def off(event, callback)
|
48
|
+
event_emitter_proxy.off(event, callback)
|
49
49
|
end
|
50
50
|
|
51
51
|
# -- inherited from EventEmitter --
|
52
52
|
# @nodoc
|
53
|
-
def
|
54
|
-
event_emitter_proxy.
|
53
|
+
def once(event, callback)
|
54
|
+
event_emitter_proxy.once(event, callback)
|
55
55
|
end
|
56
56
|
|
57
57
|
# -- inherited from EventEmitter --
|
58
58
|
# @nodoc
|
59
|
-
def
|
60
|
-
event_emitter_proxy.
|
59
|
+
def on(event, callback)
|
60
|
+
event_emitter_proxy.on(event, callback)
|
61
61
|
end
|
62
62
|
|
63
63
|
private def event_emitter_proxy
|
@@ -60,20 +60,20 @@ module Playwright
|
|
60
60
|
|
61
61
|
# -- inherited from EventEmitter --
|
62
62
|
# @nodoc
|
63
|
-
def
|
64
|
-
event_emitter_proxy.
|
63
|
+
def off(event, callback)
|
64
|
+
event_emitter_proxy.off(event, callback)
|
65
65
|
end
|
66
66
|
|
67
67
|
# -- inherited from EventEmitter --
|
68
68
|
# @nodoc
|
69
|
-
def
|
70
|
-
event_emitter_proxy.
|
69
|
+
def once(event, callback)
|
70
|
+
event_emitter_proxy.once(event, callback)
|
71
71
|
end
|
72
72
|
|
73
73
|
# -- inherited from EventEmitter --
|
74
74
|
# @nodoc
|
75
|
-
def
|
76
|
-
event_emitter_proxy.
|
75
|
+
def on(event, callback)
|
76
|
+
event_emitter_proxy.on(event, callback)
|
77
77
|
end
|
78
78
|
|
79
79
|
private def event_emitter_proxy
|
@@ -267,7 +267,10 @@ module Playwright
|
|
267
267
|
wrap_impl(@impl.inner_text)
|
268
268
|
end
|
269
269
|
|
270
|
-
# Returns `input.value` for `<input>` or `<textarea>` or `<select>` element.
|
270
|
+
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
271
|
+
#
|
272
|
+
# Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
|
273
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
|
271
274
|
def input_value(timeout: nil)
|
272
275
|
wrap_impl(@impl.input_value(timeout: unwrap_impl(timeout)))
|
273
276
|
end
|
@@ -341,10 +344,14 @@ module Playwright
|
|
341
344
|
wrap_impl(@impl.query_selector_all(unwrap_impl(selector)))
|
342
345
|
end
|
343
346
|
|
344
|
-
#
|
347
|
+
# This method captures a screenshot of the page, clipped to the size and position of this particular element. If the
|
348
|
+
# element is covered by other elements, it will not be actually visible on the screenshot. If the element is a scrollable
|
349
|
+
# container, only the currently scrolled content will be visible on the screenshot.
|
345
350
|
#
|
346
351
|
# This method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking a
|
347
352
|
# screenshot. If the element is detached from DOM, the method throws an error.
|
353
|
+
#
|
354
|
+
# Returns the buffer with the captured screenshot.
|
348
355
|
def screenshot(
|
349
356
|
animations: nil,
|
350
357
|
caret: nil,
|
@@ -411,6 +418,10 @@ module Playwright
|
|
411
418
|
|
412
419
|
# This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its text
|
413
420
|
# content.
|
421
|
+
#
|
422
|
+
# If the element is inside the `<label>` element that has an associated
|
423
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the
|
424
|
+
# control instead.
|
414
425
|
def select_text(force: nil, timeout: nil)
|
415
426
|
wrap_impl(@impl.select_text(force: unwrap_impl(force), timeout: unwrap_impl(timeout)))
|
416
427
|
end
|
@@ -438,11 +449,13 @@ module Playwright
|
|
438
449
|
end
|
439
450
|
alias_method :checked=, :set_checked
|
440
451
|
|
441
|
-
# This method expects `elementHandle` to point to an
|
442
|
-
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
443
|
-
#
|
444
452
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
445
|
-
# are resolved relative to the
|
453
|
+
# are resolved relative to the current working directory. For empty array, clears the selected files.
|
454
|
+
#
|
455
|
+
# This method expects `ElementHandle` to point to an
|
456
|
+
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
|
457
|
+
# `<label>` element that has an associated
|
458
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
|
446
459
|
def set_input_files(files, noWaitAfter: nil, timeout: nil)
|
447
460
|
wrap_impl(@impl.set_input_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
448
461
|
end
|
@@ -557,20 +570,20 @@ module Playwright
|
|
557
570
|
|
558
571
|
# -- inherited from EventEmitter --
|
559
572
|
# @nodoc
|
560
|
-
def
|
561
|
-
event_emitter_proxy.
|
573
|
+
def off(event, callback)
|
574
|
+
event_emitter_proxy.off(event, callback)
|
562
575
|
end
|
563
576
|
|
564
577
|
# -- inherited from EventEmitter --
|
565
578
|
# @nodoc
|
566
|
-
def
|
567
|
-
event_emitter_proxy.
|
579
|
+
def once(event, callback)
|
580
|
+
event_emitter_proxy.once(event, callback)
|
568
581
|
end
|
569
582
|
|
570
583
|
# -- inherited from EventEmitter --
|
571
584
|
# @nodoc
|
572
|
-
def
|
573
|
-
event_emitter_proxy.
|
585
|
+
def on(event, callback)
|
586
|
+
event_emitter_proxy.on(event, callback)
|
574
587
|
end
|
575
588
|
|
576
589
|
private def event_emitter_proxy
|
@@ -25,7 +25,7 @@ module Playwright
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then
|
28
|
-
# they are resolved relative to the
|
28
|
+
# they are resolved relative to the current working directory. For empty array, clears the selected files.
|
29
29
|
def set_files(files, noWaitAfter: nil, timeout: nil)
|
30
30
|
wrap_impl(@impl.set_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
31
31
|
end
|
data/lib/playwright_api/frame.rb
CHANGED
@@ -400,7 +400,10 @@ module Playwright
|
|
400
400
|
wrap_impl(@impl.inner_text(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
401
401
|
end
|
402
402
|
|
403
|
-
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
403
|
+
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
404
|
+
#
|
405
|
+
# Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
|
406
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
|
404
407
|
def input_value(selector, strict: nil, timeout: nil)
|
405
408
|
wrap_impl(@impl.input_value(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
406
409
|
end
|
@@ -445,6 +448,8 @@ module Playwright
|
|
445
448
|
# The method returns an element locator that can be used to perform actions in the frame. Locator is resolved to the
|
446
449
|
# element immediately before performing an action, so a series of actions on the same locator can in fact be performed on
|
447
450
|
# different DOM elements. That would happen if the DOM structure between those actions has changed.
|
451
|
+
#
|
452
|
+
# [Learn more about locators](../locators.md).
|
448
453
|
def locator(selector, has: nil, hasText: nil)
|
449
454
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
450
455
|
end
|
@@ -576,11 +581,13 @@ module Playwright
|
|
576
581
|
end
|
577
582
|
alias_method :content=, :set_content
|
578
583
|
|
579
|
-
# This method expects `selector` to point to an
|
580
|
-
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
581
|
-
#
|
582
584
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
583
|
-
# are resolved relative to the
|
585
|
+
# are resolved relative to the current working directory. For empty array, clears the selected files.
|
586
|
+
#
|
587
|
+
# This method expects `selector` to point to an
|
588
|
+
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
|
589
|
+
# `<label>` element that has an associated
|
590
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
|
584
591
|
def set_input_files(
|
585
592
|
selector,
|
586
593
|
files,
|
@@ -795,20 +802,20 @@ module Playwright
|
|
795
802
|
|
796
803
|
# -- inherited from EventEmitter --
|
797
804
|
# @nodoc
|
798
|
-
def
|
799
|
-
event_emitter_proxy.
|
805
|
+
def off(event, callback)
|
806
|
+
event_emitter_proxy.off(event, callback)
|
800
807
|
end
|
801
808
|
|
802
809
|
# -- inherited from EventEmitter --
|
803
810
|
# @nodoc
|
804
|
-
def
|
805
|
-
event_emitter_proxy.
|
811
|
+
def once(event, callback)
|
812
|
+
event_emitter_proxy.once(event, callback)
|
806
813
|
end
|
807
814
|
|
808
815
|
# -- inherited from EventEmitter --
|
809
816
|
# @nodoc
|
810
|
-
def
|
811
|
-
event_emitter_proxy.
|
817
|
+
def on(event, callback)
|
818
|
+
event_emitter_proxy.on(event, callback)
|
812
819
|
end
|
813
820
|
|
814
821
|
private def event_emitter_proxy
|
@@ -90,20 +90,20 @@ module Playwright
|
|
90
90
|
|
91
91
|
# -- inherited from EventEmitter --
|
92
92
|
# @nodoc
|
93
|
-
def
|
94
|
-
event_emitter_proxy.
|
93
|
+
def off(event, callback)
|
94
|
+
event_emitter_proxy.off(event, callback)
|
95
95
|
end
|
96
96
|
|
97
97
|
# -- inherited from EventEmitter --
|
98
98
|
# @nodoc
|
99
|
-
def
|
100
|
-
event_emitter_proxy.
|
99
|
+
def once(event, callback)
|
100
|
+
event_emitter_proxy.once(event, callback)
|
101
101
|
end
|
102
102
|
|
103
103
|
# -- inherited from EventEmitter --
|
104
104
|
# @nodoc
|
105
|
-
def
|
106
|
-
event_emitter_proxy.
|
105
|
+
def on(event, callback)
|
106
|
+
event_emitter_proxy.on(event, callback)
|
107
107
|
end
|
108
108
|
|
109
109
|
private def event_emitter_proxy
|
@@ -224,6 +224,11 @@ module Playwright
|
|
224
224
|
wrap_impl(@impl.fill(unwrap_impl(value), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
225
225
|
end
|
226
226
|
|
227
|
+
# This method narrows existing locator according to the options, for example filters by text.
|
228
|
+
def filter(has: nil, hasText: nil)
|
229
|
+
wrap_impl(@impl.filter(has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
230
|
+
end
|
231
|
+
|
227
232
|
# Returns locator to the first matching element.
|
228
233
|
def first
|
229
234
|
wrap_impl(@impl.first)
|
@@ -285,7 +290,10 @@ module Playwright
|
|
285
290
|
wrap_impl(@impl.inner_text(timeout: unwrap_impl(timeout)))
|
286
291
|
end
|
287
292
|
|
288
|
-
# Returns `input.value` for `<input>` or `<textarea>` or `<select>` element.
|
293
|
+
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
294
|
+
#
|
295
|
+
# Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
|
296
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
|
289
297
|
def input_value(timeout: nil)
|
290
298
|
wrap_impl(@impl.input_value(timeout: unwrap_impl(timeout)))
|
291
299
|
end
|
@@ -325,7 +333,8 @@ module Playwright
|
|
325
333
|
wrap_impl(@impl.last)
|
326
334
|
end
|
327
335
|
|
328
|
-
# The method finds an element matching the specified selector in the `Locator`'s subtree.
|
336
|
+
# The method finds an element matching the specified selector in the `Locator`'s subtree. It also accepts filter options,
|
337
|
+
# similar to [`method: Locator.filter`] method.
|
329
338
|
def locator(selector, has: nil, hasText: nil)
|
330
339
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
331
340
|
end
|
@@ -362,10 +371,14 @@ module Playwright
|
|
362
371
|
wrap_impl(@impl.press(unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
363
372
|
end
|
364
373
|
|
365
|
-
#
|
374
|
+
# This method captures a screenshot of the page, clipped to the size and position of a particular element matching the
|
375
|
+
# locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element
|
376
|
+
# is a scrollable container, only the currently scrolled content will be visible on the screenshot.
|
366
377
|
#
|
367
378
|
# This method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking a
|
368
379
|
# screenshot. If the element is detached from DOM, the method throws an error.
|
380
|
+
#
|
381
|
+
# Returns the buffer with the captured screenshot.
|
369
382
|
def screenshot(
|
370
383
|
animations: nil,
|
371
384
|
caret: nil,
|
@@ -429,6 +442,10 @@ module Playwright
|
|
429
442
|
|
430
443
|
# This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its text
|
431
444
|
# content.
|
445
|
+
#
|
446
|
+
# If the element is inside the `<label>` element that has an associated
|
447
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the
|
448
|
+
# control instead.
|
432
449
|
def select_text(force: nil, timeout: nil)
|
433
450
|
wrap_impl(@impl.select_text(force: unwrap_impl(force), timeout: unwrap_impl(timeout)))
|
434
451
|
end
|
@@ -456,11 +473,13 @@ module Playwright
|
|
456
473
|
end
|
457
474
|
alias_method :checked=, :set_checked
|
458
475
|
|
459
|
-
# This method expects `element` to point to an
|
460
|
-
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
461
|
-
#
|
462
476
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
463
|
-
# are resolved relative to the
|
477
|
+
# are resolved relative to the current working directory. For empty array, clears the selected files.
|
478
|
+
#
|
479
|
+
# This method expects `Locator` to point to an
|
480
|
+
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
|
481
|
+
# `<label>` element that has an associated
|
482
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
|
464
483
|
def set_input_files(files, noWaitAfter: nil, timeout: nil)
|
465
484
|
wrap_impl(@impl.set_input_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
466
485
|
end
|
data/lib/playwright_api/page.rb
CHANGED
@@ -583,8 +583,8 @@ module Playwright
|
|
583
583
|
wrap_impl(@impl.go_forward(timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
584
584
|
end
|
585
585
|
|
586
|
-
# Returns the main resource response. In case of multiple redirects, the navigation will resolve with the
|
587
|
-
#
|
586
|
+
# Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first
|
587
|
+
# non-redirect response.
|
588
588
|
#
|
589
589
|
# The method will throw an error if:
|
590
590
|
# - there's an SSL error (e.g. in case of self-signed certificates).
|
@@ -640,7 +640,10 @@ module Playwright
|
|
640
640
|
wrap_impl(@impl.inner_text(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
641
641
|
end
|
642
642
|
|
643
|
-
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
643
|
+
# Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
644
|
+
#
|
645
|
+
# Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
|
646
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
|
644
647
|
def input_value(selector, strict: nil, timeout: nil)
|
645
648
|
wrap_impl(@impl.input_value(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
646
649
|
end
|
@@ -686,6 +689,8 @@ module Playwright
|
|
686
689
|
# element immediately before performing an action, so a series of actions on the same locator can in fact be performed on
|
687
690
|
# different DOM elements. That would happen if the DOM structure between those actions has changed.
|
688
691
|
#
|
692
|
+
# [Learn more about locators](../locators.md).
|
693
|
+
#
|
689
694
|
# Shortcut for main frame's [`method: Frame.locator`].
|
690
695
|
def locator(selector, has: nil, hasText: nil)
|
691
696
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
@@ -1004,11 +1009,13 @@ module Playwright
|
|
1004
1009
|
end
|
1005
1010
|
alias_method :extra_http_headers=, :set_extra_http_headers
|
1006
1011
|
|
1007
|
-
# This method expects `selector` to point to an
|
1008
|
-
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
1009
|
-
#
|
1010
1012
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
1011
|
-
# are resolved relative to the
|
1013
|
+
# are resolved relative to the current working directory. For empty array, clears the selected files.
|
1014
|
+
#
|
1015
|
+
# This method expects `selector` to point to an
|
1016
|
+
# [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
|
1017
|
+
# `<label>` element that has an associated
|
1018
|
+
# [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
|
1012
1019
|
def set_input_files(
|
1013
1020
|
selector,
|
1014
1021
|
files,
|
@@ -1419,20 +1426,20 @@ module Playwright
|
|
1419
1426
|
|
1420
1427
|
# -- inherited from EventEmitter --
|
1421
1428
|
# @nodoc
|
1422
|
-
def
|
1423
|
-
event_emitter_proxy.
|
1429
|
+
def off(event, callback)
|
1430
|
+
event_emitter_proxy.off(event, callback)
|
1424
1431
|
end
|
1425
1432
|
|
1426
1433
|
# -- inherited from EventEmitter --
|
1427
1434
|
# @nodoc
|
1428
|
-
def
|
1429
|
-
event_emitter_proxy.
|
1435
|
+
def once(event, callback)
|
1436
|
+
event_emitter_proxy.once(event, callback)
|
1430
1437
|
end
|
1431
1438
|
|
1432
1439
|
# -- inherited from EventEmitter --
|
1433
1440
|
# @nodoc
|
1434
|
-
def
|
1435
|
-
event_emitter_proxy.
|
1441
|
+
def on(event, callback)
|
1442
|
+
event_emitter_proxy.on(event, callback)
|
1436
1443
|
end
|
1437
1444
|
|
1438
1445
|
private def event_emitter_proxy
|
@@ -86,14 +86,20 @@ module Playwright
|
|
86
86
|
raise NotImplementedError.new('stop is not implemented yet.')
|
87
87
|
end
|
88
88
|
|
89
|
+
# @nodoc
|
90
|
+
def android
|
91
|
+
wrap_impl(@impl.android)
|
92
|
+
end
|
93
|
+
|
89
94
|
# @nodoc
|
90
95
|
def electron
|
91
96
|
wrap_impl(@impl.electron)
|
92
97
|
end
|
93
98
|
|
99
|
+
# -- inherited from EventEmitter --
|
94
100
|
# @nodoc
|
95
|
-
def
|
96
|
-
|
101
|
+
def off(event, callback)
|
102
|
+
event_emitter_proxy.off(event, callback)
|
97
103
|
end
|
98
104
|
|
99
105
|
# -- inherited from EventEmitter --
|
@@ -108,12 +114,6 @@ module Playwright
|
|
108
114
|
event_emitter_proxy.on(event, callback)
|
109
115
|
end
|
110
116
|
|
111
|
-
# -- inherited from EventEmitter --
|
112
|
-
# @nodoc
|
113
|
-
def off(event, callback)
|
114
|
-
event_emitter_proxy.off(event, callback)
|
115
|
-
end
|
116
|
-
|
117
117
|
private def event_emitter_proxy
|
118
118
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
119
119
|
end
|
@@ -156,20 +156,20 @@ module Playwright
|
|
156
156
|
|
157
157
|
# -- inherited from EventEmitter --
|
158
158
|
# @nodoc
|
159
|
-
def
|
160
|
-
event_emitter_proxy.
|
159
|
+
def off(event, callback)
|
160
|
+
event_emitter_proxy.off(event, callback)
|
161
161
|
end
|
162
162
|
|
163
163
|
# -- inherited from EventEmitter --
|
164
164
|
# @nodoc
|
165
|
-
def
|
166
|
-
event_emitter_proxy.
|
165
|
+
def once(event, callback)
|
166
|
+
event_emitter_proxy.once(event, callback)
|
167
167
|
end
|
168
168
|
|
169
169
|
# -- inherited from EventEmitter --
|
170
170
|
# @nodoc
|
171
|
-
def
|
172
|
-
event_emitter_proxy.
|
171
|
+
def on(event, callback)
|
172
|
+
event_emitter_proxy.on(event, callback)
|
173
173
|
end
|
174
174
|
|
175
175
|
private def event_emitter_proxy
|
@@ -99,20 +99,20 @@ module Playwright
|
|
99
99
|
|
100
100
|
# -- inherited from EventEmitter --
|
101
101
|
# @nodoc
|
102
|
-
def
|
103
|
-
event_emitter_proxy.
|
102
|
+
def off(event, callback)
|
103
|
+
event_emitter_proxy.off(event, callback)
|
104
104
|
end
|
105
105
|
|
106
106
|
# -- inherited from EventEmitter --
|
107
107
|
# @nodoc
|
108
|
-
def
|
109
|
-
event_emitter_proxy.
|
108
|
+
def once(event, callback)
|
109
|
+
event_emitter_proxy.once(event, callback)
|
110
110
|
end
|
111
111
|
|
112
112
|
# -- inherited from EventEmitter --
|
113
113
|
# @nodoc
|
114
|
-
def
|
115
|
-
event_emitter_proxy.
|
114
|
+
def on(event, callback)
|
115
|
+
event_emitter_proxy.on(event, callback)
|
116
116
|
end
|
117
117
|
|
118
118
|
private def event_emitter_proxy
|
data/lib/playwright_api/route.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Playwright
|
2
2
|
# Whenever a network route is set up with [`method: Page.route`] or [`method: BrowserContext.route`], the `Route` object
|
3
3
|
# allows to handle the route.
|
4
|
+
#
|
5
|
+
# Learn more about [networking](../network.md).
|
4
6
|
class Route < PlaywrightApi
|
5
7
|
|
6
8
|
# Aborts the route's request.
|
@@ -59,20 +61,20 @@ module Playwright
|
|
59
61
|
|
60
62
|
# -- inherited from EventEmitter --
|
61
63
|
# @nodoc
|
62
|
-
def
|
63
|
-
event_emitter_proxy.
|
64
|
+
def off(event, callback)
|
65
|
+
event_emitter_proxy.off(event, callback)
|
64
66
|
end
|
65
67
|
|
66
68
|
# -- inherited from EventEmitter --
|
67
69
|
# @nodoc
|
68
|
-
def
|
69
|
-
event_emitter_proxy.
|
70
|
+
def once(event, callback)
|
71
|
+
event_emitter_proxy.once(event, callback)
|
70
72
|
end
|
71
73
|
|
72
74
|
# -- inherited from EventEmitter --
|
73
75
|
# @nodoc
|
74
|
-
def
|
75
|
-
event_emitter_proxy.
|
76
|
+
def on(event, callback)
|
77
|
+
event_emitter_proxy.on(event, callback)
|
76
78
|
end
|
77
79
|
|
78
80
|
private def event_emitter_proxy
|
@@ -45,20 +45,20 @@ module Playwright
|
|
45
45
|
|
46
46
|
# -- inherited from EventEmitter --
|
47
47
|
# @nodoc
|
48
|
-
def
|
49
|
-
event_emitter_proxy.
|
48
|
+
def off(event, callback)
|
49
|
+
event_emitter_proxy.off(event, callback)
|
50
50
|
end
|
51
51
|
|
52
52
|
# -- inherited from EventEmitter --
|
53
53
|
# @nodoc
|
54
|
-
def
|
55
|
-
event_emitter_proxy.
|
54
|
+
def once(event, callback)
|
55
|
+
event_emitter_proxy.once(event, callback)
|
56
56
|
end
|
57
57
|
|
58
58
|
# -- inherited from EventEmitter --
|
59
59
|
# @nodoc
|
60
|
-
def
|
61
|
-
event_emitter_proxy.
|
60
|
+
def on(event, callback)
|
61
|
+
event_emitter_proxy.on(event, callback)
|
62
62
|
end
|
63
63
|
|
64
64
|
private def event_emitter_proxy
|
@@ -66,20 +66,20 @@ module Playwright
|
|
66
66
|
|
67
67
|
# -- inherited from EventEmitter --
|
68
68
|
# @nodoc
|
69
|
-
def
|
70
|
-
event_emitter_proxy.
|
69
|
+
def off(event, callback)
|
70
|
+
event_emitter_proxy.off(event, callback)
|
71
71
|
end
|
72
72
|
|
73
73
|
# -- inherited from EventEmitter --
|
74
74
|
# @nodoc
|
75
|
-
def
|
76
|
-
event_emitter_proxy.
|
75
|
+
def once(event, callback)
|
76
|
+
event_emitter_proxy.once(event, callback)
|
77
77
|
end
|
78
78
|
|
79
79
|
# -- inherited from EventEmitter --
|
80
80
|
# @nodoc
|
81
|
-
def
|
82
|
-
event_emitter_proxy.
|
81
|
+
def on(event, callback)
|
82
|
+
event_emitter_proxy.on(event, callback)
|
83
83
|
end
|
84
84
|
|
85
85
|
private def event_emitter_proxy
|
@@ -29,20 +29,20 @@ module Playwright
|
|
29
29
|
|
30
30
|
# -- inherited from EventEmitter --
|
31
31
|
# @nodoc
|
32
|
-
def
|
33
|
-
event_emitter_proxy.
|
32
|
+
def off(event, callback)
|
33
|
+
event_emitter_proxy.off(event, callback)
|
34
34
|
end
|
35
35
|
|
36
36
|
# -- inherited from EventEmitter --
|
37
37
|
# @nodoc
|
38
|
-
def
|
39
|
-
event_emitter_proxy.
|
38
|
+
def once(event, callback)
|
39
|
+
event_emitter_proxy.once(event, callback)
|
40
40
|
end
|
41
41
|
|
42
42
|
# -- inherited from EventEmitter --
|
43
43
|
# @nodoc
|
44
|
-
def
|
45
|
-
event_emitter_proxy.
|
44
|
+
def on(event, callback)
|
45
|
+
event_emitter_proxy.on(event, callback)
|
46
46
|
end
|
47
47
|
|
48
48
|
private def event_emitter_proxy
|
@@ -55,20 +55,20 @@ module Playwright
|
|
55
55
|
|
56
56
|
# -- inherited from EventEmitter --
|
57
57
|
# @nodoc
|
58
|
-
def
|
59
|
-
event_emitter_proxy.
|
58
|
+
def off(event, callback)
|
59
|
+
event_emitter_proxy.off(event, callback)
|
60
60
|
end
|
61
61
|
|
62
62
|
# -- inherited from EventEmitter --
|
63
63
|
# @nodoc
|
64
|
-
def
|
65
|
-
event_emitter_proxy.
|
64
|
+
def once(event, callback)
|
65
|
+
event_emitter_proxy.once(event, callback)
|
66
66
|
end
|
67
67
|
|
68
68
|
# -- inherited from EventEmitter --
|
69
69
|
# @nodoc
|
70
|
-
def
|
71
|
-
event_emitter_proxy.
|
70
|
+
def on(event, callback)
|
71
|
+
event_emitter_proxy.on(event, callback)
|
72
72
|
end
|
73
73
|
|
74
74
|
private def event_emitter_proxy
|