playwright-ruby-client 1.57.0 → 1.59.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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/documentation/docs/api/browser_context.md +26 -0
  4. data/documentation/docs/api/browser_type.md +3 -2
  5. data/documentation/docs/api/console_message.md +9 -0
  6. data/documentation/docs/api/frame.md +2 -2
  7. data/documentation/docs/api/frame_locator.md +2 -2
  8. data/documentation/docs/api/locator.md +17 -4
  9. data/documentation/docs/api/locator_assertions.md +1 -1
  10. data/documentation/docs/api/page.md +68 -5
  11. data/documentation/docs/api/request.md +13 -0
  12. data/documentation/docs/api/response.md +9 -0
  13. data/documentation/docs/api/route.md +4 -1
  14. data/documentation/docs/api/tracing.md +1 -0
  15. data/documentation/docs/article/getting_started.md +1 -1
  16. data/documentation/docs/article/guides/inspector.md +1 -1
  17. data/documentation/docs/article/guides/launch_browser.md +5 -5
  18. data/documentation/docs/article/guides/rails_integration.md +3 -3
  19. data/documentation/docs/article/guides/rails_integration_with_null_driver.md +46 -0
  20. data/documentation/docs/article/guides/recording_video.md +2 -2
  21. data/documentation/docs/article/guides/semi_automation.md +1 -1
  22. data/documentation/docs/include/api_coverage.md +16 -0
  23. data/lib/playwright/channel_owners/api_request_context.rb +24 -2
  24. data/lib/playwright/channel_owners/binding_call.rb +37 -3
  25. data/lib/playwright/channel_owners/browser_context.rb +24 -4
  26. data/lib/playwright/channel_owners/browser_type.rb +2 -1
  27. data/lib/playwright/channel_owners/debugger.rb +4 -0
  28. data/lib/playwright/channel_owners/dialog.rb +3 -1
  29. data/lib/playwright/channel_owners/disposable.rb +9 -0
  30. data/lib/playwright/channel_owners/overlay.rb +4 -0
  31. data/lib/playwright/channel_owners/page.rb +58 -32
  32. data/lib/playwright/channel_owners/request.rb +8 -0
  33. data/lib/playwright/channel_owners/response.rb +5 -0
  34. data/lib/playwright/channel_owners/stream.rb +4 -0
  35. data/lib/playwright/channel_owners/tracing.rb +17 -7
  36. data/lib/playwright/channel_owners/web_socket.rb +14 -0
  37. data/lib/playwright/connection.rb +25 -20
  38. data/lib/playwright/console_message_impl.rb +4 -0
  39. data/lib/playwright/disposable.rb +11 -0
  40. data/lib/playwright/har_router.rb +16 -1
  41. data/lib/playwright/javascript/value_serializer.rb +2 -1
  42. data/lib/playwright/locator_assertions_impl.rb +1 -1
  43. data/lib/playwright/locator_impl.rb +19 -3
  44. data/lib/playwright/page_assertions_impl.rb +1 -1
  45. data/lib/playwright/screencast.rb +91 -0
  46. data/lib/playwright/utils.rb +19 -0
  47. data/lib/playwright/version.rb +2 -2
  48. data/lib/playwright/video.rb +6 -4
  49. data/lib/playwright/waiter.rb +24 -6
  50. data/lib/playwright.rb +2 -0
  51. data/lib/playwright_api/android.rb +7 -7
  52. data/lib/playwright_api/android_device.rb +8 -8
  53. data/lib/playwright_api/api_request_context.rb +6 -6
  54. data/lib/playwright_api/browser.rb +18 -6
  55. data/lib/playwright_api/browser_context.rb +32 -6
  56. data/lib/playwright_api/browser_type.rb +13 -12
  57. data/lib/playwright_api/cdp_session.rb +6 -6
  58. data/lib/playwright_api/console_message.rb +6 -0
  59. data/lib/playwright_api/dialog.rb +6 -6
  60. data/lib/playwright_api/element_handle.rb +6 -6
  61. data/lib/playwright_api/frame.rb +8 -8
  62. data/lib/playwright_api/frame_locator.rb +2 -2
  63. data/lib/playwright_api/js_handle.rb +6 -6
  64. data/lib/playwright_api/locator.rb +19 -9
  65. data/lib/playwright_api/locator_assertions.rb +1 -1
  66. data/lib/playwright_api/page.rb +72 -23
  67. data/lib/playwright_api/playwright.rb +6 -6
  68. data/lib/playwright_api/request.rb +28 -6
  69. data/lib/playwright_api/response.rb +12 -6
  70. data/lib/playwright_api/route.rb +10 -7
  71. data/lib/playwright_api/tracing.rb +8 -7
  72. data/lib/playwright_api/web_socket.rb +6 -6
  73. data/lib/playwright_api/worker.rb +6 -6
  74. data/playwright.gemspec +9 -1
  75. data/sig/playwright.rbs +30 -17
  76. metadata +35 -2
