playwright-ruby-client 1.59.1 → 1.61.0
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.
- checksums.yaml +4 -4
- data/documentation/docs/api/api_request.md +25 -1
- data/documentation/docs/api/api_request_context.md +13 -11
- data/documentation/docs/api/api_response.md +18 -0
- data/documentation/docs/api/browser.md +18 -0
- data/documentation/docs/api/browser_context.md +7 -1
- data/documentation/docs/api/browser_type.md +19 -0
- data/documentation/docs/api/credentials.md +132 -0
- data/documentation/docs/api/frame.md +5 -4
- data/documentation/docs/api/frame_locator.md +1 -0
- data/documentation/docs/api/locator.md +37 -2
- data/documentation/docs/api/locator_assertions.md +1 -1
- data/documentation/docs/api/page.md +24 -4
- data/documentation/docs/api/page_assertions.md +28 -0
- data/documentation/docs/api/playwright.md +5 -0
- data/documentation/docs/api/touchscreen.md +1 -1
- data/documentation/docs/api/tracing.md +29 -0
- data/documentation/docs/api/web_storage.md +65 -0
- data/documentation/docs/include/api_coverage.md +30 -56
- data/lib/playwright/api_request_impl.rb +70 -0
- data/lib/playwright/api_response_impl.rb +8 -0
- data/lib/playwright/channel_owners/api_request_context.rb +5 -1
- data/lib/playwright/channel_owners/binding_call.rb +3 -9
- data/lib/playwright/channel_owners/browser.rb +17 -0
- data/lib/playwright/channel_owners/browser_context.rb +12 -55
- data/lib/playwright/channel_owners/browser_type.rb +35 -1
- data/lib/playwright/channel_owners/frame.rb +118 -13
- data/lib/playwright/channel_owners/json_pipe.rb +4 -0
- data/lib/playwright/channel_owners/local_utils.rb +11 -2
- data/lib/playwright/channel_owners/page.rb +28 -13
- data/lib/playwright/channel_owners/playwright.rb +4 -0
- data/lib/playwright/channel_owners/tracing.rb +105 -4
- data/lib/playwright/connection.rb +12 -2
- data/lib/playwright/console_message_impl.rb +10 -1
- data/lib/playwright/credentials_impl.rb +35 -0
- data/lib/playwright/errors.rb +7 -3
- data/lib/playwright/events.rb +7 -0
- data/lib/playwright/json_pipe_transport.rb +40 -0
- data/lib/playwright/locator_assertions_impl.rb +21 -4
- data/lib/playwright/locator_impl.rb +17 -3
- data/lib/playwright/locator_utils.rb +11 -1
- data/lib/playwright/page_assertions_impl.rb +33 -3
- data/lib/playwright/screencast.rb +8 -2
- data/lib/playwright/url_matcher.rb +35 -0
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright/waiter.rb +9 -41
- data/lib/playwright/web_storage_impl.rb +34 -0
- data/lib/playwright.rb +1 -0
- data/lib/playwright_api/api_request.rb +1 -1
- data/lib/playwright_api/api_request_context.rb +21 -17
- data/lib/playwright_api/api_response.rb +12 -0
- data/lib/playwright_api/browser.rb +8 -8
- data/lib/playwright_api/browser_context.rb +20 -13
- data/lib/playwright_api/browser_type.rb +12 -9
- data/lib/playwright_api/cdp_session.rb +6 -6
- data/lib/playwright_api/credentials.rb +120 -0
- data/lib/playwright_api/dialog.rb +6 -6
- data/lib/playwright_api/element_handle.rb +6 -6
- data/lib/playwright_api/frame.rb +25 -14
- data/lib/playwright_api/frame_locator.rb +2 -1
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +39 -10
- data/lib/playwright_api/locator_assertions.rb +2 -2
- data/lib/playwright_api/page.rb +44 -25
- data/lib/playwright_api/page_assertions.rb +22 -0
- data/lib/playwright_api/playwright.rb +7 -7
- data/lib/playwright_api/request.rb +8 -8
- data/lib/playwright_api/response.rb +6 -6
- data/lib/playwright_api/route.rb +6 -6
- data/lib/playwright_api/touchscreen.rb +1 -1
- data/lib/playwright_api/tracing.rb +27 -4
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/web_storage.rb +48 -0
- data/lib/playwright_api/worker.rb +8 -8
- data/sig/playwright.rbs +51 -39
- metadata +11 -12
- data/documentation/docs/api/experimental/android.md +0 -42
- data/documentation/docs/api/experimental/android_device.md +0 -109
- data/documentation/docs/api/experimental/android_input.md +0 -43
- data/documentation/docs/api/experimental/android_socket.md +0 -7
- data/documentation/docs/api/experimental/android_web_view.md +0 -7
- data/lib/playwright_api/android.rb +0 -68
- data/lib/playwright_api/android_device.rb +0 -229
- data/lib/playwright_api/android_input.rb +0 -34
- data/lib/playwright_api/android_socket.rb +0 -18
- data/lib/playwright_api/android_web_view.rb +0 -24
|
@@ -68,12 +68,6 @@ module Playwright
|
|
|
68
68
|
wrap_impl(@impl.accept_async(promptText: unwrap_impl(promptText)))
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
# -- inherited from EventEmitter --
|
|
72
|
-
# @nodoc
|
|
73
|
-
def on(event, callback)
|
|
74
|
-
event_emitter_proxy.on(event, callback)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
71
|
# -- inherited from EventEmitter --
|
|
78
72
|
# @nodoc
|
|
79
73
|
def off(event, callback)
|
|
@@ -86,6 +80,12 @@ module Playwright
|
|
|
86
80
|
event_emitter_proxy.once(event, callback)
|
|
87
81
|
end
|
|
88
82
|
|
|
83
|
+
# -- inherited from EventEmitter --
|
|
84
|
+
# @nodoc
|
|
85
|
+
def on(event, callback)
|
|
86
|
+
event_emitter_proxy.on(event, callback)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
89
|
private def event_emitter_proxy
|
|
90
90
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
91
91
|
end
|
|
@@ -574,12 +574,6 @@ module Playwright
|
|
|
574
574
|
wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
|
575
575
|
end
|
|
576
576
|
|
|
577
|
-
# -- inherited from EventEmitter --
|
|
578
|
-
# @nodoc
|
|
579
|
-
def on(event, callback)
|
|
580
|
-
event_emitter_proxy.on(event, callback)
|
|
581
|
-
end
|
|
582
|
-
|
|
583
577
|
# -- inherited from EventEmitter --
|
|
584
578
|
# @nodoc
|
|
585
579
|
def off(event, callback)
|
|
@@ -592,6 +586,12 @@ module Playwright
|
|
|
592
586
|
event_emitter_proxy.once(event, callback)
|
|
593
587
|
end
|
|
594
588
|
|
|
589
|
+
# -- inherited from EventEmitter --
|
|
590
|
+
# @nodoc
|
|
591
|
+
def on(event, callback)
|
|
592
|
+
event_emitter_proxy.on(event, callback)
|
|
593
|
+
end
|
|
594
|
+
|
|
595
595
|
private def event_emitter_proxy
|
|
596
596
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
597
597
|
end
|
data/lib/playwright_api/frame.rb
CHANGED
|
@@ -255,7 +255,7 @@ module Playwright
|
|
|
255
255
|
# `ElementHandle` instances can be passed as an argument to the [`method: Frame.evaluate`]:
|
|
256
256
|
#
|
|
257
257
|
# ```python sync
|
|
258
|
-
# body_handle = frame.
|
|
258
|
+
# body_handle = frame.evaluate_handle("document.body")
|
|
259
259
|
# html = frame.evaluate("([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
|
|
260
260
|
# body_handle.dispose()
|
|
261
261
|
# ```
|
|
@@ -282,14 +282,14 @@ module Playwright
|
|
|
282
282
|
# A string can also be passed in instead of a function.
|
|
283
283
|
#
|
|
284
284
|
# ```python sync
|
|
285
|
-
# a_handle =
|
|
285
|
+
# a_handle = frame.evaluate_handle("document") # handle for the "document"
|
|
286
286
|
# ```
|
|
287
287
|
#
|
|
288
288
|
# `JSHandle` instances can be passed as an argument to the [`method: Frame.evaluateHandle`]:
|
|
289
289
|
#
|
|
290
290
|
# ```python sync
|
|
291
|
-
# a_handle =
|
|
292
|
-
# result_handle =
|
|
291
|
+
# a_handle = frame.evaluate_handle("document.body")
|
|
292
|
+
# result_handle = frame.evaluate_handle("body => body.innerHTML", a_handle)
|
|
293
293
|
# print(result_handle.json_value())
|
|
294
294
|
# result_handle.dispose()
|
|
295
295
|
# ```
|
|
@@ -454,6 +454,7 @@ module Playwright
|
|
|
454
454
|
def get_by_role(
|
|
455
455
|
role,
|
|
456
456
|
checked: nil,
|
|
457
|
+
description: nil,
|
|
457
458
|
disabled: nil,
|
|
458
459
|
exact: nil,
|
|
459
460
|
expanded: nil,
|
|
@@ -462,7 +463,7 @@ module Playwright
|
|
|
462
463
|
name: nil,
|
|
463
464
|
pressed: nil,
|
|
464
465
|
selected: nil)
|
|
465
|
-
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
466
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), description: unwrap_impl(description), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
466
467
|
end
|
|
467
468
|
|
|
468
469
|
#
|
|
@@ -1041,24 +1042,28 @@ module Playwright
|
|
|
1041
1042
|
end
|
|
1042
1043
|
|
|
1043
1044
|
# @nodoc
|
|
1044
|
-
def
|
|
1045
|
-
wrap_impl(@impl.
|
|
1045
|
+
def drop(selector, payload, position: nil, strict: nil, timeout: nil)
|
|
1046
|
+
wrap_impl(@impl.drop(unwrap_impl(selector), unwrap_impl(payload), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
|
1046
1047
|
end
|
|
1047
1048
|
|
|
1048
1049
|
# @nodoc
|
|
1049
|
-
def
|
|
1050
|
-
wrap_impl(@impl.
|
|
1050
|
+
def detached=(req)
|
|
1051
|
+
wrap_impl(@impl.detached=(unwrap_impl(req)))
|
|
1051
1052
|
end
|
|
1052
1053
|
|
|
1053
1054
|
# @nodoc
|
|
1054
|
-
def
|
|
1055
|
-
wrap_impl(@impl.
|
|
1055
|
+
def highlight(selector, style: nil)
|
|
1056
|
+
wrap_impl(@impl.highlight(unwrap_impl(selector), style: unwrap_impl(style)))
|
|
1056
1057
|
end
|
|
1057
1058
|
|
|
1058
|
-
# -- inherited from EventEmitter --
|
|
1059
1059
|
# @nodoc
|
|
1060
|
-
def
|
|
1061
|
-
|
|
1060
|
+
def hide_highlight(selector)
|
|
1061
|
+
wrap_impl(@impl.hide_highlight(unwrap_impl(selector)))
|
|
1062
|
+
end
|
|
1063
|
+
|
|
1064
|
+
# @nodoc
|
|
1065
|
+
def expect(selector, expression, options, title)
|
|
1066
|
+
wrap_impl(@impl.expect(unwrap_impl(selector), unwrap_impl(expression), unwrap_impl(options), unwrap_impl(title)))
|
|
1062
1067
|
end
|
|
1063
1068
|
|
|
1064
1069
|
# -- inherited from EventEmitter --
|
|
@@ -1073,6 +1078,12 @@ module Playwright
|
|
|
1073
1078
|
event_emitter_proxy.once(event, callback)
|
|
1074
1079
|
end
|
|
1075
1080
|
|
|
1081
|
+
# -- inherited from EventEmitter --
|
|
1082
|
+
# @nodoc
|
|
1083
|
+
def on(event, callback)
|
|
1084
|
+
event_emitter_proxy.on(event, callback)
|
|
1085
|
+
end
|
|
1086
|
+
|
|
1076
1087
|
private def event_emitter_proxy
|
|
1077
1088
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
1078
1089
|
end
|
|
@@ -136,6 +136,7 @@ module Playwright
|
|
|
136
136
|
def get_by_role(
|
|
137
137
|
role,
|
|
138
138
|
checked: nil,
|
|
139
|
+
description: nil,
|
|
139
140
|
disabled: nil,
|
|
140
141
|
exact: nil,
|
|
141
142
|
expanded: nil,
|
|
@@ -144,7 +145,7 @@ module Playwright
|
|
|
144
145
|
name: nil,
|
|
145
146
|
pressed: nil,
|
|
146
147
|
selected: nil)
|
|
147
|
-
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
148
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), description: unwrap_impl(description), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
148
149
|
end
|
|
149
150
|
|
|
150
151
|
#
|
|
@@ -98,12 +98,6 @@ module Playwright
|
|
|
98
98
|
wrap_impl(@impl.to_s)
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
# -- inherited from EventEmitter --
|
|
102
|
-
# @nodoc
|
|
103
|
-
def on(event, callback)
|
|
104
|
-
event_emitter_proxy.on(event, callback)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
101
|
# -- inherited from EventEmitter --
|
|
108
102
|
# @nodoc
|
|
109
103
|
def off(event, callback)
|
|
@@ -116,6 +110,12 @@ module Playwright
|
|
|
116
110
|
event_emitter_proxy.once(event, callback)
|
|
117
111
|
end
|
|
118
112
|
|
|
113
|
+
# -- inherited from EventEmitter --
|
|
114
|
+
# @nodoc
|
|
115
|
+
def on(event, callback)
|
|
116
|
+
event_emitter_proxy.on(event, callback)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
119
|
private def event_emitter_proxy
|
|
120
120
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
121
121
|
end
|
|
@@ -106,8 +106,8 @@ module Playwright
|
|
|
106
106
|
#
|
|
107
107
|
# An AI-optimized snapshot, controlled by `mode`, is different from a default snapshot:
|
|
108
108
|
# 1. Includes element references `[ref=e2]`. 2. Does not wait for an element matching the locator, and throws when no elements match. 3. Includes snapshots of `<iframe>`s inside the target.
|
|
109
|
-
def aria_snapshot(depth: nil, mode: nil, timeout: nil)
|
|
110
|
-
wrap_impl(@impl.aria_snapshot(depth: unwrap_impl(depth), mode: unwrap_impl(mode), timeout: unwrap_impl(timeout)))
|
|
109
|
+
def aria_snapshot(boxes: nil, depth: nil, mode: nil, timeout: nil)
|
|
110
|
+
wrap_impl(@impl.aria_snapshot(boxes: unwrap_impl(boxes), depth: unwrap_impl(depth), mode: unwrap_impl(mode), timeout: unwrap_impl(timeout)))
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
#
|
|
@@ -386,6 +386,28 @@ module Playwright
|
|
|
386
386
|
wrap_impl(@impl.drag_to(unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
387
387
|
end
|
|
388
388
|
|
|
389
|
+
#
|
|
390
|
+
# Simulate an external drag-and-drop of files or clipboard-like data onto this locator.
|
|
391
|
+
#
|
|
392
|
+
# **Details**
|
|
393
|
+
#
|
|
394
|
+
# Dispatches the native `dragenter`, `dragover`, and `drop` events at the center of the
|
|
395
|
+
# target element with a synthetic [DataTransfer] carrying the provided files and/or data
|
|
396
|
+
# entries. Works cross-browser by constructing the [DataTransfer] in the page context.
|
|
397
|
+
#
|
|
398
|
+
# If the target element's `dragover` listener does not call `preventDefault()`, the target
|
|
399
|
+
# is considered to have rejected the drop: Playwright dispatches `dragleave` and this
|
|
400
|
+
# method throws.
|
|
401
|
+
#
|
|
402
|
+
# **Usage**
|
|
403
|
+
#
|
|
404
|
+
# Drop a file buffer onto an upload area:
|
|
405
|
+
#
|
|
406
|
+
# Drop plain text and a URL together:
|
|
407
|
+
def drop(payload, position: nil, timeout: nil)
|
|
408
|
+
wrap_impl(@impl.drop(unwrap_impl(payload), position: unwrap_impl(position), timeout: unwrap_impl(timeout)))
|
|
409
|
+
end
|
|
410
|
+
|
|
389
411
|
#
|
|
390
412
|
# Resolves given locator to the first matching DOM element. If there are no matching elements, waits for one. If multiple elements match the locator, throws.
|
|
391
413
|
def element_handle(timeout: nil)
|
|
@@ -649,6 +671,7 @@ module Playwright
|
|
|
649
671
|
def get_by_role(
|
|
650
672
|
role,
|
|
651
673
|
checked: nil,
|
|
674
|
+
description: nil,
|
|
652
675
|
disabled: nil,
|
|
653
676
|
exact: nil,
|
|
654
677
|
expanded: nil,
|
|
@@ -657,7 +680,7 @@ module Playwright
|
|
|
657
680
|
name: nil,
|
|
658
681
|
pressed: nil,
|
|
659
682
|
selected: nil)
|
|
660
|
-
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
683
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), description: unwrap_impl(description), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
661
684
|
end
|
|
662
685
|
|
|
663
686
|
#
|
|
@@ -747,10 +770,16 @@ module Playwright
|
|
|
747
770
|
wrap_impl(@impl.get_by_title(unwrap_impl(text), exact: unwrap_impl(exact)))
|
|
748
771
|
end
|
|
749
772
|
|
|
773
|
+
#
|
|
774
|
+
# Hides the element highlight previously added by [`method: Locator.highlight`].
|
|
775
|
+
def hide_highlight
|
|
776
|
+
wrap_impl(@impl.hide_highlight)
|
|
777
|
+
end
|
|
778
|
+
|
|
750
779
|
#
|
|
751
780
|
# Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses [`method: Locator.highlight`].
|
|
752
|
-
def highlight
|
|
753
|
-
wrap_impl(@impl.highlight)
|
|
781
|
+
def highlight(style: nil)
|
|
782
|
+
wrap_impl(@impl.highlight(style: unwrap_impl(style)))
|
|
754
783
|
end
|
|
755
784
|
|
|
756
785
|
#
|
|
@@ -1296,6 +1325,11 @@ module Playwright
|
|
|
1296
1325
|
wrap_impl(@impl.wait_for(state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
|
|
1297
1326
|
end
|
|
1298
1327
|
|
|
1328
|
+
# @nodoc
|
|
1329
|
+
def _assertions(timeout, is_not, message)
|
|
1330
|
+
wrap_impl(@impl._assertions(unwrap_impl(timeout), unwrap_impl(is_not), unwrap_impl(message)))
|
|
1331
|
+
end
|
|
1332
|
+
|
|
1299
1333
|
# @nodoc
|
|
1300
1334
|
def resolve_selector
|
|
1301
1335
|
wrap_impl(@impl.resolve_selector)
|
|
@@ -1306,11 +1340,6 @@ module Playwright
|
|
|
1306
1340
|
wrap_impl(@impl.expect(unwrap_impl(expression), unwrap_impl(options), unwrap_impl(title)))
|
|
1307
1341
|
end
|
|
1308
1342
|
|
|
1309
|
-
# @nodoc
|
|
1310
|
-
def _assertions(timeout, is_not, message)
|
|
1311
|
-
wrap_impl(@impl._assertions(unwrap_impl(timeout), unwrap_impl(is_not), unwrap_impl(message)))
|
|
1312
|
-
end
|
|
1313
|
-
|
|
1314
1343
|
# @nodoc
|
|
1315
1344
|
def to_s
|
|
1316
1345
|
wrap_impl(@impl.to_s)
|
|
@@ -537,8 +537,8 @@ module Playwright
|
|
|
537
537
|
# locator = page.get_by_role("button")
|
|
538
538
|
# expect(locator).to_have_css("display", "flex")
|
|
539
539
|
# ```
|
|
540
|
-
def to_have_css(name, value, timeout: nil)
|
|
541
|
-
wrap_impl(@impl.to_have_css(unwrap_impl(name), unwrap_impl(value), timeout: unwrap_impl(timeout)))
|
|
540
|
+
def to_have_css(name, value, pseudo: nil, timeout: nil)
|
|
541
|
+
wrap_impl(@impl.to_have_css(unwrap_impl(name), unwrap_impl(value), pseudo: unwrap_impl(pseudo), timeout: unwrap_impl(timeout)))
|
|
542
542
|
end
|
|
543
543
|
|
|
544
544
|
#
|
data/lib/playwright_api/page.rb
CHANGED
|
@@ -53,6 +53,18 @@ module Playwright
|
|
|
53
53
|
wrap_impl(@impl.keyboard)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
#
|
|
57
|
+
# Provides access to the page's `localStorage` for the current origin. See `WebStorage`.
|
|
58
|
+
def local_storage # property
|
|
59
|
+
wrap_impl(@impl.local_storage)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
#
|
|
63
|
+
# Provides access to the page's `sessionStorage` for the current origin. See `WebStorage`.
|
|
64
|
+
def session_storage # property
|
|
65
|
+
wrap_impl(@impl.session_storage)
|
|
66
|
+
end
|
|
67
|
+
|
|
56
68
|
def mouse # property
|
|
57
69
|
wrap_impl(@impl.mouse)
|
|
58
70
|
end
|
|
@@ -402,7 +414,7 @@ module Playwright
|
|
|
402
414
|
# `ElementHandle` instances can be passed as an argument to the [`method: Page.evaluate`]:
|
|
403
415
|
#
|
|
404
416
|
# ```python sync
|
|
405
|
-
# body_handle = page.
|
|
417
|
+
# body_handle = page.evaluate_handle("document.body")
|
|
406
418
|
# html = page.evaluate("([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
|
|
407
419
|
# body_handle.dispose()
|
|
408
420
|
# ```
|
|
@@ -482,8 +494,8 @@ module Playwright
|
|
|
482
494
|
# with sync_playwright() as playwright:
|
|
483
495
|
# run(playwright)
|
|
484
496
|
# ```
|
|
485
|
-
def expose_binding(name, callback
|
|
486
|
-
wrap_impl(@impl.expose_binding(unwrap_impl(name), unwrap_impl(callback)
|
|
497
|
+
def expose_binding(name, callback)
|
|
498
|
+
wrap_impl(@impl.expose_binding(unwrap_impl(name), unwrap_impl(callback)))
|
|
487
499
|
end
|
|
488
500
|
|
|
489
501
|
#
|
|
@@ -694,6 +706,7 @@ module Playwright
|
|
|
694
706
|
def get_by_role(
|
|
695
707
|
role,
|
|
696
708
|
checked: nil,
|
|
709
|
+
description: nil,
|
|
697
710
|
disabled: nil,
|
|
698
711
|
exact: nil,
|
|
699
712
|
expanded: nil,
|
|
@@ -702,7 +715,7 @@ module Playwright
|
|
|
702
715
|
name: nil,
|
|
703
716
|
pressed: nil,
|
|
704
717
|
selected: nil)
|
|
705
|
-
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
718
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), description: unwrap_impl(description), disabled: unwrap_impl(disabled), exact: unwrap_impl(exact), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
|
706
719
|
end
|
|
707
720
|
|
|
708
721
|
#
|
|
@@ -851,6 +864,12 @@ module Playwright
|
|
|
851
864
|
wrap_impl(@impl.goto(unwrap_impl(url), referer: unwrap_impl(referer), timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
|
852
865
|
end
|
|
853
866
|
|
|
867
|
+
#
|
|
868
|
+
# Hide all locator highlight overlays previously added by [`method: Locator.highlight`] on this page.
|
|
869
|
+
def hide_highlight
|
|
870
|
+
wrap_impl(@impl.hide_highlight)
|
|
871
|
+
end
|
|
872
|
+
|
|
854
873
|
#
|
|
855
874
|
# This method hovers over an element matching `selector` by performing the following steps:
|
|
856
875
|
# 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
|
|
@@ -1474,8 +1493,8 @@ module Playwright
|
|
|
1474
1493
|
|
|
1475
1494
|
#
|
|
1476
1495
|
# Captures the aria snapshot of the page. Read more about [aria snapshots](../aria-snapshots.md).
|
|
1477
|
-
def aria_snapshot(depth: nil, mode: nil, timeout: nil)
|
|
1478
|
-
wrap_impl(@impl.aria_snapshot(depth: unwrap_impl(depth), mode: unwrap_impl(mode), timeout: unwrap_impl(timeout)))
|
|
1496
|
+
def aria_snapshot(boxes: nil, depth: nil, mode: nil, timeout: nil)
|
|
1497
|
+
wrap_impl(@impl.aria_snapshot(boxes: unwrap_impl(boxes), depth: unwrap_impl(depth), mode: unwrap_impl(mode), timeout: unwrap_impl(timeout)))
|
|
1479
1498
|
end
|
|
1480
1499
|
|
|
1481
1500
|
#
|
|
@@ -1488,7 +1507,7 @@ module Playwright
|
|
|
1488
1507
|
# When all steps combined have not finished during the specified `timeout`, this method throws a
|
|
1489
1508
|
# `TimeoutError`. Passing zero timeout disables this.
|
|
1490
1509
|
#
|
|
1491
|
-
# **NOTE**: [`method: Page.tap`]
|
|
1510
|
+
# **NOTE**: [`method: Page.tap`] will throw if the `hasTouch` option of the browser context is false.
|
|
1492
1511
|
def tap_point(
|
|
1493
1512
|
selector,
|
|
1494
1513
|
force: nil,
|
|
@@ -1862,18 +1881,18 @@ module Playwright
|
|
|
1862
1881
|
end
|
|
1863
1882
|
|
|
1864
1883
|
# @nodoc
|
|
1865
|
-
def
|
|
1866
|
-
wrap_impl(@impl.
|
|
1884
|
+
def _assertions(timeout, is_not, message)
|
|
1885
|
+
wrap_impl(@impl._assertions(unwrap_impl(timeout), unwrap_impl(is_not), unwrap_impl(message)))
|
|
1867
1886
|
end
|
|
1868
1887
|
|
|
1869
1888
|
# @nodoc
|
|
1870
|
-
def
|
|
1871
|
-
wrap_impl(@impl.
|
|
1889
|
+
def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
|
1890
|
+
wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
|
1872
1891
|
end
|
|
1873
1892
|
|
|
1874
1893
|
# @nodoc
|
|
1875
|
-
def
|
|
1876
|
-
wrap_impl(@impl.
|
|
1894
|
+
def snapshot_for_ai(timeout: nil, depth: nil, boxes: nil, _track: nil)
|
|
1895
|
+
wrap_impl(@impl.snapshot_for_ai(timeout: unwrap_impl(timeout), depth: unwrap_impl(depth), boxes: unwrap_impl(boxes), _track: unwrap_impl(_track)))
|
|
1877
1896
|
end
|
|
1878
1897
|
|
|
1879
1898
|
# @nodoc
|
|
@@ -1882,8 +1901,8 @@ module Playwright
|
|
|
1882
1901
|
end
|
|
1883
1902
|
|
|
1884
1903
|
# @nodoc
|
|
1885
|
-
def
|
|
1886
|
-
wrap_impl(@impl.
|
|
1904
|
+
def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
|
1905
|
+
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
|
1887
1906
|
end
|
|
1888
1907
|
|
|
1889
1908
|
# @nodoc
|
|
@@ -1892,19 +1911,13 @@ module Playwright
|
|
|
1892
1911
|
end
|
|
1893
1912
|
|
|
1894
1913
|
# @nodoc
|
|
1895
|
-
def
|
|
1896
|
-
wrap_impl(@impl.
|
|
1897
|
-
end
|
|
1898
|
-
|
|
1899
|
-
# @nodoc
|
|
1900
|
-
def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
|
1901
|
-
wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
|
1914
|
+
def guid
|
|
1915
|
+
wrap_impl(@impl.guid)
|
|
1902
1916
|
end
|
|
1903
1917
|
|
|
1904
|
-
# -- inherited from EventEmitter --
|
|
1905
1918
|
# @nodoc
|
|
1906
|
-
def
|
|
1907
|
-
|
|
1919
|
+
def owned_context=(req)
|
|
1920
|
+
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
|
1908
1921
|
end
|
|
1909
1922
|
|
|
1910
1923
|
# -- inherited from EventEmitter --
|
|
@@ -1919,6 +1932,12 @@ module Playwright
|
|
|
1919
1932
|
event_emitter_proxy.once(event, callback)
|
|
1920
1933
|
end
|
|
1921
1934
|
|
|
1935
|
+
# -- inherited from EventEmitter --
|
|
1936
|
+
# @nodoc
|
|
1937
|
+
def on(event, callback)
|
|
1938
|
+
event_emitter_proxy.on(event, callback)
|
|
1939
|
+
end
|
|
1940
|
+
|
|
1922
1941
|
private def event_emitter_proxy
|
|
1923
1942
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
1924
1943
|
end
|
|
@@ -25,6 +25,28 @@ module Playwright
|
|
|
25
25
|
wrap_impl(@impl.not_to_have_url(unwrap_impl(urlOrRegExp), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
#
|
|
29
|
+
# Asserts that the page body matches the given [accessibility snapshot](../aria-snapshots.md).
|
|
30
|
+
#
|
|
31
|
+
# **Usage**
|
|
32
|
+
#
|
|
33
|
+
# ```python sync
|
|
34
|
+
# page.goto("https://demo.playwright.dev/todomvc/")
|
|
35
|
+
# expect(page).to_match_aria_snapshot('''
|
|
36
|
+
# - heading "todos"
|
|
37
|
+
# - textbox "What needs to be done?"
|
|
38
|
+
# ''')
|
|
39
|
+
# ```
|
|
40
|
+
def to_match_aria_snapshot(expected, timeout: nil)
|
|
41
|
+
wrap_impl(@impl.to_match_aria_snapshot(unwrap_impl(expected), timeout: unwrap_impl(timeout)))
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# The opposite of [`method: PageAssertions.toMatchAriaSnapshot`].
|
|
46
|
+
def not_to_match_aria_snapshot(expected, timeout: nil)
|
|
47
|
+
wrap_impl(@impl.not_to_match_aria_snapshot(unwrap_impl(expected), timeout: unwrap_impl(timeout)))
|
|
48
|
+
end
|
|
49
|
+
|
|
28
50
|
#
|
|
29
51
|
# Ensures the page has the given title.
|
|
30
52
|
#
|
|
@@ -57,7 +57,7 @@ module Playwright
|
|
|
57
57
|
#
|
|
58
58
|
# Exposes API that can be used for the Web API testing.
|
|
59
59
|
def request # property
|
|
60
|
-
|
|
60
|
+
wrap_impl(@impl.request)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
#
|
|
@@ -103,12 +103,6 @@ module Playwright
|
|
|
103
103
|
wrap_impl(@impl.electron)
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
# -- inherited from EventEmitter --
|
|
107
|
-
# @nodoc
|
|
108
|
-
def on(event, callback)
|
|
109
|
-
event_emitter_proxy.on(event, callback)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
106
|
# -- inherited from EventEmitter --
|
|
113
107
|
# @nodoc
|
|
114
108
|
def off(event, callback)
|
|
@@ -121,6 +115,12 @@ module Playwright
|
|
|
121
115
|
event_emitter_proxy.once(event, callback)
|
|
122
116
|
end
|
|
123
117
|
|
|
118
|
+
# -- inherited from EventEmitter --
|
|
119
|
+
# @nodoc
|
|
120
|
+
def on(event, callback)
|
|
121
|
+
event_emitter_proxy.on(event, callback)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
124
|
private def event_emitter_proxy
|
|
125
125
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
126
126
|
end
|
|
@@ -217,20 +217,14 @@ module Playwright
|
|
|
217
217
|
wrap_impl(@impl.url)
|
|
218
218
|
end
|
|
219
219
|
|
|
220
|
-
# @nodoc
|
|
221
|
-
def apply_fallback_overrides(overrides)
|
|
222
|
-
wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
|
|
223
|
-
end
|
|
224
|
-
|
|
225
220
|
# @nodoc
|
|
226
221
|
def header_values(name)
|
|
227
222
|
wrap_impl(@impl.header_values(unwrap_impl(name)))
|
|
228
223
|
end
|
|
229
224
|
|
|
230
|
-
# -- inherited from EventEmitter --
|
|
231
225
|
# @nodoc
|
|
232
|
-
def
|
|
233
|
-
|
|
226
|
+
def apply_fallback_overrides(overrides)
|
|
227
|
+
wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
|
|
234
228
|
end
|
|
235
229
|
|
|
236
230
|
# -- inherited from EventEmitter --
|
|
@@ -245,6 +239,12 @@ module Playwright
|
|
|
245
239
|
event_emitter_proxy.once(event, callback)
|
|
246
240
|
end
|
|
247
241
|
|
|
242
|
+
# -- inherited from EventEmitter --
|
|
243
|
+
# @nodoc
|
|
244
|
+
def on(event, callback)
|
|
245
|
+
event_emitter_proxy.on(event, callback)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
248
|
private def event_emitter_proxy
|
|
249
249
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
250
250
|
end
|
|
@@ -133,12 +133,6 @@ module Playwright
|
|
|
133
133
|
wrap_impl(@impl.from_service_worker?)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
# -- inherited from EventEmitter --
|
|
137
|
-
# @nodoc
|
|
138
|
-
def on(event, callback)
|
|
139
|
-
event_emitter_proxy.on(event, callback)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
136
|
# -- inherited from EventEmitter --
|
|
143
137
|
# @nodoc
|
|
144
138
|
def off(event, callback)
|
|
@@ -151,6 +145,12 @@ module Playwright
|
|
|
151
145
|
event_emitter_proxy.once(event, callback)
|
|
152
146
|
end
|
|
153
147
|
|
|
148
|
+
# -- inherited from EventEmitter --
|
|
149
|
+
# @nodoc
|
|
150
|
+
def on(event, callback)
|
|
151
|
+
event_emitter_proxy.on(event, callback)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
154
|
private def event_emitter_proxy
|
|
155
155
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
156
156
|
end
|
data/lib/playwright_api/route.rb
CHANGED
|
@@ -177,12 +177,6 @@ module Playwright
|
|
|
177
177
|
wrap_impl(@impl.redirect_navigation_request(unwrap_impl(url)))
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
-
# -- inherited from EventEmitter --
|
|
181
|
-
# @nodoc
|
|
182
|
-
def on(event, callback)
|
|
183
|
-
event_emitter_proxy.on(event, callback)
|
|
184
|
-
end
|
|
185
|
-
|
|
186
180
|
# -- inherited from EventEmitter --
|
|
187
181
|
# @nodoc
|
|
188
182
|
def off(event, callback)
|
|
@@ -195,6 +189,12 @@ module Playwright
|
|
|
195
189
|
event_emitter_proxy.once(event, callback)
|
|
196
190
|
end
|
|
197
191
|
|
|
192
|
+
# -- inherited from EventEmitter --
|
|
193
|
+
# @nodoc
|
|
194
|
+
def on(event, callback)
|
|
195
|
+
event_emitter_proxy.on(event, callback)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
198
|
private def event_emitter_proxy
|
|
199
199
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
200
200
|
end
|
|
@@ -9,7 +9,7 @@ module Playwright
|
|
|
9
9
|
#
|
|
10
10
|
# Dispatches a `touchstart` and `touchend` event with a single touch at the position (`x`,`y`).
|
|
11
11
|
#
|
|
12
|
-
# **NOTE**: [`method:
|
|
12
|
+
# **NOTE**: [`method: Touchscreen.tap`] will throw if the `hasTouch` option of the browser context is false.
|
|
13
13
|
def tap_point(x, y)
|
|
14
14
|
wrap_impl(@impl.tap_point(unwrap_impl(x), unwrap_impl(y)))
|
|
15
15
|
end
|
|
@@ -67,6 +67,23 @@ module Playwright
|
|
|
67
67
|
wrap_impl(@impl.start_chunk(name: unwrap_impl(name), title: unwrap_impl(title)))
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
+
#
|
|
71
|
+
# Start recording a HAR (HTTP Archive) of network activity in this context. The HAR file is written to disk when [`method: Tracing.stopHar`] is called, or when the returned `Disposable` is disposed.
|
|
72
|
+
#
|
|
73
|
+
# Only one HAR recording can be active at a time per `BrowserContext`.
|
|
74
|
+
#
|
|
75
|
+
# **Usage**
|
|
76
|
+
#
|
|
77
|
+
# ```python sync
|
|
78
|
+
# context.tracing.start_har("trace.har")
|
|
79
|
+
# page = context.new_page()
|
|
80
|
+
# page.goto("https://playwright.dev")
|
|
81
|
+
# context.tracing.stop_har()
|
|
82
|
+
# ```
|
|
83
|
+
def start_har(path, content: nil, mode: nil, urlFilter: nil)
|
|
84
|
+
wrap_impl(@impl.start_har(unwrap_impl(path), content: unwrap_impl(content), mode: unwrap_impl(mode), urlFilter: unwrap_impl(urlFilter)))
|
|
85
|
+
end
|
|
86
|
+
|
|
70
87
|
#
|
|
71
88
|
# **NOTE**: Use `test.step` instead when available.
|
|
72
89
|
#
|
|
@@ -104,10 +121,10 @@ module Playwright
|
|
|
104
121
|
wrap_impl(@impl.stop_chunk(path: unwrap_impl(path)))
|
|
105
122
|
end
|
|
106
123
|
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
def
|
|
110
|
-
|
|
124
|
+
#
|
|
125
|
+
# Stop HAR recording and save the HAR file to the path given to [`method: Tracing.startHar`].
|
|
126
|
+
def stop_har
|
|
127
|
+
wrap_impl(@impl.stop_har)
|
|
111
128
|
end
|
|
112
129
|
|
|
113
130
|
# -- inherited from EventEmitter --
|
|
@@ -122,6 +139,12 @@ module Playwright
|
|
|
122
139
|
event_emitter_proxy.once(event, callback)
|
|
123
140
|
end
|
|
124
141
|
|
|
142
|
+
# -- inherited from EventEmitter --
|
|
143
|
+
# @nodoc
|
|
144
|
+
def on(event, callback)
|
|
145
|
+
event_emitter_proxy.on(event, callback)
|
|
146
|
+
end
|
|
147
|
+
|
|
125
148
|
private def event_emitter_proxy
|
|
126
149
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
127
150
|
end
|