playwright-ruby-client 1.24.0 → 1.25.0
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 +8 -0
- data/documentation/docs/api/api_request_context.md +8 -8
- data/documentation/docs/api/browser.md +1 -1
- data/documentation/docs/api/page.md +4 -0
- data/documentation/docs/api/response.md +1 -1
- data/lib/playwright/channel_owner.rb +13 -1
- data/lib/playwright/channel_owners/browser_context.rb +1 -1
- data/lib/playwright/connection.rb +14 -8
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/accessibility.rb +8 -0
- data/lib/playwright_api/api_request_context.rb +8 -8
- data/lib/playwright_api/browser.rb +1 -1
- data/lib/playwright_api/browser_type.rb +3 -1
- data/lib/playwright_api/page.rb +7 -4
- data/lib/playwright_api/response.rb +1 -1
- 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: 8d7e01f93c5fa8ffd804062e0414e9de40204674ef1b070f296c0108259ca015
|
4
|
+
data.tar.gz: 75bdb822a5c3cc8ffe7e8dc011d8697c2cb00aa95895e7486068c09839a9c667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9499d48e15c5201718f8e4569f1e28b5f66d2bd14c11b4c3a1c98c4e4ca2c39ababc74b3af1db1e2bcabbc4234fd6034eaa0c71b09b925654c468fdf65dd0547
|
7
|
+
data.tar.gz: 622a2e2bd96af9e65255b1abdb52f5768091af4cc8d5a6368b60237e363a8cd3bdbc1673ef1d745d017583206b6d8011f92300228b27a14e69bdc6558392de30
|
@@ -4,6 +4,10 @@ sidebar_position: 10
|
|
4
4
|
|
5
5
|
# Accessibility
|
6
6
|
|
7
|
+
**DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
8
|
+
need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
9
|
+
integration with Axe.
|
10
|
+
|
7
11
|
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
|
8
12
|
assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
|
9
13
|
[switches](https://en.wikipedia.org/wiki/Switch_access).
|
@@ -24,6 +28,10 @@ only the "interesting" nodes of the tree.
|
|
24
28
|
def snapshot(interestingOnly: nil, root: nil)
|
25
29
|
```
|
26
30
|
|
31
|
+
**DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
32
|
+
need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
33
|
+
integration with Axe.
|
34
|
+
|
27
35
|
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
|
28
36
|
page.
|
29
37
|
|
@@ -13,14 +13,14 @@ possible to create a new APIRequestContext instance manually by calling [APIRequ
|
|
13
13
|
|
14
14
|
**Cookie management**
|
15
15
|
|
16
|
-
[APIRequestContext](./api_request_context)
|
17
|
-
with the corresponding [BrowserContext](./browser_context). Each API request will have `Cookie` header populated with the values
|
18
|
-
browser context. If the API response contains `Set-Cookie` header it will automatically update [BrowserContext](./browser_context)
|
19
|
-
and requests made from the page will pick them up. This means that if you log in using this API, your e2e test
|
20
|
-
logged in and vice versa.
|
21
|
-
|
22
|
-
If you want API requests to not interfere with the browser cookies you
|
23
|
-
[APIRequest#new_context](./api_request#new_context). Such [APIRequestContext](./api_request_context) object will have its own isolated cookie storage.
|
16
|
+
[APIRequestContext](./api_request_context) returned by [BrowserContext#request](./browser_context#request) and [Page#request](./page#request) shares cookie
|
17
|
+
storage with the corresponding [BrowserContext](./browser_context). Each API request will have `Cookie` header populated with the values
|
18
|
+
from the browser context. If the API response contains `Set-Cookie` header it will automatically update [BrowserContext](./browser_context)
|
19
|
+
cookies and requests made from the page will pick them up. This means that if you log in using this API, your e2e test
|
20
|
+
will be logged in and vice versa.
|
21
|
+
|
22
|
+
If you want API requests to not interfere with the browser cookies you should create a new [APIRequestContext](./api_request_context) by
|
23
|
+
calling [APIRequest#new_context](./api_request#new_context). Such [APIRequestContext](./api_request_context) object will have its own isolated cookie storage.
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
playwright.chromium.launch do |browser|
|
@@ -125,7 +125,7 @@ def new_context(
|
|
125
125
|
|
126
126
|
Creates a new browser context. It won't share cookies/cache with other browser contexts.
|
127
127
|
|
128
|
-
> NOTE: If directly using this method to create [BrowserContext](./browser_context)s, it is best practice to
|
128
|
+
> NOTE: If directly using this method to create [BrowserContext](./browser_context)s, it is best practice to explicitly close the returned
|
129
129
|
context via [BrowserContext#close](./browser_context#close) when your code is done with the [BrowserContext](./browser_context), and before calling
|
130
130
|
[Browser#close](./browser#close). This will ensure the `context` is closed gracefully and any artifacts—like HARs and
|
131
131
|
videos—are fully flushed and saved.
|
@@ -1622,6 +1622,10 @@ associated with the page.
|
|
1622
1622
|
|
1623
1623
|
## accessibility
|
1624
1624
|
|
1625
|
+
**DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
1626
|
+
need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
1627
|
+
integration with Axe.
|
1628
|
+
|
1625
1629
|
## keyboard
|
1626
1630
|
|
1627
1631
|
## mouse
|
@@ -44,7 +44,7 @@ Returns the [Frame](./frame) that initiated this response.
|
|
44
44
|
def from_service_worker
|
45
45
|
```
|
46
46
|
|
47
|
-
Indicates whether this Response was
|
47
|
+
Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via
|
48
48
|
[FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).
|
49
49
|
|
50
50
|
## headers
|
@@ -42,10 +42,16 @@ module Playwright
|
|
42
42
|
|
43
43
|
attr_reader :channel
|
44
44
|
|
45
|
+
private def adopt!(child)
|
46
|
+
unless child.is_a?(ChannelOwner)
|
47
|
+
raise ArgumentError.new("child must be a ChannelOwner: #{child.inspect}")
|
48
|
+
end
|
49
|
+
child.send(:update_parent, self)
|
50
|
+
end
|
51
|
+
|
45
52
|
# used only from Connection. Not intended for public use. So keep private.
|
46
53
|
private def dispose!
|
47
54
|
# Clean up from parent and connection.
|
48
|
-
@parent&.send(:delete_object_from_child, @guid)
|
49
55
|
@connection.send(:delete_object_from_channel_owner, @guid)
|
50
56
|
|
51
57
|
# Dispose all children.
|
@@ -65,6 +71,12 @@ module Playwright
|
|
65
71
|
private def after_initialize
|
66
72
|
end
|
67
73
|
|
74
|
+
private def update_parent(new_parent)
|
75
|
+
@parent.send(:delete_object_from_child, @guid)
|
76
|
+
new_parent.send(:update_object_from_child, @guid, self)
|
77
|
+
@parent = new_parent
|
78
|
+
end
|
79
|
+
|
68
80
|
private def update_object_from_child(guid, child)
|
69
81
|
@objects[guid] = child
|
70
82
|
end
|
@@ -18,7 +18,7 @@ module Playwright
|
|
18
18
|
@owner_page = nil
|
19
19
|
|
20
20
|
@tracing = ChannelOwners::Tracing.from(@initializer['tracing'])
|
21
|
-
@request = ChannelOwners::APIRequestContext.from(@initializer['
|
21
|
+
@request = ChannelOwners::APIRequestContext.from(@initializer['requestContext'])
|
22
22
|
@har_recorders = {}
|
23
23
|
|
24
24
|
@channel.on('bindingCall', ->(params) { on_binding(ChannelOwners::BindingCall.from(params['binding'])) })
|
@@ -141,19 +141,25 @@ module Playwright
|
|
141
141
|
return
|
142
142
|
end
|
143
143
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
144
|
+
object = @objects[guid]
|
145
|
+
unless object
|
146
|
+
raise "Cannot find object to \"#{method}\": #{guid}"
|
147
|
+
end
|
148
|
+
|
149
|
+
if method == "__adopt__"
|
150
|
+
child = @objects[params["guid"]]
|
151
|
+
unless child
|
152
|
+
raise "Unknown new child: #{params['guid']}"
|
148
153
|
end
|
149
|
-
object.send(:
|
154
|
+
object.send(:adopt!, child)
|
150
155
|
return
|
151
156
|
end
|
152
157
|
|
153
|
-
|
154
|
-
|
155
|
-
|
158
|
+
if method == "__dispose__"
|
159
|
+
object.send(:dispose!)
|
160
|
+
return
|
156
161
|
end
|
162
|
+
|
157
163
|
object.channel.emit(method, replace_guids_with_channels(params))
|
158
164
|
end
|
159
165
|
|
data/lib/playwright/version.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
module Playwright
|
2
|
+
# **DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
3
|
+
# need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
4
|
+
# integration with Axe.
|
5
|
+
#
|
2
6
|
# The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
|
3
7
|
# assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
|
4
8
|
# [switches](https://en.wikipedia.org/wiki/Switch_access).
|
@@ -14,6 +18,10 @@ module Playwright
|
|
14
18
|
# only the "interesting" nodes of the tree.
|
15
19
|
class Accessibility < PlaywrightApi
|
16
20
|
|
21
|
+
# **DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
22
|
+
# need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
23
|
+
# integration with Axe.
|
24
|
+
#
|
17
25
|
# Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
|
18
26
|
# page.
|
19
27
|
#
|
@@ -8,14 +8,14 @@ module Playwright
|
|
8
8
|
#
|
9
9
|
# **Cookie management**
|
10
10
|
#
|
11
|
-
# `APIRequestContext`
|
12
|
-
# with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the values
|
13
|
-
# browser context. If the API response contains `Set-Cookie` header it will automatically update `BrowserContext`
|
14
|
-
# and requests made from the page will pick them up. This means that if you log in using this API, your e2e test
|
15
|
-
# logged in and vice versa.
|
11
|
+
# `APIRequestContext` returned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie
|
12
|
+
# storage with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the values
|
13
|
+
# from the browser context. If the API response contains `Set-Cookie` header it will automatically update `BrowserContext`
|
14
|
+
# cookies and requests made from the page will pick them up. This means that if you log in using this API, your e2e test
|
15
|
+
# will be logged in and vice versa.
|
16
16
|
#
|
17
|
-
# If you want API requests to not interfere with the browser cookies you
|
18
|
-
# [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie storage.
|
17
|
+
# If you want API requests to not interfere with the browser cookies you should create a new `APIRequestContext` by
|
18
|
+
# calling [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie storage.
|
19
19
|
#
|
20
20
|
# ```python sync
|
21
21
|
# import os
|
@@ -28,7 +28,7 @@ module Playwright
|
|
28
28
|
# with sync_playwright() as p:
|
29
29
|
# # This will launch a new browser, create a context and page. When making HTTP
|
30
30
|
# # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)
|
31
|
-
# # it will automatically set the cookies to the browser page and
|
31
|
+
# # it will automatically set the cookies to the browser page and vice versa.
|
32
32
|
# browser = p.chromium.launch()
|
33
33
|
# context = browser.new_context(base_url="https://api.github.com")
|
34
34
|
# api_request_context = context.request
|
@@ -64,7 +64,7 @@ module Playwright
|
|
64
64
|
|
65
65
|
# Creates a new browser context. It won't share cookies/cache with other browser contexts.
|
66
66
|
#
|
67
|
-
# > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to
|
67
|
+
# > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned
|
68
68
|
# context via [`method: BrowserContext.close`] when your code is done with the `BrowserContext`, and before calling
|
69
69
|
# [`method: Browser.close`]. This will ensure the `context` is closed gracefully and any artifacts—like HARs and
|
70
70
|
# videos—are fully flushed and saved.
|
@@ -18,7 +18,9 @@ module Playwright
|
|
18
18
|
# ```
|
19
19
|
class BrowserType < PlaywrightApi
|
20
20
|
|
21
|
-
# This method attaches Playwright to an existing browser instance.
|
21
|
+
# This method attaches Playwright to an existing browser instance. When connecting to another browser launched via
|
22
|
+
# `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is
|
23
|
+
# compatible with 1.2.x).
|
22
24
|
def connect(wsEndpoint, headers: nil, slowMo: nil, timeout: nil)
|
23
25
|
raise NotImplementedError.new('connect is not implemented yet.')
|
24
26
|
end
|
data/lib/playwright_api/page.rb
CHANGED
@@ -44,6 +44,9 @@ module Playwright
|
|
44
44
|
# ```
|
45
45
|
class Page < PlaywrightApi
|
46
46
|
|
47
|
+
# **DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
|
48
|
+
# need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
|
49
|
+
# integration with Axe.
|
47
50
|
def accessibility # property
|
48
51
|
wrap_impl(@impl.accessibility)
|
49
52
|
end
|
@@ -1410,13 +1413,13 @@ module Playwright
|
|
1410
1413
|
end
|
1411
1414
|
|
1412
1415
|
# @nodoc
|
1413
|
-
def
|
1414
|
-
wrap_impl(@impl.
|
1416
|
+
def guid
|
1417
|
+
wrap_impl(@impl.guid)
|
1415
1418
|
end
|
1416
1419
|
|
1417
1420
|
# @nodoc
|
1418
|
-
def
|
1419
|
-
wrap_impl(@impl.
|
1421
|
+
def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
1422
|
+
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
1420
1423
|
end
|
1421
1424
|
|
1422
1425
|
# @nodoc
|
@@ -22,7 +22,7 @@ module Playwright
|
|
22
22
|
wrap_impl(@impl.frame)
|
23
23
|
end
|
24
24
|
|
25
|
-
# Indicates whether this Response was
|
25
|
+
# Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via
|
26
26
|
# [FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).
|
27
27
|
def from_service_worker
|
28
28
|
wrap_impl(@impl.from_service_worker)
|
@@ -44,13 +44,13 @@ module Playwright
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# @nodoc
|
47
|
-
def
|
48
|
-
wrap_impl(@impl.
|
47
|
+
def page=(req)
|
48
|
+
wrap_impl(@impl.page=(unwrap_impl(req)))
|
49
49
|
end
|
50
50
|
|
51
51
|
# @nodoc
|
52
|
-
def
|
53
|
-
wrap_impl(@impl.
|
52
|
+
def context=(req)
|
53
|
+
wrap_impl(@impl.context=(unwrap_impl(req)))
|
54
54
|
end
|
55
55
|
|
56
56
|
# -- 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.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -399,5 +399,5 @@ requirements: []
|
|
399
399
|
rubygems_version: 3.3.7
|
400
400
|
signing_key:
|
401
401
|
specification_version: 4
|
402
|
-
summary: The Ruby binding of playwright driver 1.
|
402
|
+
summary: The Ruby binding of playwright driver 1.25.0
|
403
403
|
test_files: []
|