@@ -166,6 +166,28 @@ module Playwright
166
166
  wrap_impl(@impl.response)
167
167
  end
168
168
 
169
+ #
170
+ # Returns the `Response` object if the response has already been received, `null` otherwise.
171
+ #
172
+ # Unlike [`method: Request.response`], this method does not wait for the response to arrive. It returns
173
+ # immediately with the response object if the response has been received, or `null` if the response
174
+ # has not been received yet.
175
+ def existing_response
176
+ wrap_impl(@impl.existing_response)
177
+ end
178
+
179
+ #
180
+ # The Service `Worker` that is performing the request.
181
+ #
182
+ # **Details**
183
+ #
184
+ # This method is Chromium only. It's safe to call when using other browsers, but it will always be `null`.
185
+ #
186
+ # Requests originated in a Service Worker do not have a [`method: Request.frame`] available.
187
+ def service_worker
188
+ raise NotImplementedError.new('service_worker is not implemented yet.')
189
+ end
190
+
169
191
  #
170
192
  # Returns resource size information for given request.
171
193
  def sizes
@@ -205,12 +227,6 @@ module Playwright
205
227
  wrap_impl(@impl.header_values(unwrap_impl(name)))
206
228
  end
207
229
 
208
- # -- inherited from EventEmitter --
209
- # @nodoc
210
- def once(event, callback)
211
- event_emitter_proxy.once(event, callback)
212
- end
213
-
214
230
  # -- inherited from EventEmitter --
215
231
  # @nodoc
216
232
  def on(event, callback)
@@ -223,6 +239,12 @@ module Playwright
223
239
  event_emitter_proxy.off(event, callback)
224
240
  end
225
241
 
242
+ # -- inherited from EventEmitter --
243
+ # @nodoc
244
+ def once(event, callback)
245
+ event_emitter_proxy.once(event, callback)
246
+ end
247
+
226
248
  private def event_emitter_proxy
227
249
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
228
250
  end
@@ -61,6 +61,12 @@ module Playwright
61
61
  wrap_impl(@impl.header_values(unwrap_impl(name)))
62
62
  end
63
63
 
64
+ #
65
+ # Returns the http version used by the response.
66
+ def http_version
67
+ wrap_impl(@impl.http_version)
68
+ end
69
+
64
70
  #
65
71
  # Returns the JSON representation of response body.
66
72
  #
@@ -127,12 +133,6 @@ module Playwright
127
133
  wrap_impl(@impl.from_service_worker?)
128
134
  end
129
135
 
130
- # -- inherited from EventEmitter --
131
- # @nodoc
132
- def once(event, callback)
133
- event_emitter_proxy.once(event, callback)
134
- end
135
-
136
136
  # -- inherited from EventEmitter --
137
137
  # @nodoc
138
138
  def on(event, callback)
@@ -145,6 +145,12 @@ module Playwright
145
145
  event_emitter_proxy.off(event, callback)
146
146
  end
147
147
 
148
+ # -- inherited from EventEmitter --
149
+ # @nodoc
150
+ def once(event, callback)
151
+ event_emitter_proxy.once(event, callback)
152
+ end
153
+
148
154
  private def event_emitter_proxy
149
155
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
150
156
  end
@@ -36,7 +36,10 @@ module Playwright
36
36
  #
37
37
  # [`method: Route.continue`] will immediately send the request to the network, other matching handlers won't be invoked. Use [`method: Route.fallback`] If you want next matching handler in the chain to be invoked.
38
38
  #
39
- # **NOTE**: The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [`method: BrowserContext.addCookies`].
39
+ # **NOTE**: Some request headers are **forbidden** and cannot be overridden (for example, `Cookie`, `Host`, `Content-Length` and others, see [this MDN page](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header) for full list).
40
+ # If an override is provided for a forbidden header, it will be ignored and the original request header will be used.
41
+ #
42
+ # To set custom cookies, use [`method: BrowserContext.addCookies`].
40
43
  def continue(headers: nil, method: nil, postData: nil, url: nil)
