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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Android
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
|
|
9
|
+
|
|
10
|
+
*Requirements*
|
|
11
|
+
- Android device or AVD Emulator.
|
|
12
|
+
- [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.
|
|
13
|
+
- [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
|
|
14
|
+
- "Enable command line on non-rooted devices" enabled in `chrome://flags`.
|
|
15
|
+
|
|
16
|
+
*Known limitations*
|
|
17
|
+
- Raw USB operation is not yet supported, so you need ADB.
|
|
18
|
+
- Device needs to be awake to produce screenshots. Enabling "Stay awake" developer mode will help.
|
|
19
|
+
- We didn't run all the tests against the device, so not everything works.
|
|
20
|
+
|
|
21
|
+
*How to run*
|
|
22
|
+
|
|
23
|
+
An example of the Android automation script would be:
|
|
24
|
+
|
|
25
|
+
## devices
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
def devices(host: nil, omitDriverInstall: nil, port: nil)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Returns the list of detected Android devices.
|
|
33
|
+
|
|
34
|
+
## set_default_timeout
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
def set_default_timeout(timeout)
|
|
38
|
+
```
|
|
39
|
+
alias: `default_timeout=`
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
This setting will change the default maximum time for all the methods accepting `timeout` option.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AndroidDevice
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[AndroidDevice](./android_device) represents a connected device, either real hardware or emulated. Devices can be obtained using [Android#devices](./android#devices).
|
|
9
|
+
|
|
10
|
+
## close
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
def close
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Disconnects from the device.
|
|
18
|
+
|
|
19
|
+
## info
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
def info(selector)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Returns information about a widget defined by `selector`.
|
|
27
|
+
|
|
28
|
+
## launch_browser
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
def launch_browser(
|
|
32
|
+
acceptDownloads: nil,
|
|
33
|
+
args: nil,
|
|
34
|
+
baseURL: nil,
|
|
35
|
+
bypassCSP: nil,
|
|
36
|
+
colorScheme: nil,
|
|
37
|
+
contrast: nil,
|
|
38
|
+
deviceScaleFactor: nil,
|
|
39
|
+
extraHTTPHeaders: nil,
|
|
40
|
+
forcedColors: nil,
|
|
41
|
+
geolocation: nil,
|
|
42
|
+
hasTouch: nil,
|
|
43
|
+
httpCredentials: nil,
|
|
44
|
+
ignoreHTTPSErrors: nil,
|
|
45
|
+
isMobile: nil,
|
|
46
|
+
javaScriptEnabled: nil,
|
|
47
|
+
locale: nil,
|
|
48
|
+
noViewport: nil,
|
|
49
|
+
offline: nil,
|
|
50
|
+
permissions: nil,
|
|
51
|
+
pkg: nil,
|
|
52
|
+
proxy: nil,
|
|
53
|
+
record_har_content: nil,
|
|
54
|
+
record_har_mode: nil,
|
|
55
|
+
record_har_omit_content: nil,
|
|
56
|
+
record_har_path: nil,
|
|
57
|
+
record_har_url_filter: nil,
|
|
58
|
+
record_video_dir: nil,
|
|
59
|
+
record_video_size: nil,
|
|
60
|
+
reducedMotion: nil,
|
|
61
|
+
screen: nil,
|
|
62
|
+
serviceWorkers: nil,
|
|
63
|
+
strictSelectors: nil,
|
|
64
|
+
timezoneId: nil,
|
|
65
|
+
userAgent: nil,
|
|
66
|
+
viewport: nil,
|
|
67
|
+
&block)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Launches Chrome browser on the device, and returns its persistent context.
|
|
72
|
+
|
|
73
|
+
## model
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
def model
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
Device model.
|
|
81
|
+
|
|
82
|
+
## screenshot
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
def screenshot(path: nil)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Returns the buffer with the captured screenshot of the device.
|
|
90
|
+
|
|
91
|
+
## serial
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
def serial
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
Device serial number.
|
|
99
|
+
|
|
100
|
+
## shell
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
def shell(command)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
Executes a shell command on the device and returns its output.
|
|
108
|
+
|
|
109
|
+
## input
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# AndroidInput
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## drag
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
def drag(from, to, steps)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Performs a drag between `from` and `to` points.
|
|
17
|
+
|
|
18
|
+
## press
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
def press(key)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Presses the `key`.
|
|
26
|
+
|
|
27
|
+
## tap_point
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
def tap_point(point)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
Taps at the specified `point`.
|
|
35
|
+
|
|
36
|
+
## type
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
def type(text)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Types `text` into currently focused widget.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 10
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# FileChooser
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[FileChooser](./file_chooser) objects are dispatched by the page in the [`event: Page.fileChooser`] event.
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
file_chooser = page.expect_file_chooser do
|
|
12
|
+
page.get_by_text("Upload file").click # action to trigger file uploading
|
|
13
|
+
end
|
|
14
|
+
file_chooser.set_files("myfile.pdf")
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## element
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
def element
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Returns input element associated with this file chooser.
|
|
25
|
+
|
|
26
|
+
## multiple?
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
def multiple?
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Returns whether this file chooser accepts multiple files.
|
|
34
|
+
|
|
35
|
+
## page
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
def page
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
Returns page this file chooser belongs to.
|
|
43
|
+
|
|
44
|
+
## set_files
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
def set_files(files, noWaitAfter: nil, timeout: nil)
|
|
48
|
+
```
|
|
49
|
+
alias: `files=`
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then
|
|
53
|
+
they are resolved relative to the current working directory. For empty array, clears the selected files.
|