playwright-ruby-client 1.56.0 → 1.57.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/console_message.md +9 -0
  3. data/documentation/docs/api/element_handle.md +2 -0
  4. data/documentation/docs/api/frame.md +1 -0
  5. data/documentation/docs/api/locator.md +22 -0
  6. data/documentation/docs/api/page.md +1 -2
  7. data/documentation/docs/api/worker.md +20 -0
  8. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +19 -0
  9. data/documentation/docs/article/guides/rails_integration.md +43 -2
  10. data/documentation/docs/include/api_coverage.md +3 -5
  11. data/documentation/package.json +2 -2
  12. data/documentation/yarn.lock +9003 -12370
  13. data/lib/playwright/channel_owners/browser_context.rb +5 -2
  14. data/lib/playwright/channel_owners/element_handle.rb +6 -2
  15. data/lib/playwright/channel_owners/frame.rb +9 -3
  16. data/lib/playwright/channel_owners/page.rb +30 -10
  17. data/lib/playwright/channel_owners/worker.rb +19 -0
  18. data/lib/playwright/console_message_impl.rb +3 -4
  19. data/lib/playwright/events.rb +1 -0
  20. data/lib/playwright/locator_impl.rb +25 -5
  21. data/lib/playwright/version.rb +2 -2
  22. data/lib/playwright/web_socket_transport.rb +1 -1
  23. data/lib/playwright.rb +4 -0
  24. data/lib/playwright_api/console_message.rb +6 -0
  25. data/lib/playwright_api/element_handle.rb +4 -2
  26. data/lib/playwright_api/frame.rb +2 -1
  27. data/lib/playwright_api/locator.rb +22 -3
  28. data/lib/playwright_api/page.rb +8 -11
  29. data/lib/playwright_api/worker.rb +17 -0
  30. data/sig/playwright.rbs +10 -12
  31. metadata +2 -5
  32. data/documentation/docs/api/accessibility.md +0 -66
  33. data/lib/playwright/accessibility_impl.rb +0 -50
  34. data/lib/playwright_api/accessibility.rb +0 -57
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.56.0
4
+ version: 1.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
@@ -208,7 +208,6 @@ files:
208
208
  - bin/setup
209
209
  - documentation/README.md
210
210
  - documentation/babel.config.js
211
- - documentation/docs/api/accessibility.md
212
211
  - documentation/docs/api/api_request.md
213
212
  - documentation/docs/api/api_request_context.md
214
213
  - documentation/docs/api/api_response.md
@@ -277,7 +276,6 @@ files:
277
276
  - documentation/static/img/undraw_windows.svg
278
277
  - documentation/yarn.lock
279
278
  - lib/playwright.rb
280
- - lib/playwright/accessibility_impl.rb
281
279
  - lib/playwright/android_input_impl.rb
282
280
  - lib/playwright/api_implementation.rb
283
281
  - lib/playwright/api_response_impl.rb
@@ -351,7 +349,6 @@ files:
351
349
  - lib/playwright/waiter.rb
352
350
  - lib/playwright/web_socket_client.rb
353
351
  - lib/playwright/web_socket_transport.rb
354
- - lib/playwright_api/accessibility.rb
355
352
  - lib/playwright_api/android.rb
356
353
  - lib/playwright_api/android_device.rb
357
354
  - lib/playwright_api/android_input.rb
@@ -410,5 +407,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
407
  requirements: []
411
408
  rubygems_version: 3.6.9
412
409
  specification_version: 4
413
- summary: The Ruby binding of playwright driver 1.56.1
410
+ summary: The Ruby binding of playwright driver 1.57.0
414
411
  test_files: []
