playwright-ruby-client 0.0.8 → 1.58.1.alpha1
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/AGENTS.md +4 -0
- data/CLAUDE/api_generation.md +28 -0
- data/CLAUDE/ci_expectations.md +23 -0
- data/CLAUDE/gem_release_flow.md +39 -0
- data/CLAUDE/past_upgrade_pr_patterns.md +42 -0
- data/CLAUDE/playwright_upgrade_workflow.md +35 -0
- data/CLAUDE/rspec_debugging.md +30 -0
- data/CLAUDE/unimplemented_examples.md +18 -0
- data/CLAUDE.md +32 -0
- data/CONTRIBUTING.md +5 -0
- data/README.md +60 -16
- data/documentation/README.md +33 -0
- data/documentation/babel.config.js +3 -0
- data/documentation/docs/api/api_request.md +7 -0
- data/documentation/docs/api/api_request_context.md +298 -0
- data/documentation/docs/api/api_response.md +114 -0
- data/documentation/docs/api/browser.md +237 -0
- data/documentation/docs/api/browser_context.md +503 -0
- data/documentation/docs/api/browser_type.md +184 -0
- data/documentation/docs/api/cdp_session.md +44 -0
- data/documentation/docs/api/clock.md +154 -0
- data/documentation/docs/api/console_message.md +85 -0
- data/documentation/docs/api/dialog.md +84 -0
- data/documentation/docs/api/download.md +111 -0
- data/documentation/docs/api/element_handle.md +694 -0
- data/documentation/docs/api/experimental/_category_.yml +3 -0
- data/documentation/docs/api/experimental/android.md +42 -0
- data/documentation/docs/api/experimental/android_device.md +109 -0
- data/documentation/docs/api/experimental/android_input.md +43 -0
- data/documentation/docs/api/experimental/android_socket.md +7 -0
- data/documentation/docs/api/experimental/android_web_view.md +7 -0
- data/documentation/docs/api/file_chooser.md +53 -0
- data/documentation/docs/api/frame.md +1218 -0
- data/documentation/docs/api/frame_locator.md +348 -0
- data/documentation/docs/api/js_handle.md +121 -0
- data/documentation/docs/api/keyboard.md +170 -0
- data/documentation/docs/api/locator.md +1495 -0
- data/documentation/docs/api/locator_assertions.md +827 -0
- data/documentation/docs/api/mouse.md +86 -0
- data/documentation/docs/api/page.md +1946 -0
- data/documentation/docs/api/page_assertions.md +65 -0
- data/documentation/docs/api/playwright.md +66 -0
- data/documentation/docs/api/request.md +255 -0
- data/documentation/docs/api/response.md +176 -0
- data/documentation/docs/api/route.md +205 -0
- data/documentation/docs/api/selectors.md +63 -0
- data/documentation/docs/api/touchscreen.md +22 -0
- data/documentation/docs/api/tracing.md +129 -0
- data/documentation/docs/api/web_socket.md +51 -0
- data/documentation/docs/api/worker.md +83 -0
- data/documentation/docs/article/api_coverage.mdx +11 -0
- data/documentation/docs/article/getting_started.md +161 -0
- data/documentation/docs/article/guides/_category_.yml +3 -0
- data/documentation/docs/article/guides/download_playwright_driver.md +55 -0
- data/documentation/docs/article/guides/inspector.md +31 -0
- data/documentation/docs/article/guides/launch_browser.md +121 -0
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +112 -0
- data/documentation/docs/article/guides/rails_integration.md +278 -0
- data/documentation/docs/article/guides/rails_integration_with_null_driver.md +145 -0
- data/documentation/docs/article/guides/recording_video.md +79 -0
- data/documentation/docs/article/guides/rspec_integration.md +59 -0
- data/documentation/docs/article/guides/semi_automation.md +71 -0
- data/documentation/docs/article/guides/use_storage_state.md +78 -0
- data/documentation/docs/include/api_coverage.md +671 -0
- data/documentation/docusaurus.config.js +114 -0
- data/documentation/package.json +39 -0
- data/documentation/sidebars.js +15 -0
- data/documentation/src/components/HomepageFeatures.js +61 -0
- data/documentation/src/components/HomepageFeatures.module.css +13 -0
- data/documentation/src/css/custom.css +44 -0
- data/documentation/src/pages/index.js +49 -0
- data/documentation/src/pages/index.module.css +41 -0
- data/documentation/src/pages/markdown-page.md +7 -0
- data/documentation/static/.nojekyll +0 -0
- data/documentation/static/img/playwright-logo.svg +9 -0
- data/documentation/static/img/playwright-ruby-client.png +0 -0
- data/documentation/static/img/undraw_dropdown_menu.svg +1 -0
- data/documentation/static/img/undraw_web_development.svg +1 -0
- data/documentation/static/img/undraw_windows.svg +1 -0
- data/documentation/yarn.lock +9005 -0
- data/lib/playwright/{input_types/android_input.rb → android_input_impl.rb} +5 -1
- data/lib/playwright/api_implementation.rb +18 -0
- data/lib/playwright/api_response_impl.rb +77 -0
- data/lib/playwright/channel.rb +62 -1
- data/lib/playwright/channel_owner.rb +70 -7
- data/lib/playwright/channel_owners/android.rb +16 -3
- data/lib/playwright/channel_owners/android_device.rb +22 -66
- data/lib/playwright/channel_owners/api_request_context.rb +247 -0
- data/lib/playwright/channel_owners/artifact.rb +40 -0
- data/lib/playwright/channel_owners/binding_call.rb +70 -0
- data/lib/playwright/channel_owners/browser.rb +114 -22
- data/lib/playwright/channel_owners/browser_context.rb +589 -15
- data/lib/playwright/channel_owners/browser_type.rb +90 -1
- data/lib/playwright/channel_owners/cdp_session.rb +19 -0
- data/lib/playwright/channel_owners/dialog.rb +32 -0
- data/lib/playwright/channel_owners/element_handle.rb +107 -43
- data/lib/playwright/channel_owners/fetch_request.rb +8 -0
- data/lib/playwright/channel_owners/frame.rb +334 -104
- data/lib/playwright/channel_owners/js_handle.rb +9 -13
- data/lib/playwright/channel_owners/local_utils.rb +82 -0
- data/lib/playwright/channel_owners/page.rb +778 -95
- data/lib/playwright/channel_owners/playwright.rb +25 -30
- data/lib/playwright/channel_owners/request.rb +120 -18
- data/lib/playwright/channel_owners/response.rb +113 -0
- data/lib/playwright/channel_owners/route.rb +181 -0
- data/lib/playwright/channel_owners/stream.rb +30 -0
- data/lib/playwright/channel_owners/tracing.rb +117 -0
- data/lib/playwright/channel_owners/web_socket.rb +96 -0
- data/lib/playwright/channel_owners/worker.rb +46 -0
- data/lib/playwright/channel_owners/writable_stream.rb +14 -0
- data/lib/playwright/clock_impl.rb +67 -0
- data/lib/playwright/connection.rb +111 -63
- data/lib/playwright/console_message_impl.rb +29 -0
- data/lib/playwright/download_impl.rb +32 -0
- data/lib/playwright/errors.rb +42 -5
- data/lib/playwright/event_emitter.rb +17 -3
- data/lib/playwright/event_emitter_proxy.rb +49 -0
- data/lib/playwright/events.rb +10 -5
- data/lib/playwright/file_chooser_impl.rb +24 -0
- data/lib/playwright/frame_locator_impl.rb +66 -0
- data/lib/playwright/har_router.rb +89 -0
- data/lib/playwright/http_headers.rb +14 -0
- data/lib/playwright/input_files.rb +102 -15
- data/lib/playwright/javascript/expression.rb +7 -11
- data/lib/playwright/javascript/regex.rb +23 -0
- data/lib/playwright/javascript/source_url.rb +16 -0
- data/lib/playwright/javascript/value_parser.rb +108 -19
- data/lib/playwright/javascript/value_serializer.rb +47 -8
- data/lib/playwright/javascript/visitor_info.rb +26 -0
- data/lib/playwright/javascript.rb +2 -10
- data/lib/playwright/{input_types/keyboard.rb → keyboard_impl.rb} +6 -2
- data/lib/playwright/locator_assertions_impl.rb +571 -0
- data/lib/playwright/locator_impl.rb +544 -0
- data/lib/playwright/locator_utils.rb +136 -0
- data/lib/playwright/mouse_impl.rb +57 -0
- data/lib/playwright/page_assertions_impl.rb +154 -0
- data/lib/playwright/playwright_api.rb +102 -30
- data/lib/playwright/raw_headers.rb +61 -0
- data/lib/playwright/route_handler.rb +78 -0
- data/lib/playwright/select_option_values.rb +34 -13
- data/lib/playwright/selectors_impl.rb +45 -0
- data/lib/playwright/test.rb +102 -0
- data/lib/playwright/timeout_settings.rb +9 -4
- data/lib/playwright/touchscreen_impl.rb +14 -0
- data/lib/playwright/transport.rb +61 -10
- data/lib/playwright/url_matcher.rb +24 -2
- data/lib/playwright/utils.rb +48 -13
- data/lib/playwright/version.rb +2 -1
- data/lib/playwright/video.rb +54 -0
- data/lib/playwright/waiter.rb +166 -0
- data/lib/playwright/web_socket_client.rb +167 -0
- data/lib/playwright/web_socket_transport.rb +116 -0
- data/lib/playwright.rb +188 -11
- data/lib/playwright_api/android.rb +46 -11
- data/lib/playwright_api/android_device.rb +182 -31
- data/lib/playwright_api/android_input.rb +22 -13
- data/lib/playwright_api/android_socket.rb +18 -0
- data/lib/playwright_api/android_web_view.rb +24 -0
- data/lib/playwright_api/api_request.rb +26 -0
- data/lib/playwright_api/api_request_context.rb +311 -0
- data/lib/playwright_api/api_response.rb +92 -0
- data/lib/playwright_api/browser.rb +116 -103
- data/lib/playwright_api/browser_context.rb +290 -389
- data/lib/playwright_api/browser_type.rb +96 -118
- data/lib/playwright_api/cdp_session.rb +36 -39
- data/lib/playwright_api/clock.rb +121 -0
- data/lib/playwright_api/console_message.rb +35 -19
- data/lib/playwright_api/dialog.rb +53 -50
- data/lib/playwright_api/download.rb +49 -43
- data/lib/playwright_api/element_handle.rb +354 -402
- data/lib/playwright_api/file_chooser.rb +15 -18
- data/lib/playwright_api/frame.rb +703 -603
- data/lib/playwright_api/frame_locator.rb +285 -0
- data/lib/playwright_api/js_handle.rb +50 -76
- data/lib/playwright_api/keyboard.rb +67 -146
- data/lib/playwright_api/locator.rb +1304 -0
- data/lib/playwright_api/locator_assertions.rb +704 -0
- data/lib/playwright_api/mouse.rb +23 -29
- data/lib/playwright_api/page.rb +1196 -1176
- data/lib/playwright_api/page_assertions.rb +60 -0
- data/lib/playwright_api/playwright.rb +54 -122
- data/lib/playwright_api/request.rb +112 -74
- data/lib/playwright_api/response.rb +92 -20
- data/lib/playwright_api/route.rb +152 -62
- data/lib/playwright_api/selectors.rb +47 -61
- data/lib/playwright_api/touchscreen.rb +8 -2
- data/lib/playwright_api/tracing.rb +128 -0
- data/lib/playwright_api/web_socket.rb +43 -5
- data/lib/playwright_api/worker.rb +74 -34
- data/playwright.gemspec +14 -9
- data/sig/playwright.rbs +658 -0
- metadata +216 -50
- data/docs/api_coverage.md +0 -354
- data/lib/playwright/channel_owners/chromium_browser.rb +0 -8
- data/lib/playwright/channel_owners/chromium_browser_context.rb +0 -8
- data/lib/playwright/channel_owners/console_message.rb +0 -21
- data/lib/playwright/channel_owners/firefox_browser.rb +0 -8
- data/lib/playwright/channel_owners/selectors.rb +0 -4
- data/lib/playwright/channel_owners/webkit_browser.rb +0 -8
- data/lib/playwright/input_type.rb +0 -19
- data/lib/playwright/input_types/mouse.rb +0 -4
- data/lib/playwright/input_types/touchscreen.rb +0 -4
- data/lib/playwright/javascript/function.rb +0 -67
- data/lib/playwright/wait_helper.rb +0 -73
- data/lib/playwright_api/accessibility.rb +0 -93
- data/lib/playwright_api/binding_call.rb +0 -23
- data/lib/playwright_api/chromium_browser_context.rb +0 -57
- data/lib/playwright_api/video.rb +0 -24
data/docs/api_coverage.md
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
# API coverages
|
|
2
|
-
|
|
3
|
-
## Request
|
|
4
|
-
|
|
5
|
-
* failure
|
|
6
|
-
* frame
|
|
7
|
-
* headers
|
|
8
|
-
* navigation_request?
|
|
9
|
-
* method
|
|
10
|
-
* post_data
|
|
11
|
-
* post_data_buffer
|
|
12
|
-
* post_data_json
|
|
13
|
-
* redirected_from
|
|
14
|
-
* redirected_to
|
|
15
|
-
* resource_type
|
|
16
|
-
* response
|
|
17
|
-
* timing
|
|
18
|
-
* url
|
|
19
|
-
|
|
20
|
-
## Response
|
|
21
|
-
|
|
22
|
-
* ~~body~~
|
|
23
|
-
* ~~finished~~
|
|
24
|
-
* ~~frame~~
|
|
25
|
-
* ~~headers~~
|
|
26
|
-
* ~~json~~
|
|
27
|
-
* ~~ok~~
|
|
28
|
-
* ~~request~~
|
|
29
|
-
* ~~status~~
|
|
30
|
-
* ~~status_text~~
|
|
31
|
-
* ~~text~~
|
|
32
|
-
* ~~url~~
|
|
33
|
-
|
|
34
|
-
## ~~Route~~
|
|
35
|
-
|
|
36
|
-
* ~~abort~~
|
|
37
|
-
* ~~continue_~~
|
|
38
|
-
* ~~fulfill~~
|
|
39
|
-
* ~~request~~
|
|
40
|
-
|
|
41
|
-
## ~~WebSocket~~
|
|
42
|
-
|
|
43
|
-
* ~~closed?~~
|
|
44
|
-
* ~~url~~
|
|
45
|
-
* ~~expect_event~~
|
|
46
|
-
|
|
47
|
-
## Keyboard
|
|
48
|
-
|
|
49
|
-
* down
|
|
50
|
-
* insert_text
|
|
51
|
-
* press
|
|
52
|
-
* type
|
|
53
|
-
* up
|
|
54
|
-
|
|
55
|
-
## Mouse
|
|
56
|
-
|
|
57
|
-
* ~~click~~
|
|
58
|
-
* ~~dblclick~~
|
|
59
|
-
* ~~down~~
|
|
60
|
-
* ~~move~~
|
|
61
|
-
* ~~up~~
|
|
62
|
-
|
|
63
|
-
## Touchscreen
|
|
64
|
-
|
|
65
|
-
* ~~tap_point~~
|
|
66
|
-
|
|
67
|
-
## JSHandle
|
|
68
|
-
|
|
69
|
-
* as_element
|
|
70
|
-
* dispose
|
|
71
|
-
* evaluate
|
|
72
|
-
* evaluate_handle
|
|
73
|
-
* get_properties
|
|
74
|
-
* get_property
|
|
75
|
-
* json_value
|
|
76
|
-
|
|
77
|
-
## ElementHandle
|
|
78
|
-
|
|
79
|
-
* query_selector
|
|
80
|
-
* query_selector_all
|
|
81
|
-
* eval_on_selector
|
|
82
|
-
* eval_on_selector_all
|
|
83
|
-
* bounding_box
|
|
84
|
-
* check
|
|
85
|
-
* click
|
|
86
|
-
* content_frame
|
|
87
|
-
* dblclick
|
|
88
|
-
* dispatch_event
|
|
89
|
-
* fill
|
|
90
|
-
* focus
|
|
91
|
-
* get_attribute
|
|
92
|
-
* hover
|
|
93
|
-
* inner_html
|
|
94
|
-
* inner_text
|
|
95
|
-
* checked?
|
|
96
|
-
* disabled?
|
|
97
|
-
* editable?
|
|
98
|
-
* enabled?
|
|
99
|
-
* hidden?
|
|
100
|
-
* visible?
|
|
101
|
-
* owner_frame
|
|
102
|
-
* press
|
|
103
|
-
* screenshot
|
|
104
|
-
* scroll_into_view_if_needed
|
|
105
|
-
* select_option
|
|
106
|
-
* select_text
|
|
107
|
-
* set_input_files
|
|
108
|
-
* tap_point
|
|
109
|
-
* text_content
|
|
110
|
-
* type
|
|
111
|
-
* uncheck
|
|
112
|
-
* wait_for_element_state
|
|
113
|
-
* wait_for_selector
|
|
114
|
-
|
|
115
|
-
## ~~Accessibility~~
|
|
116
|
-
|
|
117
|
-
* ~~snapshot~~
|
|
118
|
-
|
|
119
|
-
## ~~FileChooser~~
|
|
120
|
-
|
|
121
|
-
* ~~element~~
|
|
122
|
-
* ~~multiple?~~
|
|
123
|
-
* ~~page~~
|
|
124
|
-
* ~~set_files~~
|
|
125
|
-
|
|
126
|
-
## Frame
|
|
127
|
-
|
|
128
|
-
* query_selector
|
|
129
|
-
* query_selector_all
|
|
130
|
-
* eval_on_selector
|
|
131
|
-
* eval_on_selector_all
|
|
132
|
-
* add_script_tag
|
|
133
|
-
* add_style_tag
|
|
134
|
-
* check
|
|
135
|
-
* child_frames
|
|
136
|
-
* click
|
|
137
|
-
* content
|
|
138
|
-
* dblclick
|
|
139
|
-
* dispatch_event
|
|
140
|
-
* evaluate
|
|
141
|
-
* evaluate_handle
|
|
142
|
-
* fill
|
|
143
|
-
* focus
|
|
144
|
-
* ~~frame_element~~
|
|
145
|
-
* get_attribute
|
|
146
|
-
* goto
|
|
147
|
-
* hover
|
|
148
|
-
* inner_html
|
|
149
|
-
* inner_text
|
|
150
|
-
* checked?
|
|
151
|
-
* detached?
|
|
152
|
-
* disabled?
|
|
153
|
-
* editable?
|
|
154
|
-
* enabled?
|
|
155
|
-
* hidden?
|
|
156
|
-
* visible?
|
|
157
|
-
* name
|
|
158
|
-
* page
|
|
159
|
-
* parent_frame
|
|
160
|
-
* press
|
|
161
|
-
* select_option
|
|
162
|
-
* set_content
|
|
163
|
-
* set_input_files
|
|
164
|
-
* tap_point
|
|
165
|
-
* text_content
|
|
166
|
-
* title
|
|
167
|
-
* type
|
|
168
|
-
* uncheck
|
|
169
|
-
* url
|
|
170
|
-
* wait_for_function
|
|
171
|
-
* wait_for_load_state
|
|
172
|
-
* expect_navigation
|
|
173
|
-
* ~~wait_for_selector~~
|
|
174
|
-
* ~~wait_for_timeout~~
|
|
175
|
-
|
|
176
|
-
## ~~Worker~~
|
|
177
|
-
|
|
178
|
-
* ~~evaluate~~
|
|
179
|
-
* ~~evaluate_handle~~
|
|
180
|
-
* ~~url~~
|
|
181
|
-
|
|
182
|
-
## Selectors
|
|
183
|
-
|
|
184
|
-
* ~~register~~
|
|
185
|
-
|
|
186
|
-
## ConsoleMessage
|
|
187
|
-
|
|
188
|
-
* args
|
|
189
|
-
* location
|
|
190
|
-
* text
|
|
191
|
-
* type
|
|
192
|
-
|
|
193
|
-
## ~~Dialog~~
|
|
194
|
-
|
|
195
|
-
* ~~accept~~
|
|
196
|
-
* ~~default_value~~
|
|
197
|
-
* ~~dismiss~~
|
|
198
|
-
* ~~message~~
|
|
199
|
-
* ~~type~~
|
|
200
|
-
|
|
201
|
-
## ~~Download~~
|
|
202
|
-
|
|
203
|
-
* ~~create_read_stream~~
|
|
204
|
-
* ~~delete~~
|
|
205
|
-
* ~~failure~~
|
|
206
|
-
* ~~path~~
|
|
207
|
-
* ~~save_as~~
|
|
208
|
-
* ~~suggested_filename~~
|
|
209
|
-
* ~~url~~
|
|
210
|
-
|
|
211
|
-
## ~~Video~~
|
|
212
|
-
|
|
213
|
-
* ~~path~~
|
|
214
|
-
|
|
215
|
-
## Page
|
|
216
|
-
|
|
217
|
-
* query_selector
|
|
218
|
-
* query_selector_all
|
|
219
|
-
* eval_on_selector
|
|
220
|
-
* eval_on_selector_all
|
|
221
|
-
* ~~add_init_script~~
|
|
222
|
-
* add_script_tag
|
|
223
|
-
* add_style_tag
|
|
224
|
-
* ~~bring_to_front~~
|
|
225
|
-
* ~~check~~
|
|
226
|
-
* click
|
|
227
|
-
* close
|
|
228
|
-
* content
|
|
229
|
-
* context
|
|
230
|
-
* dblclick
|
|
231
|
-
* ~~dispatch_event~~
|
|
232
|
-
* ~~emulate_media~~
|
|
233
|
-
* evaluate
|
|
234
|
-
* evaluate_handle
|
|
235
|
-
* ~~expose_binding~~
|
|
236
|
-
* ~~expose_function~~
|
|
237
|
-
* fill
|
|
238
|
-
* focus
|
|
239
|
-
* frame
|
|
240
|
-
* frames
|
|
241
|
-
* ~~get_attribute~~
|
|
242
|
-
* ~~go_back~~
|
|
243
|
-
* ~~go_forward~~
|
|
244
|
-
* goto
|
|
245
|
-
* ~~hover~~
|
|
246
|
-
* ~~inner_html~~
|
|
247
|
-
* ~~inner_text~~
|
|
248
|
-
* ~~checked?~~
|
|
249
|
-
* closed?
|
|
250
|
-
* ~~disabled?~~
|
|
251
|
-
* ~~editable?~~
|
|
252
|
-
* ~~enabled?~~
|
|
253
|
-
* ~~hidden?~~
|
|
254
|
-
* ~~visible?~~
|
|
255
|
-
* main_frame
|
|
256
|
-
* opener
|
|
257
|
-
* ~~pdf~~
|
|
258
|
-
* press
|
|
259
|
-
* reload
|
|
260
|
-
* ~~route~~
|
|
261
|
-
* screenshot
|
|
262
|
-
* ~~select_option~~
|
|
263
|
-
* set_content
|
|
264
|
-
* set_default_navigation_timeout
|
|
265
|
-
* set_default_timeout
|
|
266
|
-
* ~~set_extra_http_headers~~
|
|
267
|
-
* ~~set_input_files~~
|
|
268
|
-
* set_viewport_size
|
|
269
|
-
* ~~tap_point~~
|
|
270
|
-
* ~~text_content~~
|
|
271
|
-
* title
|
|
272
|
-
* type
|
|
273
|
-
* ~~uncheck~~
|
|
274
|
-
* ~~unroute~~
|
|
275
|
-
* url
|
|
276
|
-
* ~~video~~
|
|
277
|
-
* viewport_size
|
|
278
|
-
* expect_event
|
|
279
|
-
* wait_for_function
|
|
280
|
-
* wait_for_load_state
|
|
281
|
-
* expect_navigation
|
|
282
|
-
* expect_request
|
|
283
|
-
* expect_response
|
|
284
|
-
* ~~wait_for_selector~~
|
|
285
|
-
* ~~wait_for_timeout~~
|
|
286
|
-
* ~~workers~~
|
|
287
|
-
* accessibility
|
|
288
|
-
* ~~coverage~~
|
|
289
|
-
* keyboard
|
|
290
|
-
* mouse
|
|
291
|
-
* touchscreen
|
|
292
|
-
|
|
293
|
-
## BrowserContext
|
|
294
|
-
|
|
295
|
-
* ~~add_cookies~~
|
|
296
|
-
* ~~add_init_script~~
|
|
297
|
-
* ~~browser~~
|
|
298
|
-
* ~~clear_cookies~~
|
|
299
|
-
* ~~clear_permissions~~
|
|
300
|
-
* close
|
|
301
|
-
* ~~cookies~~
|
|
302
|
-
* ~~expose_binding~~
|
|
303
|
-
* ~~expose_function~~
|
|
304
|
-
* ~~grant_permissions~~
|
|
305
|
-
* new_page
|
|
306
|
-
* pages
|
|
307
|
-
* ~~route~~
|
|
308
|
-
* ~~set_default_navigation_timeout~~
|
|
309
|
-
* ~~set_default_timeout~~
|
|
310
|
-
* ~~set_extra_http_headers~~
|
|
311
|
-
* ~~set_geolocation~~
|
|
312
|
-
* ~~set_http_credentials~~
|
|
313
|
-
* ~~set_offline~~
|
|
314
|
-
* ~~storage_state~~
|
|
315
|
-
* ~~unroute~~
|
|
316
|
-
* ~~expect_event~~
|
|
317
|
-
|
|
318
|
-
## ~~CDPSession~~
|
|
319
|
-
|
|
320
|
-
* ~~detach~~
|
|
321
|
-
* ~~send_message~~
|
|
322
|
-
|
|
323
|
-
## ChromiumBrowserContext
|
|
324
|
-
|
|
325
|
-
* ~~background_pages~~
|
|
326
|
-
* ~~new_cdp_session~~
|
|
327
|
-
* ~~service_workers~~
|
|
328
|
-
|
|
329
|
-
## Browser
|
|
330
|
-
|
|
331
|
-
* close
|
|
332
|
-
* contexts
|
|
333
|
-
* connected?
|
|
334
|
-
* new_context
|
|
335
|
-
* new_page
|
|
336
|
-
* version
|
|
337
|
-
|
|
338
|
-
## BrowserType
|
|
339
|
-
|
|
340
|
-
* ~~connect~~
|
|
341
|
-
* executable_path
|
|
342
|
-
* launch
|
|
343
|
-
* ~~launch_persistent_context~~
|
|
344
|
-
* ~~launch_server~~
|
|
345
|
-
* name
|
|
346
|
-
|
|
347
|
-
## Playwright
|
|
348
|
-
|
|
349
|
-
* chromium
|
|
350
|
-
* devices
|
|
351
|
-
* ~~errors~~
|
|
352
|
-
* firefox
|
|
353
|
-
* ~~selectors~~
|
|
354
|
-
* webkit
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
define_channel_owner :ConsoleMessage do
|
|
3
|
-
def type
|
|
4
|
-
@initializer['type']
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
def text
|
|
8
|
-
@initializer['text']
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def args
|
|
12
|
-
@initializer['args']&.map do |arg|
|
|
13
|
-
ChannelOwner.from(arg)
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def location
|
|
18
|
-
@initialize['location']
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
class InputType
|
|
3
|
-
def initialize(channel)
|
|
4
|
-
@channel = channel
|
|
5
|
-
end
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
# namespace declaration
|
|
9
|
-
module InputTypes ; end
|
|
10
|
-
|
|
11
|
-
def self.define_input_type(class_name, &block)
|
|
12
|
-
klass = Class.new(InputType)
|
|
13
|
-
klass.class_eval(&block) if block
|
|
14
|
-
InputTypes.const_set(class_name, klass)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# load subclasses
|
|
19
|
-
Dir[File.join(__dir__, 'input_types', '*.rb')].each { |f| require f }
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
module JavaScript
|
|
3
|
-
class Function
|
|
4
|
-
def initialize(definition, arg)
|
|
5
|
-
@definition = definition
|
|
6
|
-
@serialized_arg = ValueSerializer.new(arg).serialize
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def evaluate(channel)
|
|
10
|
-
value = channel.send_message_to_server(
|
|
11
|
-
'evaluateExpression',
|
|
12
|
-
expression: @definition,
|
|
13
|
-
isFunction: true,
|
|
14
|
-
arg: @serialized_arg,
|
|
15
|
-
)
|
|
16
|
-
ValueParser.new(value).parse
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def evaluate_handle(channel)
|
|
20
|
-
resp = channel.send_message_to_server(
|
|
21
|
-
'evaluateExpressionHandle',
|
|
22
|
-
expression: @definition,
|
|
23
|
-
isFunction: true,
|
|
24
|
-
arg: @serialized_arg,
|
|
25
|
-
)
|
|
26
|
-
::Playwright::ChannelOwner.from(resp)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def eval_on_selector(channel, selector)
|
|
30
|
-
value = channel.send_message_to_server(
|
|
31
|
-
'evalOnSelector',
|
|
32
|
-
selector: selector,
|
|
33
|
-
expression: @definition,
|
|
34
|
-
isFunction: true,
|
|
35
|
-
arg: @serialized_arg,
|
|
36
|
-
)
|
|
37
|
-
ValueParser.new(value).parse
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def eval_on_selector_all(channel, selector)
|
|
41
|
-
value = channel.send_message_to_server(
|
|
42
|
-
'evalOnSelectorAll',
|
|
43
|
-
selector: selector,
|
|
44
|
-
expression: @definition,
|
|
45
|
-
isFunction: true,
|
|
46
|
-
arg: @serialized_arg,
|
|
47
|
-
)
|
|
48
|
-
ValueParser.new(value).parse
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def wait_for_function(channel, polling:, timeout:)
|
|
52
|
-
params = {
|
|
53
|
-
expression: @definition,
|
|
54
|
-
isFunction: true,
|
|
55
|
-
arg: @serialized_arg,
|
|
56
|
-
polling: polling,
|
|
57
|
-
timeout: timeout,
|
|
58
|
-
}.compact
|
|
59
|
-
if polling.is_a?(Numeric)
|
|
60
|
-
params[:pollingInterval] = polling
|
|
61
|
-
end
|
|
62
|
-
resp = channel.send_message_to_server('waitForFunction', params)
|
|
63
|
-
ChannelOwners::JSHandle.from(resp)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
# ref: https://github.com/microsoft/playwright-python/blob/30946ae3099d51f9b7f355f9ae7e8c04d748ce36/playwright/_impl/_wait_helper.py
|
|
3
|
-
# ref: https://github.com/microsoft/playwright/blob/01fb3a6045cbdb4b5bcba0809faed85bd917ab87/src/client/waiter.ts#L21
|
|
4
|
-
class WaitHelper
|
|
5
|
-
def initialize
|
|
6
|
-
@promise = Concurrent::Promises.resolvable_future
|
|
7
|
-
@registered_listeners = Set.new
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def reject_on_event(emitter, event, error, predicate: nil)
|
|
11
|
-
listener = -> (*args) {
|
|
12
|
-
if !predicate || predicate.call(*args)
|
|
13
|
-
reject(error)
|
|
14
|
-
end
|
|
15
|
-
}
|
|
16
|
-
emitter.on(event, listener)
|
|
17
|
-
@registered_listeners << [emitter, event, listener]
|
|
18
|
-
|
|
19
|
-
self
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def reject_on_timeout(timeout_ms, message)
|
|
23
|
-
return if timeout_ms <= 0
|
|
24
|
-
|
|
25
|
-
Concurrent::Promises.schedule(timeout_ms / 1000.0) {
|
|
26
|
-
reject(TimeoutError.new(message))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
self
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# @param [Playwright::EventEmitter]
|
|
33
|
-
# @param
|
|
34
|
-
def wait_for_event(emitter, event, predicate: nil)
|
|
35
|
-
listener = -> (*args) {
|
|
36
|
-
begin
|
|
37
|
-
if !predicate || predicate.call(*args)
|
|
38
|
-
fulfill(*args)
|
|
39
|
-
end
|
|
40
|
-
rescue => err
|
|
41
|
-
reject(err)
|
|
42
|
-
end
|
|
43
|
-
}
|
|
44
|
-
emitter.on(event, listener)
|
|
45
|
-
@registered_listeners << [emitter, event, listener]
|
|
46
|
-
|
|
47
|
-
self
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
attr_reader :promise
|
|
51
|
-
|
|
52
|
-
private def cleanup
|
|
53
|
-
@registered_listeners.each do |emitter, event, listener|
|
|
54
|
-
emitter.off(event, listener)
|
|
55
|
-
end
|
|
56
|
-
@registered_listeners.clear
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
private def fulfill(*args)
|
|
60
|
-
cleanup
|
|
61
|
-
unless @promise.resolved?
|
|
62
|
-
@promise.fulfill(args.first)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
private def reject(error)
|
|
67
|
-
cleanup
|
|
68
|
-
unless @promise.resolved?
|
|
69
|
-
@promise.reject(error)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
# The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
|
|
3
|
-
# assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
|
|
4
|
-
# [switches](https://en.wikipedia.org/wiki/Switch_access).
|
|
5
|
-
#
|
|
6
|
-
# Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might
|
|
7
|
-
# have wildly different output.
|
|
8
|
-
#
|
|
9
|
-
# Rendering engines of Chromium, Firefox and Webkit have a concept of "accessibility tree", which is then translated into
|
|
10
|
-
# different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
|
|
11
|
-
#
|
|
12
|
-
# Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
|
|
13
|
-
# AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing
|
|
14
|
-
# only the "interesting" nodes of the tree.
|
|
15
|
-
class Accessibility < PlaywrightApi
|
|
16
|
-
|
|
17
|
-
# Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
|
|
18
|
-
# page.
|
|
19
|
-
#
|
|
20
|
-
# > NOTE: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers.
|
|
21
|
-
# Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
|
|
22
|
-
#
|
|
23
|
-
# An example of dumping the entire accessibility tree:
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
# ```js
|
|
27
|
-
# const snapshot = await page.accessibility.snapshot();
|
|
28
|
-
# console.log(snapshot);
|
|
29
|
-
# ```
|
|
30
|
-
#
|
|
31
|
-
# ```python async
|
|
32
|
-
# snapshot = await page.accessibility.snapshot()
|
|
33
|
-
# print(snapshot)
|
|
34
|
-
# ```
|
|
35
|
-
#
|
|
36
|
-
# ```python sync
|
|
37
|
-
# snapshot = page.accessibility.snapshot()
|
|
38
|
-
# print(snapshot)
|
|
39
|
-
# ```
|
|
40
|
-
#
|
|
41
|
-
# An example of logging the focused node's name:
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
# ```js
|
|
45
|
-
# const snapshot = await page.accessibility.snapshot();
|
|
46
|
-
# const node = findFocusedNode(snapshot);
|
|
47
|
-
# console.log(node && node.name);
|
|
48
|
-
#
|
|
49
|
-
# function findFocusedNode(node) {
|
|
50
|
-
# if (node.focused)
|
|
51
|
-
# return node;
|
|
52
|
-
# for (const child of node.children || []) {
|
|
53
|
-
# const foundNode = findFocusedNode(child);
|
|
54
|
-
# return foundNode;
|
|
55
|
-
# }
|
|
56
|
-
# return null;
|
|
57
|
-
# }
|
|
58
|
-
# ```
|
|
59
|
-
#
|
|
60
|
-
# ```python async
|
|
61
|
-
# def find_focused_node(node):
|
|
62
|
-
# if (node.get("focused"))
|
|
63
|
-
# return node
|
|
64
|
-
# for child in (node.get("children") or []):
|
|
65
|
-
# found_node = find_focused_node(child)
|
|
66
|
-
# return found_node
|
|
67
|
-
# return None
|
|
68
|
-
#
|
|
69
|
-
# snapshot = await page.accessibility.snapshot()
|
|
70
|
-
# node = find_focused_node(snapshot)
|
|
71
|
-
# if node:
|
|
72
|
-
# print(node["name"])
|
|
73
|
-
# ```
|
|
74
|
-
#
|
|
75
|
-
# ```python sync
|
|
76
|
-
# def find_focused_node(node):
|
|
77
|
-
# if (node.get("focused"))
|
|
78
|
-
# return node
|
|
79
|
-
# for child in (node.get("children") or []):
|
|
80
|
-
# found_node = find_focused_node(child)
|
|
81
|
-
# return found_node
|
|
82
|
-
# return None
|
|
83
|
-
#
|
|
84
|
-
# snapshot = page.accessibility.snapshot()
|
|
85
|
-
# node = find_focused_node(snapshot)
|
|
86
|
-
# if node:
|
|
87
|
-
# print(node["name"])
|
|
88
|
-
# ```
|
|
89
|
-
def snapshot(interestingOnly: nil, root: nil)
|
|
90
|
-
raise NotImplementedError.new('snapshot is not implemented yet.')
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module Playwright
|
|
2
|
-
# @nodoc
|
|
3
|
-
class BindingCall < PlaywrightApi
|
|
4
|
-
|
|
5
|
-
# -- inherited from EventEmitter --
|
|
6
|
-
# @nodoc
|
|
7
|
-
def on(event, callback)
|
|
8
|
-
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# -- inherited from EventEmitter --
|
|
12
|
-
# @nodoc
|
|
13
|
-
def off(event, callback)
|
|
14
|
-
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# -- inherited from EventEmitter --
|
|
18
|
-
# @nodoc
|
|
19
|
-
def once(event, callback)
|
|
20
|
-
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|