41
44
  wrap_impl(@impl.continue(headers: unwrap_impl(headers), method: unwrap_impl(method), postData: unwrap_impl(postData), url: unwrap_impl(url)))
42
45
  end
@@ -174,12 +177,6 @@ module Playwright
174
177
  wrap_impl(@impl.redirect_navigation_request(unwrap_impl(url)))
175
178
  end
176
179
 
177
- # -- inherited from EventEmitter --
178
- # @nodoc
179
- def once(event, callback)
180
- event_emitter_proxy.once(event, callback)
181
- end
182
-
183
180
  # -- inherited from EventEmitter --
184
181
  # @nodoc
185
182
  def on(event, callback)
@@ -192,6 +189,12 @@ module Playwright
192
189
  event_emitter_proxy.off(event, callback)
193
190
  end
194
191
 
192
+ # -- inherited from EventEmitter --
193
+ # @nodoc
194
+ def once(event, callback)
195
+ event_emitter_proxy.once(event, callback)
196
+ end
197
+
195
198
  private def event_emitter_proxy
196
199
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
197
200
  end
@@ -34,12 +34,13 @@ module Playwright
34
34
  # context.tracing.stop(path = "trace.zip")
35
35
  # ```
36
36
  def start(
37
+ live: nil,
37
38
  name: nil,
38
39
  screenshots: nil,
39
40
  snapshots: nil,
40
41
  sources: nil,
41
42
  title: nil)
42
- wrap_impl(@impl.start(name: unwrap_impl(name), screenshots: unwrap_impl(screenshots), snapshots: unwrap_impl(snapshots), sources: unwrap_impl(sources), title: unwrap_impl(title)))
43
+ wrap_impl(@impl.start(live: unwrap_impl(live), name: unwrap_impl(name), screenshots: unwrap_impl(screenshots), snapshots: unwrap_impl(snapshots), sources: unwrap_impl(sources), title: unwrap_impl(title)))
43
44
  end
44
45
 
45
46
  #
@@ -103,12 +104,6 @@ module Playwright
103
104
  wrap_impl(@impl.stop_chunk(path: unwrap_impl(path)))
104
105
  end
105
106
 
106
- # -- inherited from EventEmitter --
107
- # @nodoc
108
- def once(event, callback)
109
- event_emitter_proxy.once(event, callback)
110
- end
111
-
112
107
  # -- inherited from EventEmitter --
113
108
  # @nodoc
114
109
  def on(event, callback)
@@ -121,6 +116,12 @@ module Playwright
121
116
  event_emitter_proxy.off(event, callback)
122
117
  end
123
118
 
119
+ # -- inherited from EventEmitter --
120
+ # @nodoc
121
+ def once(event, callback)
122
+ event_emitter_proxy.once(event, callback)
123
+ end
124
+
124
125
  private def event_emitter_proxy
125
126
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
126
127
  end
