playwright-ruby-client 1.28.1 → 1.29.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/documentation/docs/api/accessibility.md +9 -14
- data/documentation/docs/api/api_request_context.md +44 -41
- data/documentation/docs/api/api_response.md +13 -3
- data/documentation/docs/api/browser.md +24 -23
- data/documentation/docs/api/browser_context.md +71 -45
- data/documentation/docs/api/browser_type.md +21 -14
- data/documentation/docs/api/cdp_session.md +3 -5
- data/documentation/docs/api/console_message.md +7 -4
- data/documentation/docs/api/dialog.md +9 -5
- data/documentation/docs/api/download.md +19 -11
- data/documentation/docs/api/element_handle.md +125 -116
- data/documentation/docs/api/experimental/android.md +4 -5
- data/documentation/docs/api/experimental/android_device.md +11 -2
- data/documentation/docs/api/experimental/android_input.md +5 -0
- data/documentation/docs/api/file_chooser.md +6 -3
- data/documentation/docs/api/frame.md +182 -171
- data/documentation/docs/api/frame_locator.md +27 -38
- data/documentation/docs/api/js_handle.md +16 -10
- data/documentation/docs/api/keyboard.md +29 -16
- data/documentation/docs/api/locator.md +189 -140
- data/documentation/docs/api/mouse.md +9 -4
- data/documentation/docs/api/page.md +304 -289
- data/documentation/docs/api/playwright.md +8 -5
- data/documentation/docs/api/request.md +34 -15
- data/documentation/docs/api/response.md +27 -10
- data/documentation/docs/api/route.md +44 -12
- data/documentation/docs/api/selectors.md +5 -3
- data/documentation/docs/api/touchscreen.md +2 -0
- data/documentation/docs/api/tracing.md +11 -11
- data/documentation/docs/api/web_socket.md +9 -4
- data/documentation/docs/api/worker.md +12 -11
- data/documentation/docs/include/api_coverage.md +2 -0
- data/lib/playwright/channel_owners/api_request_context.rb +37 -2
- data/lib/playwright/channel_owners/browser_context.rb +22 -26
- data/lib/playwright/channel_owners/page.rb +35 -25
- data/lib/playwright/channel_owners/route.rb +28 -8
- data/lib/playwright/event_emitter.rb +6 -1
- data/lib/playwright/locator_impl.rb +8 -0
- data/lib/playwright/select_option_values.rb +2 -0
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/accessibility.rb +9 -13
- data/lib/playwright_api/android.rb +14 -12
- data/lib/playwright_api/android_device.rb +38 -13
- data/lib/playwright_api/android_input.rb +5 -0
- data/lib/playwright_api/android_socket.rb +4 -2
- data/lib/playwright_api/android_web_view.rb +5 -2
- data/lib/playwright_api/api_request.rb +6 -3
- data/lib/playwright_api/api_request_context.rb +52 -42
- data/lib/playwright_api/api_response.rb +13 -2
- data/lib/playwright_api/browser.rb +30 -22
- data/lib/playwright_api/browser_context.rb +82 -45
- data/lib/playwright_api/browser_type.rb +29 -19
- data/lib/playwright_api/cdp_session.rb +9 -10
- data/lib/playwright_api/console_message.rb +13 -8
- data/lib/playwright_api/dialog.rb +14 -10
- data/lib/playwright_api/download.rb +19 -9
- data/lib/playwright_api/element_handle.rb +122 -99
- data/lib/playwright_api/file_chooser.rb +6 -1
- data/lib/playwright_api/frame.rb +186 -141
- data/lib/playwright_api/frame_locator.rb +29 -32
- data/lib/playwright_api/js_handle.rb +22 -12
- data/lib/playwright_api/keyboard.rb +29 -14
- data/lib/playwright_api/locator.rb +183 -112
- data/lib/playwright_api/mouse.rb +9 -2
- data/lib/playwright_api/page.rb +307 -259
- data/lib/playwright_api/playwright.rb +17 -10
- data/lib/playwright_api/request.rb +40 -13
- data/lib/playwright_api/response.rb +33 -16
- data/lib/playwright_api/route.rb +50 -17
- data/lib/playwright_api/selectors.rb +12 -7
- data/lib/playwright_api/touchscreen.rb +2 -0
- data/lib/playwright_api/tracing.rb +17 -11
- data/lib/playwright_api/web_socket.rb +15 -10
- data/lib/playwright_api/worker.rb +20 -17
- data/playwright.gemspec +2 -2
- data/sig/playwright.rbs +559 -0
- metadata +10 -9
@@ -4,9 +4,11 @@ sidebar_position: 10
|
|
4
4
|
|
5
5
|
# Download
|
6
6
|
|
7
|
+
|
7
8
|
[Download](./download) objects are dispatched by page via the [`event: Page.download`] event.
|
8
9
|
|
9
|
-
All the downloaded files belonging to the browser context are deleted when the
|
10
|
+
All the downloaded files belonging to the browser context are deleted when the
|
11
|
+
browser context is closed.
|
10
12
|
|
11
13
|
Download event is emitted once the download starts. Download path becomes available once download completes:
|
12
14
|
|
@@ -19,16 +21,15 @@ end
|
|
19
21
|
path = download.path
|
20
22
|
```
|
21
23
|
|
22
|
-
|
23
|
-
|
24
24
|
## cancel
|
25
25
|
|
26
26
|
```
|
27
27
|
def cancel
|
28
28
|
```
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
Cancels a download. Will not fail if the download is already finished or canceled.
|
32
|
+
Upon successful cancellations, `download.failure()` would resolve to `'canceled'`.
|
32
33
|
|
33
34
|
## delete
|
34
35
|
|
@@ -36,6 +37,7 @@ Cancels a download. Will not fail if the download is already finished or cancele
|
|
36
37
|
def delete
|
37
38
|
```
|
38
39
|
|
40
|
+
|
39
41
|
Deletes the downloaded file. Will wait for the download to finish if necessary.
|
40
42
|
|
41
43
|
## failure
|
@@ -44,6 +46,7 @@ Deletes the downloaded file. Will wait for the download to finish if necessary.
|
|
44
46
|
def failure
|
45
47
|
```
|
46
48
|
|
49
|
+
|
47
50
|
Returns download error if any. Will wait for the download to finish if necessary.
|
48
51
|
|
49
52
|
## page
|
@@ -52,6 +55,7 @@ Returns download error if any. Will wait for the download to finish if necessary
|
|
52
55
|
def page
|
53
56
|
```
|
54
57
|
|
58
|
+
|
55
59
|
Get the page that the download belongs to.
|
56
60
|
|
57
61
|
## path
|
@@ -60,11 +64,12 @@ Get the page that the download belongs to.
|
|
60
64
|
def path
|
61
65
|
```
|
62
66
|
|
63
|
-
Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if
|
64
|
-
necessary. The method throws when connected remotely.
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
+
Returns path to the downloaded file in case of successful download. The method will
|
69
|
+
wait for the download to finish if necessary. The method throws when connected remotely.
|
70
|
+
|
71
|
+
Note that the download's file name is a random GUID, use [Download#suggested_filename](./download#suggested_filename)
|
72
|
+
to get suggested file name.
|
68
73
|
|
69
74
|
## save_as
|
70
75
|
|
@@ -72,8 +77,9 @@ name.
|
|
72
77
|
def save_as(path)
|
73
78
|
```
|
74
79
|
|
75
|
-
|
76
|
-
|
80
|
+
|
81
|
+
Copy the download to a user-specified path. It is safe to call this method while the download
|
82
|
+
is still in progress. Will wait for the download to finish if necessary.
|
77
83
|
|
78
84
|
## suggested_filename
|
79
85
|
|
@@ -81,6 +87,7 @@ wait for the download to finish if necessary.
|
|
81
87
|
def suggested_filename
|
82
88
|
```
|
83
89
|
|
90
|
+
|
84
91
|
Returns suggested filename for this download. It is typically computed by the browser from the
|
85
92
|
[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response header
|
86
93
|
or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources). Different
|
@@ -92,4 +99,5 @@ browsers can use different logic for computing it.
|
|
92
99
|
def url
|
93
100
|
```
|
94
101
|
|
102
|
+
|
95
103
|
Returns downloaded url.
|