playwright-ruby-client 1.52.0 → 1.53.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/experimental/android.md +10 -0
  3. data/documentation/docs/api/locator.md +24 -1
  4. data/documentation/docs/api/locator_assertions.md +4 -7
  5. data/documentation/docs/api/page.md +1 -1
  6. data/documentation/docs/api/selectors.md +10 -0
  7. data/documentation/docs/api/tracing.md +8 -0
  8. data/documentation/docs/include/api_coverage.md +3 -2
  9. data/lib/playwright/channel.rb +6 -3
  10. data/lib/playwright/channel_owners/android.rb +12 -0
  11. data/lib/playwright/channel_owners/android_device.rb +6 -5
  12. data/lib/playwright/channel_owners/api_request_context.rb +6 -1
  13. data/lib/playwright/channel_owners/browser.rb +37 -6
  14. data/lib/playwright/channel_owners/browser_context.rb +44 -23
  15. data/lib/playwright/channel_owners/browser_type.rb +45 -12
  16. data/lib/playwright/channel_owners/element_handle.rb +22 -17
  17. data/lib/playwright/channel_owners/frame.rb +40 -33
  18. data/lib/playwright/channel_owners/page.rb +19 -8
  19. data/lib/playwright/channel_owners/playwright.rb +10 -4
  20. data/lib/playwright/channel_owners/web_socket.rb +1 -1
  21. data/lib/playwright/connection.rb +3 -0
  22. data/lib/playwright/file_chooser_impl.rb +3 -2
  23. data/lib/playwright/frame_locator_impl.rb +5 -8
  24. data/lib/playwright/locator_assertions_impl.rb +64 -34
  25. data/lib/playwright/locator_impl.rb +31 -20
  26. data/lib/playwright/page_assertions_impl.rb +10 -8
  27. data/lib/playwright/selectors_impl.rb +45 -0
  28. data/lib/playwright/test.rb +21 -3
  29. data/lib/playwright/timeout_settings.rb +5 -0
  30. data/lib/playwright/utils.rb +0 -33
  31. data/lib/playwright/version.rb +2 -2
  32. data/lib/playwright_api/android.rb +12 -7
  33. data/lib/playwright_api/android_device.rb +8 -8
  34. data/lib/playwright_api/api_request_context.rb +6 -6
  35. data/lib/playwright_api/browser.rb +6 -6
  36. data/lib/playwright_api/browser_context.rb +10 -10
  37. data/lib/playwright_api/browser_type.rb +6 -6
  38. data/lib/playwright_api/cdp_session.rb +6 -6
  39. data/lib/playwright_api/dialog.rb +6 -6
  40. data/lib/playwright_api/element_handle.rb +6 -6
  41. data/lib/playwright_api/frame.rb +6 -6
  42. data/lib/playwright_api/js_handle.rb +6 -6
  43. data/lib/playwright_api/locator.rb +30 -4
  44. data/lib/playwright_api/locator_assertions.rb +3 -3
  45. data/lib/playwright_api/page.rb +13 -8
  46. data/lib/playwright_api/playwright.rb +6 -6
  47. data/lib/playwright_api/request.rb +8 -8
  48. data/lib/playwright_api/response.rb +6 -6
  49. data/lib/playwright_api/route.rb +6 -6
  50. data/lib/playwright_api/selectors.rb +1 -28
  51. data/lib/playwright_api/tracing.rb +14 -6
  52. data/lib/playwright_api/web_socket.rb +6 -6
  53. data/lib/playwright_api/worker.rb +8 -8
  54. data/sig/playwright.rbs +6 -1
  55. metadata +4 -4
  56. data/lib/playwright/channel_owners/selectors.rb +0 -26
@@ -2,6 +2,10 @@ module Playwright
2
2
  #
3
3
  # API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](../trace-viewer.md) after Playwright script runs.
4
4
  #
