playwright-ruby-client 1.34.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/docs/api/element_handle.md +1 -0
- data/documentation/docs/api/locator.md +1 -0
- data/documentation/docs/api/page.md +5 -4
- data/documentation/docs/api/selectors.md +1 -1
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +28 -21
- data/lib/playwright/channel_owners/browser_context.rb +1 -1
- data/lib/playwright/channel_owners/element_handle.rb +2 -0
- data/lib/playwright/channel_owners/page.rb +3 -1
- data/lib/playwright/channel_owners/playwright.rb +0 -1
- data/lib/playwright/channel_owners/route.rb +2 -1
- data/lib/playwright/javascript/value_parser.rb +4 -0
- data/lib/playwright/javascript/value_serializer.rb +5 -1
- data/lib/playwright/locator_impl.rb +2 -0
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright.rb +2 -1
- data/lib/playwright_api/accessibility.rb +2 -2
- data/lib/playwright_api/browser_context.rb +2 -2
- data/lib/playwright_api/element_handle.rb +3 -2
- data/lib/playwright_api/frame.rb +4 -4
- data/lib/playwright_api/js_handle.rb +1 -1
- data/lib/playwright_api/locator.rb +7 -7
- data/lib/playwright_api/page.rb +4 -3
- data/lib/playwright_api/playwright.rb +8 -8
- data/lib/playwright_api/response.rb +4 -4
- data/lib/playwright_api/route.rb +2 -2
- data/sig/playwright.rbs +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 853f54317712f2c9fbe41a64c07091aa11c553718f57ecc78394f9426dbe5412
|
4
|
+
data.tar.gz: 932e51fd6b3b7890ff5684226cdeca4fe2b55f525b646779745f6cae62a6a4b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '049a0b12e42905c291451b21d64ffc3235dfdc0c531ad46016497ee52432c9433b97ac6fe4e3c51e23228a713d4c6add3d58cfe0c9373b9d5657f07a75c11441'
|
7
|
+
data.tar.gz: b6e9030498986b5f31417f2c15a8090f459f391d8cd288a60fa600ec087da32316eafa1e25ced20ae20ab62bc87806d4525ca6d950646b6780497982a0922527
|
@@ -1286,6 +1286,7 @@ def screenshot(
|
|
1286
1286
|
clip: nil,
|
1287
1287
|
fullPage: nil,
|
1288
1288
|
mask: nil,
|
1289
|
+
maskColor: nil,
|
1289
1290
|
omitBackground: nil,
|
1290
1291
|
path: nil,
|
1291
1292
|
quality: nil,
|
@@ -1740,7 +1741,7 @@ Waits for the matching request and returns it. See [waiting for event](https://p
|
|
1740
1741
|
```ruby
|
1741
1742
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger request" /></form>'
|
1742
1743
|
request = page.expect_request(/example.com\/resource/) do
|
1743
|
-
page.get_by_text("trigger request").click
|
1744
|
+
page.get_by_text("trigger request").click
|
1744
1745
|
end
|
1745
1746
|
puts request.headers
|
1746
1747
|
|
@@ -1749,7 +1750,7 @@ page.wait_for_load_state # wait for request finished.
|
|
1749
1750
|
# or with a predicate
|
1750
1751
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger request" /></form>'
|
1751
1752
|
request = page.expect_request(->(req) { req.url.start_with? 'https://example.com/resource' }) do
|
1752
|
-
page.get_by_text("trigger request").click
|
1753
|
+
page.get_by_text("trigger request").click
|
1753
1754
|
end
|
1754
1755
|
puts request.headers
|
1755
1756
|
```
|
@@ -1779,7 +1780,7 @@ Returns the matched response. See [waiting for event](https://playwright.dev/pyt
|
|
1779
1780
|
```ruby
|
1780
1781
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger response" /></form>'
|
1781
1782
|
response = page.expect_response(/example.com\/resource/) do
|
1782
|
-
page.get_by_text("trigger response").click
|
1783
|
+
page.get_by_text("trigger response").click
|
1783
1784
|
end
|
1784
1785
|
puts response.body
|
1785
1786
|
puts response.ok?
|
@@ -1789,7 +1790,7 @@ page.wait_for_load_state # wait for request finished.
|
|
1789
1790
|
# or with a predicate
|
1790
1791
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger response" /></form>'
|
1791
1792
|
response = page.expect_response(->(res) { res.url.start_with? 'https://example.com/resource' }) do
|
1792
|
-
page.get_by_text("trigger response").click
|
1793
|
+
page.get_by_text("trigger response").click
|
1793
1794
|
end
|
1794
1795
|
puts response.body
|
1795
1796
|
puts response.ok?
|
@@ -38,7 +38,7 @@ JAVASCRIPT
|
|
38
38
|
# Register the engine. Selectors will be prefixed with "tag=".
|
39
39
|
playwright.selectors.register("tag", script: tag_selector)
|
40
40
|
playwright.chromium.launch do |browser|
|
41
|
-
page = browser.new_page
|
41
|
+
page = browser.new_page
|
42
42
|
page.content = '<div><button>Click me</button></div>'
|
43
43
|
|
44
44
|
# Use the selector prefixed with its name.
|
@@ -14,14 +14,14 @@ This all-in-one architecture is reasonable for browser automation in our own com
|
|
14
14
|
|
15
15
|
However we may have trouble with bringing Playwright into:
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
- Docker
|
18
|
+
- Alpine Linux
|
19
|
+
- Serverless computing
|
20
|
+
- AWS Lambda
|
21
|
+
- Google Cloud Functions
|
22
|
+
- PaaS
|
23
|
+
- Heroku
|
24
|
+
- Google App Engine
|
25
25
|
|
26
26
|
This article introduces a way to separate environments into client (for executing Playwright script) and server (for working with browsers). The main use-case assumes Docker (using Alpine Linux), however the way can be applied also into other use-cases.
|
27
27
|
|
@@ -39,16 +39,22 @@ Playwright provides two kind of methods to share the browser environments for cl
|
|
39
39
|
|
40
40
|
When you want to share only one browser environment, Browser server is suitable. This feature is officially supported in Playwright.
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
- Server can be launched with [BrowserType#launchServer](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server) instead of `BrowserType#launch`.
|
43
|
+
- Client can connect to server with [BrowserType#connect](https://playwright.dev/docs/api/class-browsertype#browser-type-connect). In playwright-ruby-client, `BrowserType#connect` and not implemented yet and use `Playwright#connect_to_browser_server()` instead.
|
44
44
|
|
45
45
|
Another method is sharing all browser environment. This method is very simple, but not an official feature, and can be changed in future.
|
46
46
|
|
47
|
-
|
48
|
-
|
47
|
+
- Server can be launched with `playwright run-server` (CLI command).
|
48
|
+
- Client can connect to server with `Playwright.connect_to_playwright_server` instead of `Playwright.create`
|
49
49
|
|
50
50
|
## Playwright server/client
|
51
51
|
|
52
|
+
:::caution
|
53
|
+
|
54
|
+
This method is no longer supported on Playwright driver >= 1.35. See [this issue](https://github.com/YusukeIwaki/playwright-ruby-client/issues/254) for detail, and use Browser server/client method instead.
|
55
|
+
|
56
|
+
:::
|
57
|
+
|
52
58
|
### Client code
|
53
59
|
|
54
60
|
Many example uses `Playwright#create`, which internally uses Pipe (stdin/stdout) transport for Playwright-protocol messaging. Instead, **just use `Playwright#connect_to_playwright_server(endpoint)`** for WebSocket transport.
|
@@ -74,10 +80,10 @@ With the [official Docker image](https://hub.docker.com/_/microsoft-playwright)
|
|
74
80
|
If custom Docker image is preferred, build it as follows:
|
75
81
|
|
76
82
|
```Dockerfile
|
77
|
-
FROM mcr.microsoft.com/playwright
|
83
|
+
FROM mcr.microsoft.com/playwright
|
78
84
|
|
79
85
|
WORKDIR /root
|
80
|
-
RUN npm install playwright
|
86
|
+
RUN npm install playwright && ./node_modules/.bin/playwright install
|
81
87
|
|
82
88
|
ENV PORT 8888
|
83
89
|
CMD ["./node_modules/.bin/playwright", "run-server", "--port", "$PORT", "--path", "/ws"]
|
@@ -105,15 +111,17 @@ For instant use, `npx playwright launch-server --browser chromium` generates a W
|
|
105
111
|
More customization can be done by implementing JavaScript server like below:
|
106
112
|
|
107
113
|
```js
|
108
|
-
const playwright = require(
|
114
|
+
const playwright = require("playwright");
|
109
115
|
|
110
116
|
option = {
|
111
|
-
channel:
|
117
|
+
channel: "chrome-canary",
|
112
118
|
headless: false,
|
113
119
|
port: 8080,
|
114
|
-
wsPath:
|
115
|
-
}
|
116
|
-
playwright.chromium.launchServer(option).then((server) => {
|
120
|
+
wsPath: "ws",
|
121
|
+
};
|
122
|
+
playwright.chromium.launchServer(option).then((server) => {
|
123
|
+
console.log(server.wsEndpoint());
|
124
|
+
});
|
117
125
|
```
|
118
126
|
|
119
127
|
`port` and `wsPath` would be useful for generating static WebSocket endpoint URL.
|
@@ -132,13 +140,12 @@ Just set an environment variable `DEBUG=1`.
|
|
132
140
|
DEBUG=1 bundle exec ruby some-automation-with-playwright.rb
|
133
141
|
```
|
134
142
|
|
135
|
-
|
136
143
|
### Enable verbose logging on server
|
137
144
|
|
138
145
|
Just set an environment variable `DEBUG=pw:*` or `DEBUG=pw:server`
|
139
146
|
|
140
147
|
```
|
141
|
-
DEBUG=pw:* npx playwright
|
148
|
+
DEBUG=pw:* npx playwright launch-server --browser chromium
|
142
149
|
```
|
143
150
|
|
144
151
|
See [the official documentation](https://playwright.dev/docs/debug/#verbose-api-logs) for details.
|
@@ -296,6 +296,7 @@ module Playwright
|
|
296
296
|
animations: nil,
|
297
297
|
caret: nil,
|
298
298
|
mask: nil,
|
299
|
+
maskColor: nil,
|
299
300
|
omitBackground: nil,
|
300
301
|
path: nil,
|
301
302
|
quality: nil,
|
@@ -306,6 +307,7 @@ module Playwright
|
|
306
307
|
params = {
|
307
308
|
animations: animations,
|
308
309
|
caret: caret,
|
310
|
+
maskColor: maskColor,
|
309
311
|
omitBackground: omitBackground,
|
310
312
|
path: path,
|
311
313
|
quality: quality,
|
@@ -438,6 +438,7 @@ module Playwright
|
|
438
438
|
clip: nil,
|
439
439
|
fullPage: nil,
|
440
440
|
mask: nil,
|
441
|
+
maskColor: nil,
|
441
442
|
omitBackground: nil,
|
442
443
|
path: nil,
|
443
444
|
quality: nil,
|
@@ -450,6 +451,7 @@ module Playwright
|
|
450
451
|
quality: quality,
|
451
452
|
fullPage: fullPage,
|
452
453
|
clip: clip,
|
454
|
+
maskColor: maskColor,
|
453
455
|
omitBackground: omitBackground,
|
454
456
|
animations: animations,
|
455
457
|
caret: caret,
|
@@ -484,7 +486,7 @@ module Playwright
|
|
484
486
|
end
|
485
487
|
nil
|
486
488
|
rescue => err
|
487
|
-
raise
|
489
|
+
raise if !safe_close_error?(err) || !runBeforeUnload
|
488
490
|
end
|
489
491
|
|
490
492
|
def closed?
|
@@ -137,7 +137,7 @@ module Playwright
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
-
private def async_continue_route
|
140
|
+
private def async_continue_route(internal: false)
|
141
141
|
post_data_for_wire =
|
142
142
|
if (post_data_from_overrides = request.send(:fallback_overrides)[:postData])
|
143
143
|
post_data_for_wire = Base64.strict_encode64(post_data_from_overrides)
|
@@ -155,6 +155,7 @@ module Playwright
|
|
155
155
|
params[:postData] = post_data_for_wire
|
156
156
|
end
|
157
157
|
params[:requestUrl] = request.send(:internal_url)
|
158
|
+
params[:isFallback] = internal
|
158
159
|
|
159
160
|
# TODO _race_with_page_close
|
160
161
|
@channel.async_send_message_to_server('continue', params)
|
@@ -52,6 +52,10 @@ module Playwright
|
|
52
52
|
return URI(hash['u'])
|
53
53
|
end
|
54
54
|
|
55
|
+
if hash.key?('bi')
|
56
|
+
return hash['bi'].to_i
|
57
|
+
end
|
58
|
+
|
55
59
|
if hash.key?('r')
|
56
60
|
# @see https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
57
61
|
# @see https://docs.ruby-lang.org/ja/latest/class/Regexp.html
|
@@ -34,7 +34,11 @@ module Playwright
|
|
34
34
|
when true, false
|
35
35
|
{ b: value }
|
36
36
|
when Numeric
|
37
|
-
|
37
|
+
if !value.is_a?(Integer) || (-9007199254740992..9007199254740991).include?(value)
|
38
|
+
{ n: value }
|
39
|
+
else
|
40
|
+
{ bi: value.to_s }
|
41
|
+
end
|
38
42
|
when String
|
39
43
|
{ s: value }
|
40
44
|
when Time
|
@@ -362,6 +362,7 @@ module Playwright
|
|
362
362
|
animations: nil,
|
363
363
|
caret: nil,
|
364
364
|
mask: nil,
|
365
|
+
maskColor: nil,
|
365
366
|
omitBackground: nil,
|
366
367
|
path: nil,
|
367
368
|
quality: nil,
|
@@ -374,6 +375,7 @@ module Playwright
|
|
374
375
|
animations: animations,
|
375
376
|
caret: caret,
|
376
377
|
mask: mask,
|
378
|
+
maskColor: maskColor,
|
377
379
|
omitBackground: omitBackground,
|
378
380
|
path: path,
|
379
381
|
quality: quality,
|
data/lib/playwright/version.rb
CHANGED
data/lib/playwright.rb
CHANGED
@@ -159,8 +159,9 @@ module Playwright
|
|
159
159
|
begin
|
160
160
|
playwright = connection.initialize_playwright
|
161
161
|
browser = playwright.send(:pre_launched_browser)
|
162
|
+
browser.send(:update_browser_type, playwright.chromium) # Just workaround for nil reference error.
|
162
163
|
browser.browser_type.send(:did_launch_browser, browser)
|
163
|
-
browser.should_close_connection_on_close!
|
164
|
+
browser.send(:should_close_connection_on_close!)
|
164
165
|
Execution.new(connection, PlaywrightApi.wrap(playwright), PlaywrightApi.wrap(browser))
|
165
166
|
rescue
|
166
167
|
connection.stop
|
@@ -35,11 +35,11 @@ module Playwright
|
|
35
35
|
#
|
36
36
|
# ```python sync
|
37
37
|
# def find_focused_node(node):
|
38
|
-
# if
|
38
|
+
# if node.get("focused"):
|
39
39
|
# return node
|
40
40
|
# for child in (node.get("children") or []):
|
41
41
|
# found_node = find_focused_node(child)
|
42
|
-
# if
|
42
|
+
# if found_node:
|
43
43
|
# return found_node
|
44
44
|
# return None
|
45
45
|
#
|
@@ -281,9 +281,9 @@ module Playwright
|
|
281
281
|
#
|
282
282
|
# ```python sync
|
283
283
|
# def handle_route(route):
|
284
|
-
# if ("my-string" in route.request.post_data)
|
284
|
+
# if ("my-string" in route.request.post_data):
|
285
285
|
# route.fulfill(body="mocked-data")
|
286
|
-
# else
|
286
|
+
# else:
|
287
287
|
# route.continue_()
|
288
288
|
# context.route("/api/**", handle_route)
|
289
289
|
# ```
|
@@ -187,7 +187,7 @@ module Playwright
|
|
187
187
|
# ```python sync
|
188
188
|
# tweet_handle = page.query_selector(".tweet")
|
189
189
|
# assert tweet_handle.eval_on_selector(".like", "node => node.innerText") == "100"
|
190
|
-
# assert tweet_handle.eval_on_selector(".retweets", "node => node.innerText")
|
190
|
+
# assert tweet_handle.eval_on_selector(".retweets", "node => node.innerText") == "10"
|
191
191
|
# ```
|
192
192
|
def eval_on_selector(selector, expression, arg: nil)
|
193
193
|
wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg)))
|
@@ -374,13 +374,14 @@ module Playwright
|
|
374
374
|
animations: nil,
|
375
375
|
caret: nil,
|
376
376
|
mask: nil,
|
377
|
+
maskColor: nil,
|
377
378
|
omitBackground: nil,
|
378
379
|
path: nil,
|
379
380
|
quality: nil,
|
380
381
|
scale: nil,
|
381
382
|
timeout: nil,
|
382
383
|
type: nil)
|
383
|
-
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
384
|
+
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), mask: unwrap_impl(mask), maskColor: unwrap_impl(maskColor), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
384
385
|
end
|
385
386
|
|
386
387
|
#
|
data/lib/playwright_api/frame.rb
CHANGED
@@ -1038,13 +1038,13 @@ module Playwright
|
|
1038
1038
|
end
|
1039
1039
|
|
1040
1040
|
# @nodoc
|
1041
|
-
def
|
1042
|
-
wrap_impl(@impl.
|
1041
|
+
def detached=(req)
|
1042
|
+
wrap_impl(@impl.detached=(unwrap_impl(req)))
|
1043
1043
|
end
|
1044
1044
|
|
1045
1045
|
# @nodoc
|
1046
|
-
def
|
1047
|
-
wrap_impl(@impl.
|
1046
|
+
def highlight(selector)
|
1047
|
+
wrap_impl(@impl.highlight(unwrap_impl(selector)))
|
1048
1048
|
end
|
1049
1049
|
|
1050
1050
|
# -- inherited from EventEmitter --
|
@@ -67,7 +67,7 @@ module Playwright
|
|
67
67
|
# **Usage**
|
68
68
|
#
|
69
69
|
# ```python sync
|
70
|
-
# handle = page.evaluate_handle("({window, document})")
|
70
|
+
# handle = page.evaluate_handle("({ window, document })")
|
71
71
|
# properties = handle.get_properties()
|
72
72
|
# window_handle = properties.get("window")
|
73
73
|
# document_handle = properties.get("document")
|
@@ -406,10 +406,9 @@ module Playwright
|
|
406
406
|
# ```python sync
|
407
407
|
# row_locator = page.locator("tr")
|
408
408
|
# # ...
|
409
|
-
# row_locator
|
410
|
-
# .
|
411
|
-
#
|
412
|
-
# .screenshot()
|
409
|
+
# row_locator.filter(has_text="text in column 1").filter(
|
410
|
+
# has=page.get_by_role("button", name="column 2 button")
|
411
|
+
# ).screenshot()
|
413
412
|
# ```
|
414
413
|
def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
|
415
414
|
wrap_impl(@impl.filter(has: unwrap_impl(has), hasNot: unwrap_impl(hasNot), hasNotText: unwrap_impl(hasNotText), hasText: unwrap_impl(hasText)))
|
@@ -781,7 +780,7 @@ module Playwright
|
|
781
780
|
# **Usage**
|
782
781
|
#
|
783
782
|
# ```python sync
|
784
|
-
# banana = page.get_by_role("listitem").last
|
783
|
+
# banana = page.get_by_role("listitem").last
|
785
784
|
# ```
|
786
785
|
def last
|
787
786
|
wrap_impl(@impl.last)
|
@@ -823,7 +822,7 @@ module Playwright
|
|
823
822
|
# new_email = page.get_by_role("button", name="New")
|
824
823
|
# dialog = page.get_by_text("Confirm security settings")
|
825
824
|
# expect(new_email.or_(dialog)).to_be_visible()
|
826
|
-
# if (dialog.is_visible())
|
825
|
+
# if (dialog.is_visible()):
|
827
826
|
# page.get_by_role("button", name="Dismiss").click()
|
828
827
|
# new_email.click()
|
829
828
|
# ```
|
@@ -898,13 +897,14 @@ module Playwright
|
|
898
897
|
animations: nil,
|
899
898
|
caret: nil,
|
900
899
|
mask: nil,
|
900
|
+
maskColor: nil,
|
901
901
|
omitBackground: nil,
|
902
902
|
path: nil,
|
903
903
|
quality: nil,
|
904
904
|
scale: nil,
|
905
905
|
timeout: nil,
|
906
906
|
type: nil)
|
907
|
-
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
907
|
+
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), mask: unwrap_impl(mask), maskColor: unwrap_impl(maskColor), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
908
908
|
end
|
909
909
|
|
910
910
|
#
|
data/lib/playwright_api/page.rb
CHANGED
@@ -1115,9 +1115,9 @@ module Playwright
|
|
1115
1115
|
#
|
1116
1116
|
# ```python sync
|
1117
1117
|
# def handle_route(route):
|
1118
|
-
# if ("my-string" in route.request.post_data)
|
1118
|
+
# if ("my-string" in route.request.post_data):
|
1119
1119
|
# route.fulfill(body="mocked-data")
|
1120
|
-
# else
|
1120
|
+
# else:
|
1121
1121
|
# route.continue_()
|
1122
1122
|
# page.route("/api/**", handle_route)
|
1123
1123
|
# ```
|
@@ -1154,13 +1154,14 @@ module Playwright
|
|
1154
1154
|
clip: nil,
|
1155
1155
|
fullPage: nil,
|
1156
1156
|
mask: nil,
|
1157
|
+
maskColor: nil,
|
1157
1158
|
omitBackground: nil,
|
1158
1159
|
path: nil,
|
1159
1160
|
quality: nil,
|
1160
1161
|
scale: nil,
|
1161
1162
|
timeout: nil,
|
1162
1163
|
type: nil)
|
1163
|
-
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), clip: unwrap_impl(clip), fullPage: unwrap_impl(fullPage), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
1164
|
+
wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), clip: unwrap_impl(clip), fullPage: unwrap_impl(fullPage), mask: unwrap_impl(mask), maskColor: unwrap_impl(maskColor), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
1164
1165
|
end
|
1165
1166
|
|
1166
1167
|
#
|
@@ -77,17 +77,17 @@ module Playwright
|
|
77
77
|
# Terminates this instance of Playwright in case it was created bypassing the Python context manager. This is useful in REPL applications.
|
78
78
|
#
|
79
79
|
# ```py
|
80
|
-
#
|
80
|
+
# from playwright.sync_api import sync_playwright
|
81
81
|
#
|
82
|
-
#
|
82
|
+
# playwright = sync_playwright().start()
|
83
83
|
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
84
|
+
# browser = playwright.chromium.launch()
|
85
|
+
# page = browser.new_page()
|
86
|
+
# page.goto("https://playwright.dev/")
|
87
|
+
# page.screenshot(path="example.png")
|
88
|
+
# browser.close()
|
89
89
|
#
|
90
|
-
#
|
90
|
+
# playwright.stop()
|
91
91
|
# ```
|
92
92
|
def stop
|
93
93
|
raise NotImplementedError.new('stop is not implemented yet.')
|
@@ -118,13 +118,13 @@ 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 --
|
data/lib/playwright_api/route.rb
CHANGED
@@ -22,7 +22,7 @@ module Playwright
|
|
22
22
|
# # override headers
|
23
23
|
# headers = {
|
24
24
|
# **request.headers,
|
25
|
-
# "foo": "foo-value" # set "foo" header
|
25
|
+
# "foo": "foo-value", # set "foo" header
|
26
26
|
# "bar": None # remove "bar" header
|
27
27
|
# }
|
28
28
|
# route.continue_(headers=headers)
|
@@ -84,7 +84,7 @@ module Playwright
|
|
84
84
|
# # override headers
|
85
85
|
# headers = {
|
86
86
|
# **request.headers,
|
87
|
-
# "foo": "foo-value" # set "foo" header
|
87
|
+
# "foo": "foo-value", # set "foo" header
|
88
88
|
# "bar": None # remove "bar" header
|
89
89
|
# }
|
90
90
|
# route.fallback(headers=headers)
|
data/sig/playwright.rbs
CHANGED
@@ -118,7 +118,7 @@ module Playwright
|
|
118
118
|
def press: (String key, ?delay: Float, ?noWaitAfter: bool, ?timeout: Float) -> void
|
119
119
|
def query_selector: (String selector) -> (nil | ElementHandle)
|
120
120
|
def query_selector_all: (String selector) -> Array[untyped]
|
121
|
-
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?mask: Array[untyped], ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
121
|
+
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?mask: Array[untyped], ?maskColor: String, ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
122
122
|
def scroll_into_view_if_needed: (?timeout: Float) -> void
|
123
123
|
def select_option: (?element: (ElementHandle | Array[untyped]), ?index: (Integer | Array[untyped]), ?value: (String | Array[untyped]), ?label: (String | Array[untyped]), ?force: bool, ?noWaitAfter: bool, ?timeout: Float) -> Array[untyped]
|
124
124
|
def select_text: (?force: bool, ?timeout: Float) -> void
|
@@ -306,7 +306,7 @@ module Playwright
|
|
306
306
|
def reload: (?timeout: Float, ?waitUntil: ("load" | "domcontentloaded" | "networkidle" | "commit")) -> (nil | Response)
|
307
307
|
def route: ((String | Regexp | function) url, function handler, ?times: Integer) -> void
|
308
308
|
def route_from_har: ((String | File) har, ?notFound: ("abort" | "fallback"), ?update: bool, ?updateContent: ("embed" | "attach"), ?updateMode: ("full" | "minimal"), ?url: (String | Regexp)) -> void
|
309
|
-
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?clip: Hash[untyped, untyped], ?fullPage: bool, ?mask: Array[untyped], ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
309
|
+
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?clip: Hash[untyped, untyped], ?fullPage: bool, ?mask: Array[untyped], ?maskColor: String, ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
310
310
|
def select_option: (String selector, ?element: (ElementHandle | Array[untyped]), ?index: (Integer | Array[untyped]), ?value: (String | Array[untyped]), ?label: (String | Array[untyped]), ?force: bool, ?noWaitAfter: bool, ?strict: bool, ?timeout: Float) -> Array[untyped]
|
311
311
|
def set_checked: (String selector, bool checked, ?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
|
312
312
|
def set_content: (String html, ?timeout: Float, ?waitUntil: ("load" | "domcontentloaded" | "networkidle" | "commit")) -> void
|
@@ -483,7 +483,7 @@ module Playwright
|
|
483
483
|
def or: (Locator locator) -> Locator
|
484
484
|
def page: -> Page
|
485
485
|
def press: (String key, ?delay: Float, ?noWaitAfter: bool, ?timeout: Float) -> void
|
486
|
-
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?mask: Array[untyped], ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
486
|
+
def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?mask: Array[untyped], ?maskColor: String, ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?timeout: Float, ?type: ("png" | "jpeg")) -> String
|
487
487
|
def scroll_into_view_if_needed: (?timeout: Float) -> void
|
488
488
|
def select_option: (?element: (ElementHandle | Array[untyped]), ?index: (Integer | Array[untyped]), ?value: (String | Array[untyped]), ?label: (String | Array[untyped]), ?force: bool, ?noWaitAfter: bool, ?timeout: Float) -> Array[untyped]
|
489
489
|
def select_text: (?force: bool, ?timeout: Float) -> void
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -401,5 +401,5 @@ requirements: []
|
|
401
401
|
rubygems_version: 3.3.26
|
402
402
|
signing_key:
|
403
403
|
specification_version: 4
|
404
|
-
summary: The Ruby binding of playwright driver 1.
|
404
|
+
summary: The Ruby binding of playwright driver 1.36.1
|
405
405
|
test_files: []
|