@@ -34,12 +34,6 @@ module Playwright
34
34
  wrap_impl(@impl.wait_for_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
35
35
  end
36
36
 
37
- # -- inherited from EventEmitter --
38
- # @nodoc
39
- def once(event, callback)
40
- event_emitter_proxy.once(event, callback)
41
- end
42
-
43
37
  # -- inherited from EventEmitter --
44
38
  # @nodoc
45
39
  def on(event, callback)
@@ -52,6 +46,12 @@ module Playwright
52
46
  event_emitter_proxy.off(event, callback)
53
47
  end
54
48
 
49
+ # -- inherited from EventEmitter --
50
+ # @nodoc
51
+ def once(event, callback)
52
+ event_emitter_proxy.once(event, callback)
53
+ end
54
+
55
55
  private def event_emitter_proxy
56
56
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
57
57
  end
@@ -73,12 +73,6 @@ module Playwright
73
73
  wrap_impl(@impl.page=(unwrap_impl(req)))
74
74
  end
75
75
 
76
- # -- inherited from EventEmitter --
77
- # @nodoc
78
- def once(event, callback)
79
- event_emitter_proxy.once(event, callback)
80
- end
81
-
82
76
  # -- inherited from EventEmitter --
83
77
  # @nodoc
84
78
  def on(event, callback)
@@ -91,6 +85,12 @@ module Playwright
91
85
  event_emitter_proxy.off(event, callback)
92
86
  end
93
87
 
88
+ # -- inherited from EventEmitter --
89
+ # @nodoc
90
+ def once(event, callback)
91
+ event_emitter_proxy.once(event, callback)
92
+ end
93
+
94
94
  private def event_emitter_proxy
95
95
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
96
96
  end
data/playwright.gemspec CHANGED
@@ -17,7 +17,13 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
19
  `git ls-files -z`.split("\x0").reject do |f|
20
- f.match(%r{^(test|spec|features)/}) || f.include?(".git") || f.include?(".circleci") || f.start_with?("development/")
20
+ f.match(%r{^(test|spec|features)/}) ||
21
+ f.include?(".git") ||
22
+ f.include?(".circleci") ||
23
+ f.start_with?("development/") ||
24
+ f == "AGENTS.md" ||
25
+ f == "CLAUDE.md" ||
26
+ f.match(%r{\ACLAUDE/.*\.md\z})
21
27
  end
22
28
  end + `find lib/playwright_api -name *.rb -type f`.split("\n") + `find sig -name *.rbs -type f`.split("\n")
23
29
  spec.bindir = 'exe'
@@ -25,6 +31,7 @@ Gem::Specification.new do |spec|
25
31
  spec.require_paths = ['lib']
26
32
 
27
33
  spec.required_ruby_version = '>= 2.4'
34
+ spec.add_dependency 'base64'
28
35
  spec.add_dependency 'concurrent-ruby', '>= 1.1.6'
29
36
  spec.add_dependency 'mime-types', '>= 3.0'
30
37
  spec.add_development_dependency 'bundler'
@@ -32,6 +39,7 @@ Gem::Specification.new do |spec|
32
39
  spec.add_development_dependency 'dry-inflector'
33
40
  spec.add_development_dependency 'faye-websocket'
34
41
  spec.add_development_dependency 'pry-byebug'
42
+ spec.add_development_dependency 'ostruct'
35
43
  spec.add_development_dependency 'puma'
36
44
  spec.add_development_dependency 'rack', '< 3'
37
45
  spec.add_development_dependency 'rake'
data/sig/playwright.rbs CHANGED
@@ -17,6 +17,7 @@ module Playwright
17
17
  def redirected_to: -> (nil | Request)
18
18
  def resource_type: -> String
19
19
  def response: -> (nil | Response)
20
+ def existing_response: -> (nil | Response)
20
21
  def sizes: -> Hash[untyped, untyped]
21
22
  def timing: -> Hash[untyped, untyped]
22
23
  def url: -> String
@@ -32,6 +33,7 @@ module Playwright
32
33
  def headers_array: -> Array[untyped]
33
34
  def header_value: (String name) -> (nil | String)
34
35
  def header_values: (String name) -> Array[untyped]
36
+ def http_version: -> String
35
37
  def json: -> untyped
36
38
  def ok: -> bool
37
39
  def request: -> Request
@@ -237,7 +239,8 @@ module Playwright
237
239
  def location: -> Hash[untyped, untyped]
238
240
  def page: -> (nil | Page)
239
241
  def text: -> String
240
- def type: -> ("log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd")
242
+ def timestamp: -> Float
243
+ def type: -> ("log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "time" | "timeEnd")
241
244
  def worker: -> (nil | Worker)
242
245
  end
243
246
 
@@ -262,10 +265,11 @@ module Playwright
262
265
  end
263
266
 
264
267
  class Page
265
- def add_init_script: (?path: (String | File), ?script: String) -> void
268
+ def add_init_script: (?path: (String | File), ?script: String) -> untyped
266
269
  def add_script_tag: (?content: String, ?path: (String | File), ?type: String, ?url: String) -> ElementHandle
267
270
  def add_style_tag: (?content: String, ?path: (String | File), ?url: String) -> ElementHandle
268
271
  def bring_to_front: -> void
272
+ def cancel_pick_locator: -> void
269
273
  def check: (String selector, ?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
270
274
  def click: (String selector, ?button: ("left" | "right" | "middle"), ?clickCount: Integer, ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
271
275
  def close: (?reason: String, ?runBeforeUnload: bool) -> void
@@ -279,8 +283,8 @@ module Playwright
279
283
  def eval_on_selector_all: (String selector, String expression, ?arg: untyped) -> untyped
280
284
  def evaluate: (String expression, ?arg: untyped) -> untyped
281
285
  def evaluate_handle: (String expression, ?arg: untyped) -> JSHandle
282
- def expose_binding: (String name, function callback, ?handle: bool) -> void
283
- def expose_function: (String name, function callback) -> void
286
+ def expose_binding: (String name, function callback, ?handle: bool) -> untyped
287
+ def expose_function: (String name, function callback) -> untyped
284
288
  def fill: (String selector, String value, ?force: bool, ?noWaitAfter: bool, ?strict: bool, ?timeout: Float) -> void
285
289
  def focus: (String selector, ?strict: bool, ?timeout: Float) -> void
286
290
  def frame: (?name: String, ?url: (String | Regexp | function)) -> (nil | Frame)
@@ -309,19 +313,22 @@ module Playwright
309
313
  def enabled?: (String selector, ?strict: bool, ?timeout: Float) -> bool
310
314
  def hidden?: (String selector, ?strict: bool, ?timeout: Float) -> bool
311
315
  def visible?: (String selector, ?strict: bool, ?timeout: Float) -> bool
312
- def console_messages: -> Array[untyped]
313
- def page_errors: -> Array[untyped]
316
+ def clear_console_messages: -> void
317
+ def clear_page_errors: -> void
318
+ def console_messages: (?filter: ("all" | "since-navigation")) -> Array[untyped]
319
+ def page_errors: (?filter: ("all" | "since-navigation")) -> Array[untyped]
314
320
  def locator: (String selector, ?has: Locator, ?hasNot: Locator, ?hasNotText: (String | Regexp), ?hasText: (String | Regexp)) -> Locator
315
321
  def main_frame: -> Frame
316
322
  def opener: -> (nil | Page)
317
323
  def pause: -> void
318
324
  def pdf: (?displayHeaderFooter: bool, ?footerTemplate: String, ?format: String, ?headerTemplate: String, ?height: (String | Float), ?landscape: bool, ?margin: Hash[untyped, untyped], ?outline: bool, ?pageRanges: String, ?path: (String | File), ?preferCSSPageSize: bool, ?printBackground: bool, ?scale: Float, ?tagged: bool, ?width: (String | Float)) -> String
325
+ def pick_locator: -> Locator
319
326
  def press: (String selector, String key, ?delay: Float, ?noWaitAfter: bool, ?strict: bool, ?timeout: Float) -> void
320
327
  def query_selector: (String selector, ?strict: bool) -> (nil | ElementHandle)
321
328
  def query_selector_all: (String selector) -> Array[untyped]
322
329
  def requests: -> Array[untyped]
323
330
  def reload: (?timeout: Float, ?waitUntil: ("load" | "domcontentloaded" | "networkidle" | "commit")) -> (nil | Response)
324
- def route: ((String | Regexp | function) url, function handler, ?times: Integer) -> void
331
+ def route: ((String | Regexp | function) url, function handler, ?times: Integer) -> untyped
325
332
  def route_from_har: ((String | File) har, ?notFound: ("abort" | "fallback"), ?update: bool, ?updateContent: ("embed" | "attach"), ?updateMode: ("full" | "minimal"), ?url: (String | Regexp)) -> void
326
333
  def screenshot: (?animations: ("disabled" | "allow"), ?caret: ("hide" | "initial"), ?clip: Hash[untyped, untyped], ?fullPage: bool, ?mask: Array[untyped], ?maskColor: String, ?omitBackground: bool, ?path: (String | File), ?quality: Integer, ?scale: ("css" | "device"), ?style: String, ?timeout: Float, ?type: ("png" | "jpeg")) -> String
327
334
  def select_option: (String selector, ?element: (ElementHandle | Array[untyped]), ?index: (Integer | Array[untyped]), ?value: (String | Array[untyped]), ?label: (String | Array[untyped]), ?force: bool, ?noWaitAfter: bool, ?strict: bool, ?timeout: Float) -> Array[untyped]
@@ -337,6 +344,7 @@ module Playwright
337
344
  def set_input_files: (String selector, ((String | File) | Array[untyped] | Hash[untyped, untyped] | Array[untyped]) files, ?noWaitAfter: bool, ?strict: bool, ?timeout: Float) -> void
338
345
  def set_viewport_size: (Hash[untyped, untyped] viewportSize) -> void
339
346
  def viewport_size=: (Hash[untyped, untyped] viewportSize) -> void
347
+ def aria_snapshot: (?depth: Integer, ?mode: ("ai" | "default"), ?timeout: Float) -> String
340
348
  def tap_point: (String selector, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
341
349
  def text_content: (String selector, ?strict: bool, ?timeout: Float) -> (nil | String)
342
350
  def title: -> String
@@ -369,25 +377,27 @@ module Playwright
369
377
  attr_reader keyboard: Keyboard
370
378
  attr_reader mouse: Mouse
371
379
  attr_reader request: APIRequestContext
380
+ attr_reader screencast: untyped
372
381
  attr_reader touchscreen: Touchscreen
373
382
  end
374
383
 
375
384
  class BrowserContext
376
385
  def add_cookies: (Array[untyped] cookies) -> void
377
- def add_init_script: (?path: (String | File), ?script: String) -> void
386
+ def add_init_script: (?path: (String | File), ?script: String) -> untyped
378
387
  def background_pages: -> Array[untyped]
379
388
  def browser: -> (nil | Browser)
380
389
  def clear_cookies: (?domain: (String | Regexp), ?name: (String | Regexp), ?path: (String | Regexp)) -> void
381
390
  def clear_permissions: -> void
382
391
  def close: (?reason: String) -> void
383
392
  def cookies: (?urls: (String | Array[untyped])) -> Array[untyped]
384
- def expose_binding: (String name, function callback, ?handle: bool) -> void
385
- def expose_function: (String name, function callback) -> void
393
+ def expose_binding: (String name, function callback, ?handle: bool) -> untyped
394
+ def expose_function: (String name, function callback) -> untyped
386
395
  def grant_permissions: (Array[untyped] permissions, ?origin: String) -> void
396
+ def closed?: -> bool
387
397
  def new_cdp_session: ((Page | Frame) page) -> CDPSession
388
398
  def new_page: () ?{ (Page) -> untyped } -> Page
389
399
  def pages: -> Array[untyped]
390
- def route: ((String | Regexp | function) url, function handler, ?times: Integer) -> void
400
+ def route: ((String | Regexp | function) url, function handler, ?times: Integer) -> untyped
391
401
  def route_from_har: ((String | File) har, ?notFound: ("abort" | "fallback"), ?update: bool, ?updateContent: ("embed" | "attach"), ?updateMode: ("full" | "minimal"), ?url: (String | Regexp)) -> void
392
402
  def service_workers: -> Array[untyped]
393
403
  def set_default_navigation_timeout: (Float timeout) -> void
@@ -401,6 +411,8 @@ module Playwright
401
411
  def set_offline: (bool offline) -> void
402
412
  def offline=: (bool offline) -> void
403
413
  def storage_state: (?indexedDB: bool, ?path: (String | File)) -> Hash[untyped, untyped]
414
+ def set_storage_state: (((String | File) | Hash[untyped, untyped]) storageState) -> void
415
+ def storage_state=: (((String | File) | Hash[untyped, untyped]) storageState) -> void
404
416
  def unroute_all: (?behavior: ("wait" | "ignoreErrors" | "default")) -> void
405
417
  def unroute: ((String | Regexp | function) url, ?handler: function) -> void
406
418
  def expect_console_message: (?predicate: function, ?timeout: Float) { () -> void } -> ConsoleMessage
@@ -431,10 +443,10 @@ module Playwright
431
443
  end
432
444
 
433
445
  class BrowserType
434
- def connect_over_cdp: (String endpointURL, ?headers: Hash[untyped, untyped], ?slowMo: Float, ?timeout: Float) ?{ (untyped) -> untyped } -> Browser
446
+ def connect_over_cdp: (String endpointURL, ?headers: Hash[untyped, untyped], ?isLocal: bool, ?slowMo: Float, ?timeout: Float) ?{ (untyped) -> untyped } -> Browser
435
447
  def executable_path: -> String
436
- def launch: (?args: Array[untyped], ?channel: String, ?chromiumSandbox: bool, ?devtools: bool, ?downloadsPath: (String | File), ?env: Hash[untyped, untyped], ?executablePath: (String | File), ?firefoxUserPrefs: Hash[untyped, untyped], ?handleSIGHUP: bool, ?handleSIGINT: bool, ?handleSIGTERM: bool, ?headless: bool, ?ignoreDefaultArgs: (bool | Array[untyped]), ?proxy: Hash[untyped, untyped], ?slowMo: Float, ?timeout: Float, ?tracesDir: (String | File)) ?{ (Browser) -> untyped } -> Browser
437
- def launch_persistent_context: ((String | File) userDataDir, ?acceptDownloads: bool, ?args: Array[untyped], ?baseURL: String, ?bypassCSP: bool, ?channel: String, ?chromiumSandbox: bool, ?clientCertificates: Array[untyped], ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "null"), ?deviceScaleFactor: Float, ?devtools: bool, ?downloadsPath: (String | File), ?env: Hash[untyped, untyped], ?executablePath: (String | File), ?extraHTTPHeaders: Hash[untyped, untyped], ?firefoxUserPrefs: Hash[untyped, untyped], ?forcedColors: ("active" | "none" | "null"), ?geolocation: Hash[untyped, untyped], ?handleSIGHUP: bool, ?handleSIGINT: bool, ?handleSIGTERM: bool, ?hasTouch: bool, ?headless: bool, ?httpCredentials: Hash[untyped, untyped], ?ignoreDefaultArgs: (bool | Array[untyped]), ?ignoreHTTPSErrors: bool, ?isMobile: bool, ?javaScriptEnabled: bool, ?locale: String, ?noViewport: bool, ?offline: bool, ?permissions: Array[untyped], ?proxy: Hash[untyped, untyped], ?record_har_content: ("omit" | "embed" | "attach"), ?record_har_mode: ("full" | "minimal"), ?record_har_omit_content: bool, ?record_har_path: (String | File), ?record_har_url_filter: (String | Regexp), ?record_video_dir: (String | File), ?record_video_size: Hash[untyped, untyped], ?reducedMotion: ("reduce" | "no-preference" | "null"), ?screen: Hash[untyped, untyped], ?serviceWorkers: ("allow" | "block"), ?slowMo: Float, ?strictSelectors: bool, ?timeout: Float, ?timezoneId: String, ?tracesDir: (String | File), ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (untyped) -> untyped } -> BrowserContext
448
+ def launch: (?args: Array[untyped], ?artifactsDir: (String | File), ?channel: String, ?chromiumSandbox: bool, ?downloadsPath: (String | File), ?env: Hash[untyped, untyped], ?executablePath: (String | File), ?firefoxUserPrefs: Hash[untyped, untyped], ?handleSIGHUP: bool, ?handleSIGINT: bool, ?handleSIGTERM: bool, ?headless: bool, ?ignoreDefaultArgs: (bool | Array[untyped]), ?proxy: Hash[untyped, untyped], ?slowMo: Float, ?timeout: Float, ?tracesDir: (String | File)) ?{ (Browser) -> untyped } -> Browser
449
+ def launch_persistent_context: ((String | File) userDataDir, ?acceptDownloads: bool, ?args: Array[untyped], ?artifactsDir: (String | File), ?baseURL: String, ?bypassCSP: bool, ?channel: String, ?chromiumSandbox: bool, ?clientCertificates: Array[untyped], ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "null"), ?deviceScaleFactor: Float, ?downloadsPath: (String | File), ?env: Hash[untyped, untyped], ?executablePath: (String | File), ?extraHTTPHeaders: Hash[untyped, untyped], ?firefoxUserPrefs: Hash[untyped, untyped], ?forcedColors: ("active" | "none" | "null"), ?geolocation: Hash[untyped, untyped], ?handleSIGHUP: bool, ?handleSIGINT: bool, ?handleSIGTERM: bool, ?hasTouch: bool, ?headless: bool, ?httpCredentials: Hash[untyped, untyped], ?ignoreDefaultArgs: (bool | Array[untyped]), ?ignoreHTTPSErrors: bool, ?isMobile: bool, ?javaScriptEnabled: bool, ?locale: String, ?noViewport: bool, ?offline: bool, ?permissions: Array[untyped], ?proxy: Hash[untyped, untyped], ?record_har_content: ("omit" | "embed" | "attach"), ?record_har_mode: ("full" | "minimal"), ?record_har_omit_content: bool, ?record_har_path: (String | File), ?record_har_url_filter: (String | Regexp), ?record_video_dir: (String | File), ?record_video_size: Hash[untyped, untyped], ?reducedMotion: ("reduce" | "no-preference" | "null"), ?screen: Hash[untyped, untyped], ?serviceWorkers: ("allow" | "block"), ?slowMo: Float, ?strictSelectors: bool, ?timeout: Float, ?timezoneId: String, ?tracesDir: (String | File), ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (untyped) -> untyped } -> BrowserContext
438
450
  def name: -> String
439
451
  end
440
452
 
@@ -447,9 +459,9 @@ module Playwright
447
459
  end
448
460
 
449
461
  class Tracing
450
- def start: (?name: String, ?screenshots: bool, ?snapshots: bool, ?sources: bool, ?title: String) -> void
462
+ def start: (?live: bool, ?name: String, ?screenshots: bool, ?snapshots: bool, ?sources: bool, ?title: String) -> void
451
463
  def start_chunk: (?name: String, ?title: String) -> void
452
- def group: (String name, ?location: Hash[untyped, untyped]) -> void
464
+ def group: (String name, ?location: Hash[untyped, untyped]) -> untyped
453
465
  def group_end: -> void
454
466
  def stop: (?path: (String | File)) -> void
455
467
  def stop_chunk: (?path: (String | File)) -> void
@@ -460,7 +472,7 @@ module Playwright
460
472
  def all_inner_texts: -> Array[untyped]
461
473
  def all_text_contents: -> Array[untyped]
462
474
  def and: (Locator locator) -> Locator
463
- def aria_snapshot: (?timeout: Float) -> String
475
+ def aria_snapshot: (?depth: Integer, ?mode: ("ai" | "default"), ?timeout: Float) -> String
464
476
  def blur: (?timeout: Float) -> void
465
477
  def bounding_box: (?timeout: Float) -> (nil | Hash[untyped, untyped])
466
478
  def check: (?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
@@ -506,6 +518,7 @@ module Playwright
506
518
  def visible?: (?timeout: Float) -> bool
507
519
  def last: -> Locator
508
520
  def locator: ((String | Locator) selectorOrLocator, ?has: Locator, ?hasNot: Locator, ?hasNotText: (String | Regexp), ?hasText: (String | Regexp)) -> Locator
521
+ def normalize: -> Locator
509
522
  def nth: (Integer index) -> Locator
510
523
  def or: (Locator locator) -> Locator
511
524
  def page: -> Page
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.57.0
4
+ version: 1.59.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: concurrent-ruby
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +121,20 @@ dependencies:
107
121
  - - ">="
108
122
  - !ruby/object:Gem::Version
109
123
  version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: ostruct
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
110
138
  - !ruby/object:Gem::Dependency
111
139
  name: puma
112
140
  requirement: !ruby/object:Gem::Requirement
@@ -290,13 +318,16 @@ files:
290
318
  - lib/playwright/channel_owners/browser_context.rb
291
319
  - lib/playwright/channel_owners/browser_type.rb
292
320
  - lib/playwright/channel_owners/cdp_session.rb
321
+ - lib/playwright/channel_owners/debugger.rb
293
322
  - lib/playwright/channel_owners/dialog.rb
323
+ - lib/playwright/channel_owners/disposable.rb
294
324
  - lib/playwright/channel_owners/electron.rb
295
325
  - lib/playwright/channel_owners/element_handle.rb
296
326
  - lib/playwright/channel_owners/fetch_request.rb
297
327
  - lib/playwright/channel_owners/frame.rb
298
328
  - lib/playwright/channel_owners/js_handle.rb
299
329
  - lib/playwright/channel_owners/local_utils.rb
330
+ - lib/playwright/channel_owners/overlay.rb
300
331
  - lib/playwright/channel_owners/page.rb
301
332
  - lib/playwright/channel_owners/playwright.rb
302
333
  - lib/playwright/channel_owners/request.rb
@@ -310,6 +341,7 @@ files:
310
341
  - lib/playwright/clock_impl.rb
311
342
  - lib/playwright/connection.rb
312
343
  - lib/playwright/console_message_impl.rb
344
+ - lib/playwright/disposable.rb
313
345
  - lib/playwright/download_impl.rb
314
346
  - lib/playwright/errors.rb
315
347
  - lib/playwright/event_emitter.rb
@@ -336,6 +368,7 @@ files:
336
368
  - lib/playwright/playwright_api.rb
337
369
  - lib/playwright/raw_headers.rb
338
370
  - lib/playwright/route_handler.rb
371
+ - lib/playwright/screencast.rb
339
372
  - lib/playwright/select_option_values.rb
340
373
  - lib/playwright/selectors_impl.rb
341
374
  - lib/playwright/test.rb
@@ -407,5 +440,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
440
  requirements: []
408
441
  rubygems_version: 3.6.9
409
442
  specification_version: 4
410
- summary: The Ruby binding of playwright driver 1.57.0
443
+ summary: The Ruby binding of playwright driver 1.59.0
411
444
  test_files: []