5
+ # **NOTE**: You probably want to [enable tracing in your config file](https://playwright.dev/docs/api/class-testoptions#test-options-trace) instead of using `context.tracing`.
6
+ #
7
+ # The `context.tracing` API captures browser operations and network activity, but it doesn't record test assertions (like `expect` calls). We recommend [enabling tracing through Playwright Test configuration](https://playwright.dev/docs/api/class-testoptions#test-options-trace), which includes those assertions and provides a more complete trace for debugging test failures.
8
+ #
5
9
  # Start recording a trace before performing actions. At the end, stop tracing and save it to a file.
6
10
  #
7
11
  # ```python sync
@@ -17,6 +21,10 @@ module Playwright
17
21
  #
18
22
  # Start tracing.
19
23
  #
24
+ # **NOTE**: You probably want to [enable tracing in your config file](https://playwright.dev/docs/api/class-testoptions#test-options-trace) instead of using `Tracing.start`.
25
+ #
26
+ # The `context.tracing` API captures browser operations and network activity, but it doesn't record test assertions (like `expect` calls). We recommend [enabling tracing through Playwright Test configuration](https://playwright.dev/docs/api/class-testoptions#test-options-trace), which includes those assertions and provides a more complete trace for debugging test failures.
27
+ #
20
28
  # **Usage**
21
29
  #
22
30
  # ```python sync
@@ -97,20 +105,20 @@ module Playwright
97
105
 
98
106
  # -- inherited from EventEmitter --
99
107
  # @nodoc
100
- def on(event, callback)
101
- event_emitter_proxy.on(event, callback)
108
+ def once(event, callback)
109
+ event_emitter_proxy.once(event, callback)
102
110
  end
103
111
 
104
112
  # -- inherited from EventEmitter --
105
113
  # @nodoc
106
- def off(event, callback)
107
- event_emitter_proxy.off(event, callback)
114
+ def on(event, callback)
115
+ event_emitter_proxy.on(event, callback)
108
116
  end
109
117
 
110
118
  # -- inherited from EventEmitter --
111
119
  # @nodoc
112
- def once(event, callback)
113
- event_emitter_proxy.once(event, callback)
120
+ def off(event, callback)
121
+ event_emitter_proxy.off(event, callback)
114
122
  end
115
123
 
116
124
  private def event_emitter_proxy
@@ -36,20 +36,20 @@ module Playwright
36
36
 
37
37
  # -- inherited from EventEmitter --
38
38
  # @nodoc
39
- def on(event, callback)
40
- event_emitter_proxy.on(event, callback)
39
+ def once(event, callback)
40
+ event_emitter_proxy.once(event, callback)
41
41
  end
42
42
 
43
43
  # -- inherited from EventEmitter --
44
44
  # @nodoc
45
- def off(event, callback)
46
- event_emitter_proxy.off(event, callback)
45
+ def on(event, callback)
46
+ event_emitter_proxy.on(event, callback)
47
47
  end
48
48
 
49
49
  # -- inherited from EventEmitter --
50
50
  # @nodoc
51
- def once(event, callback)
52
- event_emitter_proxy.once(event, callback)
51
+ def off(event, callback)
52
+ event_emitter_proxy.off(event, callback)
53
53
  end
54
54
 
55
55
  private def event_emitter_proxy
@@ -46,14 +46,20 @@ module Playwright
46
46
  wrap_impl(@impl.url)
47
47
  end
48
48
 
49
+ # @nodoc
50
+ def page=(req)
51
+ wrap_impl(@impl.page=(unwrap_impl(req)))
52
+ end
53
+
49
54
  # @nodoc
50
55
  def context=(req)
51
56
  wrap_impl(@impl.context=(unwrap_impl(req)))
52
57
  end
53
58
 
59
+ # -- inherited from EventEmitter --
54
60
  # @nodoc
55
- def page=(req)
56
- wrap_impl(@impl.page=(unwrap_impl(req)))
61
+ def once(event, callback)
62
+ event_emitter_proxy.once(event, callback)
57
63
  end
58
64
 
59
65
  # -- inherited from EventEmitter --
@@ -68,12 +74,6 @@ module Playwright
68
74
  event_emitter_proxy.off(event, callback)
69
75
  end
70
76
 
71
- # -- inherited from EventEmitter --
72
- # @nodoc
73
- def once(event, callback)
74
- event_emitter_proxy.once(event, callback)
75
- end
76
-
77
77
  private def event_emitter_proxy
