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.
- checksums.yaml +4 -4
- data/documentation/docs/api/console_message.md +9 -0
- data/documentation/docs/api/element_handle.md +2 -0
- data/documentation/docs/api/frame.md +1 -0
- data/documentation/docs/api/locator.md +22 -0
- data/documentation/docs/api/page.md +1 -2
- data/documentation/docs/api/worker.md +20 -0
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +19 -0
- data/documentation/docs/article/guides/rails_integration.md +43 -2
- data/documentation/docs/include/api_coverage.md +3 -5
- data/documentation/package.json +2 -2
- data/documentation/yarn.lock +9003 -12370
- data/lib/playwright/channel_owners/api_request_context.rb +24 -2
- data/lib/playwright/channel_owners/browser_context.rb +5 -2
- data/lib/playwright/channel_owners/element_handle.rb +6 -2
- data/lib/playwright/channel_owners/frame.rb +9 -3
- data/lib/playwright/channel_owners/page.rb +30 -10
- data/lib/playwright/channel_owners/worker.rb +19 -0
- data/lib/playwright/console_message_impl.rb +3 -4
- data/lib/playwright/events.rb +1 -0
- data/lib/playwright/locator_impl.rb +25 -5
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright/web_socket_transport.rb +1 -1
- data/lib/playwright.rb +4 -0
- data/lib/playwright_api/android.rb +4 -4
- data/lib/playwright_api/android_device.rb +4 -4
- data/lib/playwright_api/api_request_context.rb +4 -4
- data/lib/playwright_api/browser.rb +4 -4
- data/lib/playwright_api/browser_context.rb +4 -4
- data/lib/playwright_api/browser_type.rb +4 -4
- data/lib/playwright_api/cdp_session.rb +4 -4
- data/lib/playwright_api/console_message.rb +6 -0
- data/lib/playwright_api/dialog.rb +4 -4
- data/lib/playwright_api/element_handle.rb +8 -6
- data/lib/playwright_api/frame.rb +6 -5
- data/lib/playwright_api/js_handle.rb +4 -4
- data/lib/playwright_api/locator.rb +22 -3
- data/lib/playwright_api/page.rb +15 -18
- data/lib/playwright_api/playwright.rb +4 -4
- data/lib/playwright_api/request.rb +4 -4
- data/lib/playwright_api/response.rb +8 -8
- data/lib/playwright_api/route.rb +4 -4
- data/lib/playwright_api/tracing.rb +4 -4
- data/lib/playwright_api/web_socket.rb +4 -4
- data/lib/playwright_api/worker.rb +21 -4
- data/playwright.gemspec +2 -0
- data/sig/playwright.rbs +10 -12
- metadata +30 -5
- data/documentation/docs/api/accessibility.md +0 -66
- data/lib/playwright/accessibility_impl.rb +0 -50
- data/lib/playwright_api/accessibility.rb +0 -57
data/lib/playwright_api/frame.rb
CHANGED
|
@@ -180,11 +180,12 @@ module Playwright
|
|
|
180
180
|
force: nil,
|
|
181
181
|
noWaitAfter: nil,
|
|
182
182
|
sourcePosition: nil,
|
|
183
|
+
steps: nil,
|
|
183
184
|
strict: nil,
|
|
184
185
|
targetPosition: nil,
|
|
185
186
|
timeout: nil,
|
|
186
187
|
trial: nil)
|
|
187
|
-
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
188
|
+
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
188
189
|
end
|
|
189
190
|
|
|
190
191
|
#
|
|
@@ -1056,8 +1057,8 @@ module Playwright
|
|
|
1056
1057
|
|
|
1057
1058
|
# -- inherited from EventEmitter --
|
|
1058
1059
|
# @nodoc
|
|
1059
|
-
def
|
|
1060
|
-
event_emitter_proxy.
|
|
1060
|
+
def off(event, callback)
|
|
1061
|
+
event_emitter_proxy.off(event, callback)
|
|
1061
1062
|
end
|
|
1062
1063
|
|
|
1063
1064
|
# -- inherited from EventEmitter --
|
|
@@ -1068,8 +1069,8 @@ module Playwright
|
|
|
1068
1069
|
|
|
1069
1070
|
# -- inherited from EventEmitter --
|
|
1070
1071
|
# @nodoc
|
|
1071
|
-
def
|
|
1072
|
-
event_emitter_proxy.
|
|
1072
|
+
def once(event, callback)
|
|
1073
|
+
event_emitter_proxy.once(event, callback)
|
|
1073
1074
|
end
|
|
1074
1075
|
|
|
1075
1076
|
private def event_emitter_proxy
|
|
@@ -100,8 +100,8 @@ module Playwright
|
|
|
100
100
|
|
|
101
101
|
# -- inherited from EventEmitter --
|
|
102
102
|
# @nodoc
|
|
103
|
-
def
|
|
104
|
-
event_emitter_proxy.
|
|
103
|
+
def off(event, callback)
|
|
104
|
+
event_emitter_proxy.off(event, callback)
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
# -- inherited from EventEmitter --
|
|
@@ -112,8 +112,8 @@ module Playwright
|
|
|
112
112
|
|
|
113
113
|
# -- inherited from EventEmitter --
|
|
114
114
|
# @nodoc
|
|
115
|
-
def
|
|
116
|
-
event_emitter_proxy.
|
|
115
|
+
def once(event, callback)
|
|
116
|
+
event_emitter_proxy.once(event, callback)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
private def event_emitter_proxy
|
|
@@ -227,9 +227,10 @@ module Playwright
|
|
|
227
227
|
modifiers: nil,
|
|
228
228
|
noWaitAfter: nil,
|
|
229
229
|
position: nil,
|
|
230
|
+
steps: nil,
|
|
230
231
|
timeout: nil,
|
|
231
232
|
trial: nil)
|
|
232
|
-
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)))
|
|
233
|
+
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)))
|
|
233
234
|
end
|
|
234
235
|
|
|
235
236
|
#
|
|
@@ -269,9 +270,10 @@ module Playwright
|
|
|
269
270
|
modifiers: nil,
|
|
270
271
|
noWaitAfter: nil,
|
|
271
272
|
position: nil,
|
|
273
|
+
steps: nil,
|
|
272
274
|
timeout: nil,
|
|
273
275
|
trial: nil)
|
|
274
|
-
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)))
|
|
276
|
+
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)))
|
|
275
277
|
end
|
|
276
278
|
|
|
277
279
|
#
|
|
@@ -288,6 +290,22 @@ module Playwright
|
|
|
288
290
|
wrap_impl(@impl.describe(unwrap_impl(description)))
|
|
289
291
|
end
|
|
290
292
|
|
|
293
|
+
#
|
|
294
|
+
# Returns locator description previously set with [`method: Locator.describe`]. Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available.
|
|
295
|
+
#
|
|
296
|
+
# **Usage**
|
|
297
|
+
#
|
|
298
|
+
# ```python sync
|
|
299
|
+
# button = page.get_by_role("button").describe("Subscribe button")
|
|
300
|
+
# print(button.description()) # "Subscribe button"
|
|
301
|
+
#
|
|
302
|
+
# input = page.get_by_role("textbox")
|
|
303
|
+
# print(input.description()) # None
|
|
304
|
+
# ```
|
|
305
|
+
def description
|
|
306
|
+
wrap_impl(@impl.description)
|
|
307
|
+
end
|
|
308
|
+
|
|
291
309
|
#
|
|
292
310
|
# Programmatically dispatch an event on the matching element.
|
|
293
311
|
#
|
|
@@ -358,10 +376,11 @@ module Playwright
|
|
|
358
376
|
force: nil,
|
|
359
377
|
noWaitAfter: nil,
|
|
360
378
|
sourcePosition: nil,
|
|
379
|
+
steps: nil,
|
|
361
380
|
targetPosition: nil,
|
|
362
381
|
timeout: nil,
|
|
363
382
|
trial: nil)
|
|
364
|
-
wrap_impl(@impl.drag_to(unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
383
|
+
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)))
|
|
365
384
|
end
|
|
366
385
|
|
|
367
386
|
#
|
data/lib/playwright_api/page.rb
CHANGED
|
@@ -49,10 +49,6 @@ module Playwright
|
|
|
49
49
|
wrap_impl(@impl.clock)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def accessibility # property
|
|
53
|
-
wrap_impl(@impl.accessibility)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
52
|
def keyboard # property
|
|
57
53
|
wrap_impl(@impl.keyboard)
|
|
58
54
|
end
|
|
@@ -278,11 +274,12 @@ module Playwright
|
|
|
278
274
|
force: nil,
|
|
279
275
|
noWaitAfter: nil,
|
|
280
276
|
sourcePosition: nil,
|
|
277
|
+
steps: nil,
|
|
281
278
|
strict: nil,
|
|
282
279
|
targetPosition: nil,
|
|
283
280
|
timeout: nil,
|
|
284
281
|
trial: nil)
|
|
285
|
-
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
282
|
+
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
286
283
|
end
|
|
287
284
|
|
|
288
285
|
#
|
|
@@ -1821,8 +1818,8 @@ module Playwright
|
|
|
1821
1818
|
end
|
|
1822
1819
|
|
|
1823
1820
|
# @nodoc
|
|
1824
|
-
def snapshot_for_ai(timeout: nil)
|
|
1825
|
-
wrap_impl(@impl.snapshot_for_ai(timeout: unwrap_impl(timeout)))
|
|
1821
|
+
def snapshot_for_ai(timeout: nil, mode: nil, track: nil)
|
|
1822
|
+
wrap_impl(@impl.snapshot_for_ai(timeout: unwrap_impl(timeout), mode: unwrap_impl(mode), track: unwrap_impl(track)))
|
|
1826
1823
|
end
|
|
1827
1824
|
|
|
1828
1825
|
# @nodoc
|
|
@@ -1830,19 +1827,14 @@ module Playwright
|
|
|
1830
1827
|
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
|
1831
1828
|
end
|
|
1832
1829
|
|
|
1833
|
-
# @nodoc
|
|
1834
|
-
def stop_js_coverage
|
|
1835
|
-
wrap_impl(@impl.stop_js_coverage)
|
|
1836
|
-
end
|
|
1837
|
-
|
|
1838
1830
|
# @nodoc
|
|
1839
1831
|
def stop_css_coverage
|
|
1840
1832
|
wrap_impl(@impl.stop_css_coverage)
|
|
1841
1833
|
end
|
|
1842
1834
|
|
|
1843
1835
|
# @nodoc
|
|
1844
|
-
def
|
|
1845
|
-
wrap_impl(@impl.
|
|
1836
|
+
def stop_js_coverage
|
|
1837
|
+
wrap_impl(@impl.stop_js_coverage)
|
|
1846
1838
|
end
|
|
1847
1839
|
|
|
1848
1840
|
# @nodoc
|
|
@@ -1850,10 +1842,15 @@ module Playwright
|
|
|
1850
1842
|
wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
|
1851
1843
|
end
|
|
1852
1844
|
|
|
1845
|
+
# @nodoc
|
|
1846
|
+
def owned_context=(req)
|
|
1847
|
+
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
|
1848
|
+
end
|
|
1849
|
+
|
|
1853
1850
|
# -- inherited from EventEmitter --
|
|
1854
1851
|
# @nodoc
|
|
1855
|
-
def
|
|
1856
|
-
event_emitter_proxy.
|
|
1852
|
+
def off(event, callback)
|
|
1853
|
+
event_emitter_proxy.off(event, callback)
|
|
1857
1854
|
end
|
|
1858
1855
|
|
|
1859
1856
|
# -- inherited from EventEmitter --
|
|
@@ -1864,8 +1861,8 @@ module Playwright
|
|
|
1864
1861
|
|
|
1865
1862
|
# -- inherited from EventEmitter --
|
|
1866
1863
|
# @nodoc
|
|
1867
|
-
def
|
|
1868
|
-
event_emitter_proxy.
|
|
1864
|
+
def once(event, callback)
|
|
1865
|
+
event_emitter_proxy.once(event, callback)
|
|
1869
1866
|
end
|
|
1870
1867
|
|
|
1871
1868
|
private def event_emitter_proxy
|
|
@@ -105,8 +105,8 @@ module Playwright
|
|
|
105
105
|
|
|
106
106
|
# -- inherited from EventEmitter --
|
|
107
107
|
# @nodoc
|
|
108
|
-
def
|
|
109
|
-
event_emitter_proxy.
|
|
108
|
+
def off(event, callback)
|
|
109
|
+
event_emitter_proxy.off(event, callback)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
# -- inherited from EventEmitter --
|
|
@@ -117,8 +117,8 @@ module Playwright
|
|
|
117
117
|
|
|
118
118
|
# -- inherited from EventEmitter --
|
|
119
119
|
# @nodoc
|
|
120
|
-
def
|
|
121
|
-
event_emitter_proxy.
|
|
120
|
+
def once(event, callback)
|
|
121
|
+
event_emitter_proxy.once(event, callback)
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
private def event_emitter_proxy
|
|
@@ -207,8 +207,8 @@ module Playwright
|
|
|
207
207
|
|
|
208
208
|
# -- inherited from EventEmitter --
|
|
209
209
|
# @nodoc
|
|
210
|
-
def
|
|
211
|
-
event_emitter_proxy.
|
|
210
|
+
def off(event, callback)
|
|
211
|
+
event_emitter_proxy.off(event, callback)
|
|
212
212
|
end
|
|
213
213
|
|
|
214
214
|
# -- inherited from EventEmitter --
|
|
@@ -219,8 +219,8 @@ module Playwright
|
|
|
219
219
|
|
|
220
220
|
# -- inherited from EventEmitter --
|
|
221
221
|
# @nodoc
|
|
222
|
-
def
|
|
223
|
-
event_emitter_proxy.
|
|
222
|
+
def once(event, callback)
|
|
223
|
+
event_emitter_proxy.once(event, callback)
|
|
224
224
|
end
|
|
225
225
|
|
|
226
226
|
private def event_emitter_proxy
|
|
@@ -118,19 +118,19 @@ module Playwright
|
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
# @nodoc
|
|
121
|
-
def
|
|
122
|
-
wrap_impl(@impl.
|
|
121
|
+
def from_service_worker?
|
|
122
|
+
wrap_impl(@impl.from_service_worker?)
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
# @nodoc
|
|
126
|
-
def
|
|
127
|
-
wrap_impl(@impl.
|
|
126
|
+
def ok?
|
|
127
|
+
wrap_impl(@impl.ok?)
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
# -- inherited from EventEmitter --
|
|
131
131
|
# @nodoc
|
|
132
|
-
def
|
|
133
|
-
event_emitter_proxy.
|
|
132
|
+
def off(event, callback)
|
|
133
|
+
event_emitter_proxy.off(event, callback)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
# -- inherited from EventEmitter --
|
|
@@ -141,8 +141,8 @@ module Playwright
|
|
|
141
141
|
|
|
142
142
|
# -- inherited from EventEmitter --
|
|
143
143
|
# @nodoc
|
|
144
|
-
def
|
|
145
|
-
event_emitter_proxy.
|
|
144
|
+
def once(event, callback)
|
|
145
|
+
event_emitter_proxy.once(event, callback)
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
private def event_emitter_proxy
|
data/lib/playwright_api/route.rb
CHANGED
|
@@ -176,8 +176,8 @@ module Playwright
|
|
|
176
176
|
|
|
177
177
|
# -- inherited from EventEmitter --
|
|
178
178
|
# @nodoc
|
|
179
|
-
def
|
|
180
|
-
event_emitter_proxy.
|
|
179
|
+
def off(event, callback)
|
|
180
|
+
event_emitter_proxy.off(event, callback)
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
# -- inherited from EventEmitter --
|
|
@@ -188,8 +188,8 @@ module Playwright
|
|
|
188
188
|
|
|
189
189
|
# -- inherited from EventEmitter --
|
|
190
190
|
# @nodoc
|
|
191
|
-
def
|
|
192
|
-
event_emitter_proxy.
|
|
191
|
+
def once(event, callback)
|
|
192
|
+
event_emitter_proxy.once(event, callback)
|
|
193
193
|
end
|
|
194
194
|
|
|
195
195
|
private def event_emitter_proxy
|
|
@@ -105,8 +105,8 @@ module Playwright
|
|
|
105
105
|
|
|
106
106
|
# -- inherited from EventEmitter --
|
|
107
107
|
# @nodoc
|
|
108
|
-
def
|
|
109
|
-
event_emitter_proxy.
|
|
108
|
+
def off(event, callback)
|
|
109
|
+
event_emitter_proxy.off(event, callback)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
# -- inherited from EventEmitter --
|
|
@@ -117,8 +117,8 @@ module Playwright
|
|
|
117
117
|
|
|
118
118
|
# -- inherited from EventEmitter --
|
|
119
119
|
# @nodoc
|
|
120
|
-
def
|
|
121
|
-
event_emitter_proxy.
|
|
120
|
+
def once(event, callback)
|
|
121
|
+
event_emitter_proxy.once(event, callback)
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
private def event_emitter_proxy
|
|
@@ -36,8 +36,8 @@ module Playwright
|
|
|
36
36
|
|
|
37
37
|
# -- inherited from EventEmitter --
|
|
38
38
|
# @nodoc
|
|
39
|
-
def
|
|
40
|
-
event_emitter_proxy.
|
|
39
|
+
def off(event, callback)
|
|
40
|
+
event_emitter_proxy.off(event, callback)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
# -- inherited from EventEmitter --
|
|
@@ -48,8 +48,8 @@ module Playwright
|
|
|
48
48
|
|
|
49
49
|
# -- inherited from EventEmitter --
|
|
50
50
|
# @nodoc
|
|
51
|
-
def
|
|
52
|
-
event_emitter_proxy.
|
|
51
|
+
def once(event, callback)
|
|
52
|
+
event_emitter_proxy.once(event, callback)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
private def event_emitter_proxy
|
|
@@ -46,6 +46,23 @@ module Playwright
|
|
|
46
46
|
wrap_impl(@impl.url)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
#
|
|
50
|
+
# Waits for event to fire and passes its value into the predicate function.
|
|
51
|
+
# Returns when the predicate returns truthy value.
|
|
52
|
+
# Will throw an error if the page is closed before the event is fired.
|
|
53
|
+
# Returns the event data value.
|
|
54
|
+
#
|
|
55
|
+
# **Usage**
|
|
56
|
+
#
|
|
57
|
+
# ```python sync
|
|
58
|
+
# with worker.expect_event("console") as event_info:
|
|
59
|
+
# worker.evaluate("console.log(42)")
|
|
60
|
+
# message = event_info.value
|
|
61
|
+
# ```
|
|
62
|
+
def expect_event(event, predicate: nil, timeout: nil, &block)
|
|
63
|
+
wrap_impl(@impl.expect_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
|
64
|
+
end
|
|
65
|
+
|
|
49
66
|
# @nodoc
|
|
50
67
|
def context=(req)
|
|
51
68
|
wrap_impl(@impl.context=(unwrap_impl(req)))
|
|
@@ -58,8 +75,8 @@ module Playwright
|
|
|
58
75
|
|
|
59
76
|
# -- inherited from EventEmitter --
|
|
60
77
|
# @nodoc
|
|
61
|
-
def
|
|
62
|
-
event_emitter_proxy.
|
|
78
|
+
def off(event, callback)
|
|
79
|
+
event_emitter_proxy.off(event, callback)
|
|
63
80
|
end
|
|
64
81
|
|
|
65
82
|
# -- inherited from EventEmitter --
|
|
@@ -70,8 +87,8 @@ module Playwright
|
|
|
70
87
|
|
|
71
88
|
# -- inherited from EventEmitter --
|
|
72
89
|
# @nodoc
|
|
73
|
-
def
|
|
74
|
-
event_emitter_proxy.
|
|
90
|
+
def once(event, callback)
|
|
91
|
+
event_emitter_proxy.once(event, callback)
|
|
75
92
|
end
|
|
76
93
|
|
|
77
94
|
private def event_emitter_proxy
|
data/playwright.gemspec
CHANGED
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.require_paths = ['lib']
|
|
26
26
|
|
|
27
27
|
spec.required_ruby_version = '>= 2.4'
|
|
28
|
+
spec.add_dependency 'base64'
|
|
28
29
|
spec.add_dependency 'concurrent-ruby', '>= 1.1.6'
|
|
29
30
|
spec.add_dependency 'mime-types', '>= 3.0'
|
|
30
31
|
spec.add_development_dependency 'bundler'
|
|
@@ -32,6 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
32
33
|
spec.add_development_dependency 'dry-inflector'
|
|
33
34
|
spec.add_development_dependency 'faye-websocket'
|
|
34
35
|
spec.add_development_dependency 'pry-byebug'
|
|
36
|
+
spec.add_development_dependency 'ostruct'
|
|
35
37
|
spec.add_development_dependency 'puma'
|
|
36
38
|
spec.add_development_dependency 'rack', '< 3'
|
|
37
39
|
spec.add_development_dependency 'rake'
|
data/sig/playwright.rbs
CHANGED
|
@@ -94,9 +94,9 @@ module Playwright
|
|
|
94
94
|
class ElementHandle < JSHandle
|
|
95
95
|
def bounding_box: -> (nil | Hash[untyped, untyped])
|
|
96
96
|
def check: (?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
97
|
-
def click: (?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
97
|
+
def click: (?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?steps: Integer, ?timeout: Float, ?trial: bool) -> void
|
|
98
98
|
def content_frame: -> (nil | Frame)
|
|
99
|
-
def dblclick: (?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
99
|
+
def dblclick: (?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?steps: Integer, ?timeout: Float, ?trial: bool) -> void
|
|
100
100
|
def dispatch_event: (String type_, ?eventInit: untyped) -> void
|
|
101
101
|
def eval_on_selector: (String selector, String expression, ?arg: untyped) -> untyped
|
|
102
102
|
def eval_on_selector_all: (String selector, String expression, ?arg: untyped) -> untyped
|
|
@@ -134,10 +134,6 @@ module Playwright
|
|
|
134
134
|
def wait_for_selector: (String selector, ?state: ("attached" | "detached" | "visible" | "hidden"), ?strict: bool, ?timeout: Float) -> (nil | ElementHandle)
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
-
class Accessibility
|
|
138
|
-
def snapshot: (?interestingOnly: bool, ?root: ElementHandle) -> (nil | Hash[untyped, untyped])
|
|
139
|
-
end
|
|
140
|
-
|
|
141
137
|
class FileChooser
|
|
142
138
|
def element: -> ElementHandle
|
|
143
139
|
def multiple?: -> bool
|
|
@@ -155,7 +151,7 @@ module Playwright
|
|
|
155
151
|
def content: -> String
|
|
156
152
|
def dblclick: (String selector, ?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
|
|
157
153
|
def dispatch_event: (String selector, String type_, ?eventInit: untyped, ?strict: bool, ?timeout: Float) -> void
|
|
158
|
-
def drag_and_drop: (String source, String target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?strict: bool, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
154
|
+
def drag_and_drop: (String source, String target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?steps: Integer, ?strict: bool, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
159
155
|
def eval_on_selector: (String selector, String expression, ?arg: untyped, ?strict: bool) -> untyped
|
|
160
156
|
def eval_on_selector_all: (String selector, String expression, ?arg: untyped) -> untyped
|
|
161
157
|
def evaluate: (String expression, ?arg: untyped) -> untyped
|
|
@@ -215,6 +211,7 @@ module Playwright
|
|
|
215
211
|
def evaluate: (String expression, ?arg: untyped) -> untyped
|
|
216
212
|
def evaluate_handle: (String expression, ?arg: untyped) -> JSHandle
|
|
217
213
|
def url: -> String
|
|
214
|
+
def expect_event: (String event, ?predicate: function, ?timeout: Float) { () -> void } -> untyped
|
|
218
215
|
end
|
|
219
216
|
|
|
220
217
|
class Selectors
|
|
@@ -241,6 +238,7 @@ module Playwright
|
|
|
241
238
|
def page: -> (nil | Page)
|
|
242
239
|
def text: -> String
|
|
243
240
|
def type: -> ("log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd")
|
|
241
|
+
def worker: -> (nil | Worker)
|
|
244
242
|
end
|
|
245
243
|
|
|
246
244
|
class Dialog
|
|
@@ -275,7 +273,7 @@ module Playwright
|
|
|
275
273
|
def context: -> BrowserContext
|
|
276
274
|
def dblclick: (String selector, ?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
|
|
277
275
|
def dispatch_event: (String selector, String type_, ?eventInit: untyped, ?strict: bool, ?timeout: Float) -> void
|
|
278
|
-
def drag_and_drop: (String source, String target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?strict: bool, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
276
|
+
def drag_and_drop: (String source, String target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?steps: Integer, ?strict: bool, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
279
277
|
def emulate_media: (?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "null"), ?forcedColors: ("active" | "none" | "null"), ?media: ("screen" | "print" | "null"), ?reducedMotion: ("reduce" | "no-preference" | "null")) -> void
|
|
280
278
|
def eval_on_selector: (String selector, String expression, ?arg: untyped, ?strict: bool) -> untyped
|
|
281
279
|
def eval_on_selector_all: (String selector, String expression, ?arg: untyped) -> untyped
|
|
@@ -368,7 +366,6 @@ module Playwright
|
|
|
368
366
|
def workers: -> Array[untyped]
|
|
369
367
|
|
|
370
368
|
attr_reader clock: Clock
|
|
371
|
-
attr_reader accessibility: Accessibility
|
|
372
369
|
attr_reader keyboard: Keyboard
|
|
373
370
|
attr_reader mouse: Mouse
|
|
374
371
|
attr_reader request: APIRequestContext
|
|
@@ -468,12 +465,13 @@ module Playwright
|
|
|
468
465
|
def bounding_box: (?timeout: Float) -> (nil | Hash[untyped, untyped])
|
|
469
466
|
def check: (?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
470
467
|
def clear: (?force: bool, ?noWaitAfter: bool, ?timeout: Float) -> void
|
|
471
|
-
def click: (?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
468
|
+
def click: (?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?steps: Integer, ?timeout: Float, ?trial: bool) -> void
|
|
472
469
|
def count: -> Integer
|
|
473
|
-
def dblclick: (?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
470
|
+
def dblclick: (?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?steps: Integer, ?timeout: Float, ?trial: bool) -> void
|
|
474
471
|
def describe: (String description) -> Locator
|
|
472
|
+
def description: -> (nil | String)
|
|
475
473
|
def dispatch_event: (String type_, ?eventInit: untyped, ?timeout: Float) -> void
|
|
476
|
-
def drag_to: (Locator target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
474
|
+
def drag_to: (Locator target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?steps: Integer, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
|
|
477
475
|
def element_handle: (?timeout: Float) -> ElementHandle
|
|
478
476
|
def element_handles: -> Array[untyped]
|
|
479
477
|
def content_frame: -> FrameLocator
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playwright-ruby-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.57.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- YusukeIwaki
|
|
@@ -9,6 +9,20 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: base64
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: concurrent-ruby
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -107,6 +121,20 @@ dependencies:
|
|
|
107
121
|
- - ">="
|
|
108
122
|
- !ruby/object:Gem::Version
|
|
109
123
|
version: '0'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: ostruct
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0'
|
|
131
|
+
type: :development
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0'
|
|
110
138
|
- !ruby/object:Gem::Dependency
|
|
111
139
|
name: puma
|
|
112
140
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -208,7 +236,6 @@ files:
|
|
|
208
236
|
- bin/setup
|
|
209
237
|
- documentation/README.md
|
|
210
238
|
- documentation/babel.config.js
|
|
211
|
-
- documentation/docs/api/accessibility.md
|
|
212
239
|
- documentation/docs/api/api_request.md
|
|
213
240
|
- documentation/docs/api/api_request_context.md
|
|
214
241
|
- documentation/docs/api/api_response.md
|
|
@@ -277,7 +304,6 @@ files:
|
|
|
277
304
|
- documentation/static/img/undraw_windows.svg
|
|
278
305
|
- documentation/yarn.lock
|
|
279
306
|
- lib/playwright.rb
|
|
280
|
-
- lib/playwright/accessibility_impl.rb
|
|
281
307
|
- lib/playwright/android_input_impl.rb
|
|
282
308
|
- lib/playwright/api_implementation.rb
|
|
283
309
|
- lib/playwright/api_response_impl.rb
|
|
@@ -351,7 +377,6 @@ files:
|
|
|
351
377
|
- lib/playwright/waiter.rb
|
|
352
378
|
- lib/playwright/web_socket_client.rb
|
|
353
379
|
- lib/playwright/web_socket_transport.rb
|
|
354
|
-
- lib/playwright_api/accessibility.rb
|
|
355
380
|
- lib/playwright_api/android.rb
|
|
356
381
|
- lib/playwright_api/android_device.rb
|
|
357
382
|
- lib/playwright_api/android_input.rb
|
|
@@ -410,5 +435,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
410
435
|
requirements: []
|
|
411
436
|
rubygems_version: 3.6.9
|
|
412
437
|
specification_version: 4
|
|
413
|
-
summary: The Ruby binding of playwright driver 1.
|
|
438
|
+
summary: The Ruby binding of playwright driver 1.57.0
|
|
414
439
|
test_files: []
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 10
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Accessibility
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
|
|
9
|
-
assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
|
|
10
|
-
[switches](https://en.wikipedia.org/wiki/Switch_access).
|
|
11
|
-
|
|
12
|
-
Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might
|
|
13
|
-
have wildly different output.
|
|
14
|
-
|
|
15
|
-
Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated into different
|
|
16
|
-
platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
|
|
17
|
-
|
|
18
|
-
Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by
|
|
19
|
-
assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the
|
|
20
|
-
"interesting" nodes of the tree.
|
|
21
|
-
|
|
22
|
-
## snapshot
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
def snapshot(interestingOnly: nil, root: nil)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
:::warning
|
|
29
|
-
|
|
30
|
-
This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
|
|
31
|
-
|
|
32
|
-
:::
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
|
|
36
|
-
page.
|
|
37
|
-
|
|
38
|
-
**NOTE**: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright
|
|
39
|
-
will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
|
|
40
|
-
|
|
41
|
-
**Usage**
|
|
42
|
-
|
|
43
|
-
An example of dumping the entire accessibility tree:
|
|
44
|
-
|
|
45
|
-
```ruby
|
|
46
|
-
snapshot = page.accessibility.snapshot
|
|
47
|
-
puts snapshot
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
An example of logging the focused node's name:
|
|
51
|
-
|
|
52
|
-
```ruby
|
|
53
|
-
def find_focused_node(node)
|
|
54
|
-
if node['focused']
|
|
55
|
-
node
|
|
56
|
-
else
|
|
57
|
-
node['children']&.find do |child|
|
|
58
|
-
find_focused_node(child)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
snapshot = page.accessibility.snapshot
|
|
64
|
-
node = find_focused_node(snapshot)
|
|
65
|
-
puts node['name']
|
|
66
|
-
```
|