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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e87b002bd3cd1dfaf592f6be37902b0a0604553d419b8b7516e0e887584125a
4
- data.tar.gz: 5b956c57000f12dc8399df4382dd301a7ef1d47551782afff0fae0871892c630
3
+ metadata.gz: 8d7e01f93c5fa8ffd804062e0414e9de40204674ef1b070f296c0108259ca015
4
+ data.tar.gz: 75bdb822a5c3cc8ffe7e8dc011d8697c2cb00aa95895e7486068c09839a9c667
5
5
  SHA512:
6
- metadata.gz: e3a418d6d40392a157016b164455e8cdc83bffb696c182d68d2ce10cb1e7315be151fb4be78e5b985871ba75ef1882be262d05c93a0b3a65a3c3b8b9c7373fb2
7
- data.tar.gz: db086e5ff1cdbc8cee9d1aea80601e2f9664c4806478aa556fd91e6b647bc71d23b9f0862ed60711365e06e67d513717c5e01b3d7b60c1a5b9438535ef8394e5
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) retuned by [BrowserContext#request](./browser_context#request) and [Page#request](./page#request) shares cookie storage
17
- with the corresponding [BrowserContext](./browser_context). Each API request will have `Cookie` header populated with the values from the
18
- browser context. If the API response contains `Set-Cookie` header it will automatically update [BrowserContext](./browser_context) cookies
19
- and requests made from the page will pick them up. This means that if you log in using this API, your e2e test will be
20
- logged in and vice versa.
21
-
22
- If you want API requests to not interfere with the browser cookies you shoud create a new [APIRequestContext](./api_request_context) by calling
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 explicilty close the returned
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 fullfilled by a Service Worker's Fetch Handler (i.e. via
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['APIRequestContext'])
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
- if method == "__dispose__"
145
- object = @objects[guid]
146
- unless object
147
- raise "Cannot find object to dispose: #{guid}"
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(:dispose!)
154
+ object.send(:adopt!, child)
150
155
  return
151
156
  end
152
157
 
153
- object = @objects[guid]
154
- unless object
155
- raise "Cannot find object to emit \"#{method}\": #{guid}"
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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.24.0'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.24.2'
4
+ VERSION = '1.25.0'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.25.0'
6
6
  end
@@ -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` retuned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie storage
12
- # with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the values from the
13
- # browser context. If the API response contains `Set-Cookie` header it will automatically update `BrowserContext` cookies
14
- # and requests made from the page will pick them up. This means that if you log in using this API, your e2e test will be
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 shoud create a new `APIRequestContext` by calling
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 vise versa.
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 explicilty close the returned
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
@@ -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 start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1414
- wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1416
+ def guid
1417
+ wrap_impl(@impl.guid)
1415
1418
  end
1416
1419
 
1417
1420
  # @nodoc
1418
- def guid
1419
- wrap_impl(@impl.guid)
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 fullfilled by a Service Worker's Fetch Handler (i.e. via
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 context=(req)
48
- wrap_impl(@impl.context=(unwrap_impl(req)))
47
+ def page=(req)
48
+ wrap_impl(@impl.page=(unwrap_impl(req)))
49
49
  end
50
50
 
51
51
  # @nodoc
52
- def page=(req)
53
- wrap_impl(@impl.page=(unwrap_impl(req)))
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.24.0
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-13 00:00:00.000000000 Z
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.24.2
402
+ summary: The Ruby binding of playwright driver 1.25.0
403
403
  test_files: []