78
78
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
79
79
  end
data/sig/playwright.rbs CHANGED
@@ -218,6 +218,8 @@ module Playwright
218
218
 
219
219
  class Selectors
220
220
  def register: (String name, ?script: String, ?contentScript: bool, ?path: (String | File)) -> void
221
+ def set_test_id_attribute: (String attributeName) -> void
222
+ def test_id_attribute=: (String attributeName) -> void
221
223
  end
222
224
 
223
225
  class Clock
@@ -456,7 +458,7 @@ module Playwright
456
458
  def all_inner_texts: -> Array[untyped]
457
459
  def all_text_contents: -> Array[untyped]
458
460
  def and: (Locator locator) -> Locator
459
- def aria_snapshot: (?ref: bool, ?timeout: Float) -> String
461
+ def aria_snapshot: (?timeout: Float) -> String
460
462
  def blur: (?timeout: Float) -> void
461
463
  def bounding_box: (?timeout: Float) -> (nil | Hash[untyped, untyped])
462
464
  def check: (?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
@@ -464,6 +466,7 @@ module Playwright
464
466
  def click: (?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
465
467
  def count: -> Integer
466
468
  def dblclick: (?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
469
+ def describe: (String description) -> Locator
467
470
  def dispatch_event: (String type_, ?eventInit: untyped, ?timeout: Float) -> void
468
471
  def drag_to: (Locator target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
469
472
  def element_handle: (?timeout: Float) -> ElementHandle
@@ -623,6 +626,8 @@ module Playwright
623
626
 
624
627
  class Android
625
628
  def devices: (?host: String, ?omitDriverInstall: bool, ?port: Integer) -> Array[untyped]
629
+ def set_default_timeout: (Float timeout) -> void
630
+ def default_timeout=: (Float timeout) -> void
626
631
  end
627
632
 
628
633
  class AndroidDevice
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.52.0
4
+ version: 1.53.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
@@ -303,7 +303,6 @@ files:
303
303
  - lib/playwright/channel_owners/request.rb
304
304
  - lib/playwright/channel_owners/response.rb
305
305
  - lib/playwright/channel_owners/route.rb
306
- - lib/playwright/channel_owners/selectors.rb
307
306
  - lib/playwright/channel_owners/stream.rb
308
307
  - lib/playwright/channel_owners/tracing.rb
309
308
  - lib/playwright/channel_owners/web_socket.rb
@@ -339,6 +338,7 @@ files:
339
338
  - lib/playwright/raw_headers.rb
340
339
  - lib/playwright/route_handler.rb
341
340
  - lib/playwright/select_option_values.rb
341
+ - lib/playwright/selectors_impl.rb
342
342
  - lib/playwright/test.rb
343
343
  - lib/playwright/timeout_settings.rb
344
344
  - lib/playwright/touchscreen_impl.rb
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  - !ruby/object:Gem::Version
408
408
  version: '0'
409
409
  requirements: []
410
- rubygems_version: 3.6.7
410
+ rubygems_version: 3.6.9
411
411
  specification_version: 4
412
- summary: The Ruby binding of playwright driver 1.52.0
412
+ summary: The Ruby binding of playwright driver 1.53.0
413
413
  test_files: []
@@ -1,26 +0,0 @@
1
- module Playwright
2
- # https://github.com/microsoft/playwright-python/blob/master/playwright/_impl/_selectors.py
3
- define_channel_owner :Selectors do
4
- def register(name, contentScript: nil, path: nil, script: nil)
5
- source =
6
- if path
7
- File.read(path)
8
- elsif script
9
- script
10
- else
11
- raise ArgumentError.new('Either path or script parameter must be specified')
12
- end
13
- params = { name: name, source: source }
14
- if contentScript
15
- params[:contentScript] = true
16
- end
17
- @channel.send_message_to_server('register', params)
18
-
19
- nil
20
- end
21
-
22
- def text_id_attribute=(attribute_name)
23
- ::Playwright::LocatorUtils.instance_variable_set(:@test_id_attribute_name, attribute_name)
24
- end
25
- end
26
- end