@@ -1,66 +0,0 @@
1
- ---
2
- sidebar_position: 10
3
- ---
4
-
5
- # Accessibility
6
-
7
-
8
- The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
9
- assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
10
- [switches](https://en.wikipedia.org/wiki/Switch_access).
11
-
12
- Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might
13
- have wildly different output.
14
-
15
- Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated into different
16
- platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
17
-
18
- Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by
19
- assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the
20
- "interesting" nodes of the tree.
21
-
22
- ## snapshot
23
-
24
- ```
25
- def snapshot(interestingOnly: nil, root: nil)
26
- ```
27
-
28
- :::warning
29
-
30
- This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
31
-
32
- :::
33
-
34
-
35
- Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
36
- page.
37
-
38
- **NOTE**: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright
39
- will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
40
-
41
- **Usage**
42
-
43
- An example of dumping the entire accessibility tree:
44
-
45
- ```ruby
46
- snapshot = page.accessibility.snapshot
47
- puts snapshot
48
- ```
49
-
50
- An example of logging the focused node's name:
51
-
52
- ```ruby
53
- def find_focused_node(node)
54
- if node['focused']
55
- node
56
- else
57
- node['children']&.find do |child|
58
- find_focused_node(child)
59
- end
60
- end
61
- end
62
-
63
- snapshot = page.accessibility.snapshot
64
- node = find_focused_node(snapshot)
65
- puts node['name']
66
- ```
@@ -1,50 +0,0 @@
1
- module Playwright
2
- define_api_implementation :AccessibilityImpl do
3
- def initialize(channel)
4
- @channel = channel
5
- end
6
-
7
- def snapshot(interestingOnly: nil, root: nil)
8
- params = {
9
- interestingOnly: interestingOnly,
10
- root: root&.channel,
11
- }.compact
12
- result = @channel.send_message_to_server('accessibilitySnapshot', params)
13
- format_ax_node_from_protocol(result) if result
14
- result
15
- end
16
-
17
- # original JS implementation create a new Hash from ax_node,
18
- # but this implementation directly modify ax_node and don't return hash.
19
- private def format_ax_node_from_protocol(ax_node)
20
- value = ax_node.delete('valueNumber') || ax_node.delete('valueString')
21
- ax_node['value'] = value unless value.nil?
22
-
23
- checked =
24
- case ax_node['checked']
25
- when 'checked'
26
- true
27
- when 'unchecked'
28
- false
29
- else
30
- ax_node['checked']
31
- end
32
- ax_node['checked'] = checked unless checked.nil?
33
-
34
- pressed =
35
- case ax_node['pressed']
36
- when 'pressed'
37
- true
38
- when 'released'
39
- false
40
- else
41
- ax_node['pressed']
42
- end
43
- ax_node['pressed'] = pressed unless pressed.nil?
44
-
45
- ax_node['children']&.each do |child|
46
- format_ax_node_from_protocol(child)
47
- end
48
- end
49
- end
50
- end
@@ -1,57 +0,0 @@
1
- module Playwright
2
- #
3
- # The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
4
- # assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
5
- # [switches](https://en.wikipedia.org/wiki/Switch_access).
6
- #
7
- # Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might
8
- # have wildly different output.
9
- #
10
- # Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated into different
11
- # platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
12
- #
13
- # Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by
14
- # assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the
15
- # "interesting" nodes of the tree.
16
- class Accessibility < PlaywrightApi
17
-
18
- #
19
- # Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
20
- # page.
21
- #
22
- # **NOTE**: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright
23
- # will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
24
- #
25
- # **Usage**
26
- #
27
- # An example of dumping the entire accessibility tree:
28
- #
29
- # ```python sync
30
- # snapshot = page.accessibility.snapshot()
31
- # print(snapshot)
32
- # ```
33
- #
34
- # An example of logging the focused node's name:
35
- #
36
- # ```python sync
37
- # def find_focused_node(node):
38
- # if node.get("focused"):
39
- # return node
40
- # for child in (node.get("children") or []):
41
- # found_node = find_focused_node(child)
42
- # if found_node:
43
- # return found_node
44
- # return None
45
- #
46
- # snapshot = page.accessibility.snapshot()
47
- # node = find_focused_node(snapshot)
48
- # if node:
49
- # print(node["name"])
50
- # ```
51
- #
52
- # @deprecated This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
53
- def snapshot(interestingOnly: nil, root: nil)
54
- wrap_impl(@impl.snapshot(interestingOnly: unwrap_impl(interestingOnly), root: unwrap_impl(root)))
55
- end
56
- end
57
- end