playwright-ruby-client 1.35.0 → 1.37.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/browser_context.md +1 -1
- data/documentation/docs/api/frame.md +1 -0
- data/documentation/docs/api/locator.md +4 -3
- data/documentation/docs/api/page.md +6 -5
- data/documentation/docs/api/selectors.md +1 -1
- data/lib/playwright/channel_owners/artifact.rb +7 -0
- data/lib/playwright/channel_owners/browser.rb +12 -3
- data/lib/playwright/channel_owners/stream.rb +19 -4
- data/lib/playwright/javascript/value_parser.rb +4 -0
- data/lib/playwright/javascript/value_serializer.rb +5 -1
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/accessibility.rb +2 -2
- data/lib/playwright_api/browser_context.rb +3 -3
- data/lib/playwright_api/browser_type.rb +6 -1
- data/lib/playwright_api/element_handle.rb +1 -1
- data/lib/playwright_api/frame.rb +2 -0
- data/lib/playwright_api/js_handle.rb +1 -1
- data/lib/playwright_api/locator.rb +8 -8
- data/lib/playwright_api/page.rb +5 -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/lib/playwright_api/worker.rb +4 -4
- 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: 72247024abd6cfc5a96eb203f8f1bcbbca18dafacb48e83802dd464ed93f7d21
|
4
|
+
data.tar.gz: 2496de7896c09b6395f5d4c958617cfb03111f0a111ef7e50acadf8a90069e53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6e622cc2a84154728e92f524982cd5c5b62e82ce74c3c48e2806b168b9c828af3e864e99d9f4f880a394cfb9a0c911f4c9db10296fe78071038ef8fa609cb84
|
7
|
+
data.tar.gz: 41d756ca2590f37fffbc81fdb0306a76c06a462e1aa33aaad81e871aacc0e9d12fc6f2fb6df514f2a013fbc2afc82d1737100bfcf34f4ca4ef10c78502f2acf7
|
@@ -343,7 +343,7 @@ def route_from_har(
|
|
343
343
|
```
|
344
344
|
|
345
345
|
|
346
|
-
If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](https://playwright.dev/python/docs/
|
346
|
+
If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](https://playwright.dev/python/docs/mock#replaying-from-har).
|
347
347
|
|
348
348
|
Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
349
349
|
|
@@ -956,6 +956,7 @@ def set_content(html, timeout: nil, waitUntil: nil)
|
|
956
956
|
alias: `content=`
|
957
957
|
|
958
958
|
|
959
|
+
This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors.
|
959
960
|
|
960
961
|
## set_input_files
|
961
962
|
|
@@ -6,7 +6,7 @@ sidebar_position: 10
|
|
6
6
|
|
7
7
|
|
8
8
|
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent
|
9
|
-
a way to find element(s) on the page at any moment.
|
9
|
+
a way to find element(s) on the page at any moment. A locator can be created with the [Page#locator](./page#locator) method.
|
10
10
|
|
11
11
|
[Learn more about locators](https://playwright.dev/python/docs/locators).
|
12
12
|
|
@@ -17,8 +17,7 @@ def all
|
|
17
17
|
```
|
18
18
|
|
19
19
|
|
20
|
-
When locator points to a list of elements, returns array of locators, pointing
|
21
|
-
to respective elements.
|
20
|
+
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.
|
22
21
|
|
23
22
|
**NOTE**: [Locator#all](./locator#all) does not wait for elements to match the locator, and instead immediately returns whatever is present in the page.
|
24
23
|
|
@@ -1255,6 +1254,8 @@ def type(text, delay: nil, noWaitAfter: nil, timeout: nil)
|
|
1255
1254
|
```
|
1256
1255
|
|
1257
1256
|
|
1257
|
+
**NOTE**: In most cases, you should use [Locator#fill](./locator#fill) instead. You only need to type characters if there is special keyboard handling on the page.
|
1258
|
+
|
1258
1259
|
Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
|
1259
1260
|
|
1260
1261
|
To press a special key, like `Control` or `ArrowDown`, use [Locator#press](./locator#press).
|
@@ -1273,7 +1273,7 @@ def route_from_har(
|
|
1273
1273
|
```
|
1274
1274
|
|
1275
1275
|
|
1276
|
-
If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](https://playwright.dev/python/docs/
|
1276
|
+
If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](https://playwright.dev/python/docs/mock#replaying-from-har).
|
1277
1277
|
|
1278
1278
|
Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
1279
1279
|
|
@@ -1369,6 +1369,7 @@ def set_content(html, timeout: nil, waitUntil: nil)
|
|
1369
1369
|
alias: `content=`
|
1370
1370
|
|
1371
1371
|
|
1372
|
+
This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors.
|
1372
1373
|
|
1373
1374
|
## set_default_navigation_timeout
|
1374
1375
|
|
@@ -1741,7 +1742,7 @@ Waits for the matching request and returns it. See [waiting for event](https://p
|
|
1741
1742
|
```ruby
|
1742
1743
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger request" /></form>'
|
1743
1744
|
request = page.expect_request(/example.com\/resource/) do
|
1744
|
-
page.get_by_text("trigger request").click
|
1745
|
+
page.get_by_text("trigger request").click
|
1745
1746
|
end
|
1746
1747
|
puts request.headers
|
1747
1748
|
|
@@ -1750,7 +1751,7 @@ page.wait_for_load_state # wait for request finished.
|
|
1750
1751
|
# or with a predicate
|
1751
1752
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger request" /></form>'
|
1752
1753
|
request = page.expect_request(->(req) { req.url.start_with? 'https://example.com/resource' }) do
|
1753
|
-
page.get_by_text("trigger request").click
|
1754
|
+
page.get_by_text("trigger request").click
|
1754
1755
|
end
|
1755
1756
|
puts request.headers
|
1756
1757
|
```
|
@@ -1780,7 +1781,7 @@ Returns the matched response. See [waiting for event](https://playwright.dev/pyt
|
|
1780
1781
|
```ruby
|
1781
1782
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger response" /></form>'
|
1782
1783
|
response = page.expect_response(/example.com\/resource/) do
|
1783
|
-
page.get_by_text("trigger response").click
|
1784
|
+
page.get_by_text("trigger response").click
|
1784
1785
|
end
|
1785
1786
|
puts response.body
|
1786
1787
|
puts response.ok?
|
@@ -1790,7 +1791,7 @@ page.wait_for_load_state # wait for request finished.
|
|
1790
1791
|
# or with a predicate
|
1791
1792
|
page.content = '<form action="https://example.com/resource"><input type="submit" value="trigger response" /></form>'
|
1792
1793
|
response = page.expect_response(->(res) { res.url.start_with? 'https://example.com/resource' }) do
|
1793
|
-
page.get_by_text("trigger response").click
|
1794
|
+
page.get_by_text("trigger response").click
|
1794
1795
|
end
|
1795
1796
|
puts response.body
|
1796
1797
|
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.
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
|
1
3
|
module Playwright
|
2
4
|
define_channel_owner :Artifact do
|
3
5
|
private def after_initialize
|
@@ -18,6 +20,11 @@ module Playwright
|
|
18
20
|
stream.save_as(path)
|
19
21
|
end
|
20
22
|
|
23
|
+
def read_into_buffer
|
24
|
+
stream = ChannelOwners::Stream.from(@channel.send_message_to_server('stream'))
|
25
|
+
stream.read_all
|
26
|
+
end
|
27
|
+
|
21
28
|
def failure
|
22
29
|
@channel.send_message_to_server('failure')
|
23
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module Playwright
|
2
4
|
# @ref https://github.com/microsoft/playwright-python/blob/master/playwright/_impl/_browser.py
|
3
5
|
define_channel_owner :Browser do
|
@@ -86,16 +88,23 @@ module Playwright
|
|
86
88
|
params = {
|
87
89
|
page: page&.channel,
|
88
90
|
categories: categories,
|
89
|
-
path: path,
|
90
91
|
screenshots: screenshots,
|
91
92
|
}.compact
|
93
|
+
@cr_tracing_path = path
|
92
94
|
|
93
95
|
@channel.send_message_to_server('startTracing', params)
|
94
96
|
end
|
95
97
|
|
96
98
|
def stop_tracing
|
97
|
-
|
98
|
-
|
99
|
+
artifact = ChannelOwners::Artifact.from(@channel.send_message_to_server("stopTracing"))
|
100
|
+
data = artifact.read_into_buffer
|
101
|
+
if @cr_tracing_path
|
102
|
+
File.dirname(@cr_tracing_path).tap do |dir|
|
103
|
+
FileUtils.mkdir_p(dir) unless File.exist?(dir)
|
104
|
+
end
|
105
|
+
File.open(@cr_tracing_path, 'wb') { |f| f.write(data) }
|
106
|
+
end
|
107
|
+
data
|
99
108
|
end
|
100
109
|
|
101
110
|
private def on_close(_ = {})
|
@@ -4,12 +4,27 @@ module Playwright
|
|
4
4
|
define_channel_owner :Stream do
|
5
5
|
def save_as(path)
|
6
6
|
File.open(path, 'wb') do |f|
|
7
|
-
|
8
|
-
|
9
|
-
break if !binary || binary.length == 0
|
10
|
-
f.write(Base64.strict_decode64(binary))
|
7
|
+
read_with_block do |chunk|
|
8
|
+
f.write(chunk)
|
11
9
|
end
|
12
10
|
end
|
13
11
|
end
|
12
|
+
|
13
|
+
def read_all(&block)
|
14
|
+
out = StringIO.new
|
15
|
+
read_with_block do |chunk|
|
16
|
+
out.write(chunk)
|
17
|
+
end
|
18
|
+
out.string
|
19
|
+
end
|
20
|
+
|
21
|
+
private def read_with_block(&block)
|
22
|
+
loop do
|
23
|
+
binary = @channel.send_message_to_server('read', size: 1024 * 1024)
|
24
|
+
break if !binary || binary.length == 0
|
25
|
+
decoded_chunk = Base64.strict_decode64(binary)
|
26
|
+
block.call(decoded_chunk)
|
27
|
+
end
|
28
|
+
end
|
14
29
|
end
|
15
30
|
end
|
@@ -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
|
data/lib/playwright/version.rb
CHANGED
@@ -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
|
# ```
|
@@ -299,7 +299,7 @@ module Playwright
|
|
299
299
|
end
|
300
300
|
|
301
301
|
#
|
302
|
-
# If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../
|
302
|
+
# If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har).
|
303
303
|
#
|
304
304
|
# Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
305
305
|
def route_from_har(
|
@@ -21,7 +21,12 @@ module Playwright
|
|
21
21
|
|
22
22
|
#
|
23
23
|
# This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x).
|
24
|
-
def connect(
|
24
|
+
def connect(
|
25
|
+
wsEndpoint,
|
26
|
+
exposeNetwork: nil,
|
27
|
+
headers: nil,
|
28
|
+
slowMo: nil,
|
29
|
+
timeout: nil)
|
25
30
|
raise NotImplementedError.new('connect is not implemented yet.')
|
26
31
|
end
|
27
32
|
|
@@ -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)))
|
data/lib/playwright_api/frame.rb
CHANGED
@@ -802,6 +802,8 @@ module Playwright
|
|
802
802
|
wrap_impl(@impl.set_checked(unwrap_impl(selector), unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
803
803
|
end
|
804
804
|
|
805
|
+
#
|
806
|
+
# This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors.
|
805
807
|
def set_content(html, timeout: nil, waitUntil: nil)
|
806
808
|
wrap_impl(@impl.set_content(unwrap_impl(html), timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
807
809
|
end
|
@@ -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")
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module Playwright
|
2
2
|
#
|
3
3
|
# Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent
|
4
|
-
# a way to find element(s) on the page at any moment.
|
4
|
+
# a way to find element(s) on the page at any moment. A locator can be created with the [`method: Page.locator`] method.
|
5
5
|
#
|
6
6
|
# [Learn more about locators](../locators.md).
|
7
7
|
class Locator < PlaywrightApi
|
8
8
|
|
9
9
|
#
|
10
|
-
# When locator points to a list of elements, returns array of locators, pointing
|
11
|
-
# to respective elements.
|
10
|
+
# When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.
|
12
11
|
#
|
13
12
|
# **NOTE**: [`method: Locator.all`] does not wait for elements to match the locator, and instead immediately returns whatever is present in the page.
|
14
13
|
#
|
@@ -406,10 +405,9 @@ module Playwright
|
|
406
405
|
# ```python sync
|
407
406
|
# row_locator = page.locator("tr")
|
408
407
|
# # ...
|
409
|
-
# row_locator
|
410
|
-
# .
|
411
|
-
#
|
412
|
-
# .screenshot()
|
408
|
+
# row_locator.filter(has_text="text in column 1").filter(
|
409
|
+
# has=page.get_by_role("button", name="column 2 button")
|
410
|
+
# ).screenshot()
|
413
411
|
# ```
|
414
412
|
def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
|
415
413
|
wrap_impl(@impl.filter(has: unwrap_impl(has), hasNot: unwrap_impl(hasNot), hasNotText: unwrap_impl(hasNotText), hasText: unwrap_impl(hasText)))
|
@@ -823,7 +821,7 @@ module Playwright
|
|
823
821
|
# new_email = page.get_by_role("button", name="New")
|
824
822
|
# dialog = page.get_by_text("Confirm security settings")
|
825
823
|
# expect(new_email.or_(dialog)).to_be_visible()
|
826
|
-
# if (dialog.is_visible())
|
824
|
+
# if (dialog.is_visible()):
|
827
825
|
# page.get_by_role("button", name="Dismiss").click()
|
828
826
|
# new_email.click()
|
829
827
|
# ```
|
@@ -1068,6 +1066,8 @@ module Playwright
|
|
1068
1066
|
wrap_impl(@impl.text_content(timeout: unwrap_impl(timeout)))
|
1069
1067
|
end
|
1070
1068
|
|
1069
|
+
#
|
1070
|
+
# **NOTE**: In most cases, you should use [`method: Locator.fill`] instead. You only need to type characters if there is special keyboard handling on the page.
|
1071
1071
|
#
|
1072
1072
|
# Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
|
1073
1073
|
#
|
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
|
# ```
|
@@ -1133,7 +1133,7 @@ module Playwright
|
|
1133
1133
|
end
|
1134
1134
|
|
1135
1135
|
#
|
1136
|
-
# If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](../
|
1136
|
+
# If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har).
|
1137
1137
|
#
|
1138
1138
|
# Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
|
1139
1139
|
def route_from_har(
|
@@ -1221,6 +1221,8 @@ module Playwright
|
|
1221
1221
|
wrap_impl(@impl.set_checked(unwrap_impl(selector), unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
1222
1222
|
end
|
1223
1223
|
|
1224
|
+
#
|
1225
|
+
# This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors.
|
1224
1226
|
def set_content(html, timeout: nil, waitUntil: nil)
|
1225
1227
|
wrap_impl(@impl.set_content(unwrap_impl(html), timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
1226
1228
|
end
|
@@ -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 ok?
|
122
|
+
wrap_impl(@impl.ok?)
|
123
123
|
end
|
124
124
|
|
125
125
|
# @nodoc
|
126
|
-
def
|
127
|
-
wrap_impl(@impl.
|
126
|
+
def from_service_worker?
|
127
|
+
wrap_impl(@impl.from_service_worker?)
|
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)
|
@@ -47,13 +47,13 @@ module Playwright
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# @nodoc
|
50
|
-
def
|
51
|
-
wrap_impl(@impl.
|
50
|
+
def page=(req)
|
51
|
+
wrap_impl(@impl.page=(unwrap_impl(req)))
|
52
52
|
end
|
53
53
|
|
54
54
|
# @nodoc
|
55
|
-
def
|
56
|
-
wrap_impl(@impl.
|
55
|
+
def context=(req)
|
56
|
+
wrap_impl(@impl.context=(unwrap_impl(req)))
|
57
57
|
end
|
58
58
|
|
59
59
|
# -- inherited from EventEmitter --
|
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.37.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-08-11 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.37.0
|
405
405
|
test_files: []
|