playwright-ruby-client 1.58.1 → 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 (66) 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 +2 -0
  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 +16 -3
  9. data/documentation/docs/api/page.md +68 -5
  10. data/documentation/docs/api/request.md +13 -0
  11. data/documentation/docs/api/response.md +9 -0
  12. data/documentation/docs/api/tracing.md +1 -0
  13. data/documentation/docs/article/guides/rails_integration_with_null_driver.md +46 -0
  14. data/documentation/docs/include/api_coverage.md +15 -0
  15. data/lib/playwright/channel_owners/browser_context.rb +24 -4
  16. data/lib/playwright/channel_owners/debugger.rb +4 -0
  17. data/lib/playwright/channel_owners/dialog.rb +3 -1
  18. data/lib/playwright/channel_owners/disposable.rb +9 -0
  19. data/lib/playwright/channel_owners/overlay.rb +4 -0
  20. data/lib/playwright/channel_owners/page.rb +54 -31
  21. data/lib/playwright/channel_owners/request.rb +8 -0
  22. data/lib/playwright/channel_owners/response.rb +5 -0
  23. data/lib/playwright/channel_owners/tracing.rb +2 -1
  24. data/lib/playwright/console_message_impl.rb +4 -0
  25. data/lib/playwright/disposable.rb +11 -0
  26. data/lib/playwright/har_router.rb +16 -1
  27. data/lib/playwright/locator_impl.rb +19 -3
  28. data/lib/playwright/screencast.rb +91 -0
  29. data/lib/playwright/utils.rb +19 -0
  30. data/lib/playwright/version.rb +2 -2
  31. data/lib/playwright/video.rb +6 -4
  32. data/lib/playwright.rb +2 -0
  33. data/lib/playwright_api/android.rb +7 -7
  34. data/lib/playwright_api/android_device.rb +6 -6
  35. data/lib/playwright_api/api_request_context.rb +6 -6
  36. data/lib/playwright_api/browser.rb +18 -6
  37. data/lib/playwright_api/browser_context.rb +42 -16
  38. data/lib/playwright_api/browser_type.rb +11 -9
  39. data/lib/playwright_api/cdp_session.rb +6 -6
  40. data/lib/playwright_api/console_message.rb +6 -0
  41. data/lib/playwright_api/dialog.rb +6 -6
  42. data/lib/playwright_api/element_handle.rb +6 -6
  43. data/lib/playwright_api/frame.rb +8 -8
  44. data/lib/playwright_api/frame_locator.rb +2 -2
  45. data/lib/playwright_api/js_handle.rb +6 -6
  46. data/lib/playwright_api/locator.rb +14 -4
  47. data/lib/playwright_api/page.rb +68 -19
  48. data/lib/playwright_api/playwright.rb +6 -6
  49. data/lib/playwright_api/request.rb +16 -6
  50. data/lib/playwright_api/response.rb +12 -6
  51. data/lib/playwright_api/route.rb +6 -6
  52. data/lib/playwright_api/tracing.rb +8 -7
  53. data/lib/playwright_api/web_socket.rb +6 -6
  54. data/lib/playwright_api/worker.rb +8 -8
  55. data/playwright.gemspec +7 -1
  56. data/sig/playwright.rbs +28 -15
  57. metadata +7 -11
  58. data/AGENTS.md +0 -4
  59. data/CLAUDE/api_generation.md +0 -28
  60. data/CLAUDE/ci_expectations.md +0 -23
  61. data/CLAUDE/gem_release_flow.md +0 -39
  62. data/CLAUDE/past_upgrade_pr_patterns.md +0 -42
  63. data/CLAUDE/playwright_upgrade_workflow.md +0 -35
  64. data/CLAUDE/rspec_debugging.md +0 -30
  65. data/CLAUDE/unimplemented_examples.md +0 -18
  66. data/CLAUDE.md +0 -32
@@ -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
@@ -177,12 +177,6 @@ module Playwright
177
177
  wrap_impl(@impl.redirect_navigation_request(unwrap_impl(url)))
178
178
  end
179
179
 
180
- # -- inherited from EventEmitter --
181
- # @nodoc
182
- def once(event, callback)
183
- event_emitter_proxy.once(event, callback)
184
- end
185
-
186
180
  # -- inherited from EventEmitter --
187
181
  # @nodoc
188
182
  def on(event, callback)
@@ -195,6 +189,12 @@ module Playwright
195
189
  event_emitter_proxy.off(event, callback)
196
190
  end
197
191
 
192
+ # -- inherited from EventEmitter --
193
+ # @nodoc
194
+ def once(event, callback)
195
+ event_emitter_proxy.once(event, callback)
196
+ end
197
+
198
198
  private def event_emitter_proxy
199
199
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
200
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
@@ -63,20 +63,14 @@ module Playwright
63
63
  wrap_impl(@impl.expect_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
64
64
  end
65
65
 
66
- # @nodoc
67
- def page=(req)
68
- wrap_impl(@impl.page=(unwrap_impl(req)))
69
- end
70
-
71
66
  # @nodoc
72
67
  def context=(req)
73
68
  wrap_impl(@impl.context=(unwrap_impl(req)))
74
69
  end
75
70
 
76
- # -- inherited from EventEmitter --
77
71
  # @nodoc
78
- def once(event, callback)
79
- event_emitter_proxy.once(event, callback)
72
+ def page=(req)
73
+ wrap_impl(@impl.page=(unwrap_impl(req)))
80
74
  end
81
75
 
82
76
  # -- inherited from EventEmitter --
@@ -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'
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,6 +239,7 @@ module Playwright
237
239
  def location: -> Hash[untyped, untyped]
238
240
  def page: -> (nil | Page)
239
241
  def text: -> String
242
+ def timestamp: -> Float
240
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
@@ -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
@@ -433,8 +445,8 @@ module Playwright
433
445
  class BrowserType
434
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, ?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, ?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.58.1
4
+ version: 1.59.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
@@ -226,15 +226,6 @@ extensions: []
226
226
  extra_rdoc_files: []
227
227
  files:
228
228
  - ".rspec"
229
- - AGENTS.md
230
- - CLAUDE.md
231
- - CLAUDE/api_generation.md
232
- - CLAUDE/ci_expectations.md
233
- - CLAUDE/gem_release_flow.md
234
- - CLAUDE/past_upgrade_pr_patterns.md
235
- - CLAUDE/playwright_upgrade_workflow.md
236
- - CLAUDE/rspec_debugging.md
237
- - CLAUDE/unimplemented_examples.md
238
229
  - CODE_OF_CONDUCT.md
239
230
  - CONTRIBUTING.md
240
231
  - Gemfile
@@ -327,13 +318,16 @@ files:
327
318
  - lib/playwright/channel_owners/browser_context.rb
328
319
  - lib/playwright/channel_owners/browser_type.rb
329
320
  - lib/playwright/channel_owners/cdp_session.rb
321
+ - lib/playwright/channel_owners/debugger.rb
330
322
  - lib/playwright/channel_owners/dialog.rb
323
+ - lib/playwright/channel_owners/disposable.rb
331
324
  - lib/playwright/channel_owners/electron.rb
332
325
  - lib/playwright/channel_owners/element_handle.rb
333
326
  - lib/playwright/channel_owners/fetch_request.rb
334
327
  - lib/playwright/channel_owners/frame.rb
335
328
  - lib/playwright/channel_owners/js_handle.rb
336
329
  - lib/playwright/channel_owners/local_utils.rb
330
+ - lib/playwright/channel_owners/overlay.rb
337
331
  - lib/playwright/channel_owners/page.rb
338
332
  - lib/playwright/channel_owners/playwright.rb
339
333
  - lib/playwright/channel_owners/request.rb
@@ -347,6 +341,7 @@ files:
347
341
  - lib/playwright/clock_impl.rb
348
342
  - lib/playwright/connection.rb
349
343
  - lib/playwright/console_message_impl.rb
344
+ - lib/playwright/disposable.rb
350
345
  - lib/playwright/download_impl.rb
351
346
  - lib/playwright/errors.rb
352
347
  - lib/playwright/event_emitter.rb
@@ -373,6 +368,7 @@ files:
373
368
  - lib/playwright/playwright_api.rb
374
369
  - lib/playwright/raw_headers.rb
375
370
  - lib/playwright/route_handler.rb
371
+ - lib/playwright/screencast.rb
376
372
  - lib/playwright/select_option_values.rb
377
373
  - lib/playwright/selectors_impl.rb
378
374
  - lib/playwright/test.rb
@@ -444,5 +440,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
444
440
  requirements: []
445
441
  rubygems_version: 3.6.9
446
442
  specification_version: 4
447
- summary: The Ruby binding of playwright driver 1.58.2
443
+ summary: The Ruby binding of playwright driver 1.59.0
448
444
  test_files: []
data/AGENTS.md DELETED
@@ -1,4 +0,0 @@
1
- # AGENTS.md
2
-
3
- When working in this repository, read `CLAUDE.md` first and follow its mandatory checks.
4
- For detailed rules and workflows, refer to `CLAUDE/*.md`.
@@ -1,28 +0,0 @@
1
- # API Generation
2
-
3
- ## Source of generated artifacts
4
-
5
- - Input: `development/api.json`
6
- - Generator script: `development/generate_api.rb`
7
-
8
- ## Generated outputs
9
-
10
- - `lib/playwright_api/*.rb`
11
- - `documentation/docs/api/**/*.md`
12
- - `documentation/docs/include/api_coverage.md`
13
- - `sig/playwright.rbs`
14
- - `development/unimplemented_examples.md`
15
-
16
- ## Critical rules
17
-
18
- - `lib/playwright_api/` is not tracked by Git (`lib/playwright_api/.gitignore` only).
19
- - Do not manually edit `lib/playwright_api/*.rb`.
20
- - Re-run `development/generate_api.rb` whenever API specs change.
21
-
22
- ## Typical command set
23
-
24
- ```sh
25
- rm lib/playwright_api/*.rb
26
- find documentation/docs -name "*.md" | grep -v documentation/docs/article/ | xargs rm
27
- bundle exec ruby development/generate_api.rb
28
- ```
@@ -1,23 +0,0 @@
1
- # CI Expectations
2
-
3
- ## Main guardrails
4
-
5
- `/.github/workflows/check.yml` detects stale generated artifacts.
6
-
7
- Checked paths:
8
-
9
- - `development/api.json`
10
- - `documentation/docs/**`
11
- - `development/unimplemented_examples.md`
12
-
13
- ## Practical implication
14
-
15
- - If API-related code changes, regenerate artifacts before finishing.
16
- - If you open a PR without regeneration, `check.yml` will likely fail.
17
-
18
- ## Related workflows
19
-
20
- - `/.github/workflows/rspec.yml`
21
- - `/.github/workflows/deploy.yml`
22
-
23
- These workflows also depend on `bundle exec ruby development/generate_api.rb`.
@@ -1,39 +0,0 @@
1
- # Gem Release Flow
2
-
3
- ## Overview
4
-
5
- Pushing a Git tag triggers `.github/workflows/deploy.yml`, which builds and publishes the gem to RubyGems.
6
-
7
- ## Tag format
8
-
9
- The deploy workflow triggers on tags matching these patterns:
10
-
11
- - `X.Y.Z` — stable release (e.g. `1.58.0`)
12
- - `X.Y.betaN` — beta release (e.g. `1.58.beta1`)
13
- - `X.Y.Z.alphaN` — alpha release (e.g. `1.58.1.alpha1`)
14
-
15
- ## Steps to release
16
-
17
- 1. Update `lib/playwright/version.rb`:
18
- - Set `Playwright::VERSION` to the target version string.
19
- - `COMPATIBLE_PLAYWRIGHT_VERSION` stays at the base Playwright version.
20
-
21
- 2. Commit the version change.
22
-
23
- 3. Create and push a Git tag matching the version exactly:
24
- ```sh
25
- git tag 1.58.1.alpha1
26
- git push origin 1.58.1.alpha1
27
- ```
28
-
29
- 4. The deploy workflow will:
30
- - Check out the tagged commit.
31
- - Verify `Playwright::VERSION == RELEASE_TAG` (must match exactly).
32
- - Run `bundle exec ruby development/generate_api.rb` to generate API code.
33
- - Run `rake build` to build the gem.
34
- - Push the gem to RubyGems using the `RUBYGEMS_API_KEY` secret.
35
-
36
- ## Important notes
37
-
38
- - The `Playwright::VERSION` in `lib/playwright/version.rb` **must exactly match** the Git tag name. If they differ, the deploy job fails at the version check step.
39
- - Alpha/beta tags do NOT require a separate branch — they can be tagged on any commit.
@@ -1,42 +0,0 @@
1
- # Past Upgrade PR Patterns
2
-
3
- Common patterns observed from `Update Playwright driver to 1.xx.x` PRs reviewed with `gh`.
4
-
5
- ## PR sample
6
-
7
- - `#366` (1.58.0)
8
- - `#360` (1.57.0)
9
- - `#354` (1.56.1)
10
- - `#348` (1.55.0)
11
- - `#341` (1.54.1)
12
- - `#336` (1.53.0)
13
- - `#331` (1.52.0)
14
- - `#327` (1.51.0)
15
-
16
- ## Frequently changed files
17
-
18
- Almost every time:
19
-
20
- - `development/CLI_VERSION`
21
- - `development/api.json`
22
- - `lib/playwright/version.rb`
23
-
24
- High frequency:
25
-
26
- - `documentation/docs/api/*.md`
27
- - `documentation/docs/include/api_coverage.md`
28
- - `development/generate_api/example_codes.rb`
29
- - `spec/integration/example_spec.rb`
30
- - `lib/playwright/channel_owners/page.rb`
31
- - `lib/playwright/locator_impl.rb`
32
-
33
- Sometimes:
34
-
35
- - `development/generate_api.rb`
36
- - `development/unimplemented_examples.md`
37
-
38
- ## Work style trend
39
-
40
- - The first commit often updates version files and generated API artifacts.
41
- - Follow-up commits often add/update specs and then implement `lib/playwright/**` changes.
42
- - Broader upstream changes usually increase docs/example/assets updates.
@@ -1,35 +0,0 @@
1
- # Playwright Upgrade Workflow
2
-
3
- ## Scope
4
-
5
- Standard process for `Update Playwright driver to 1.xx.x` tasks.
6
-
7
- ## Order (Do not reorder)
8
-
9
- 1. Update versions
10
- - `development/CLI_VERSION`
11
- - `lib/playwright/version.rb` (`VERSION`, `COMPATIBLE_PLAYWRIGHT_VERSION`)
12
-
13
- 2. Update API definition
14
- - Set `PLAYWRIGHT_CLI_EXECUTABLE_PATH`
15
- - `$PLAYWRIGHT_CLI_EXECUTABLE_PATH print-api-json | jq . > development/api.json`
16
-
17
- 3. Clean before generation + regenerate
18
- - `rm lib/playwright_api/*.rb`
19
- - `find documentation/docs -name "*.md" | grep -v documentation/docs/article/ | xargs rm`
20
- - `bundle exec ruby development/generate_api.rb`
21
-
22
- 4. Update tests first
23
- - Add/update `spec/` changes that represent upstream behavior differences.
24
-
25
- 5. Implement
26
- - Apply minimal implementation changes in `lib/playwright/**`.
27
-
28
- 6. Run tests
29
- - `bundle exec rspec`
30
- - Run focused specs first while iterating, then run the full suite.
31
-
32
- ## Notes
33
-
34
- - During upgrade work, prefer the steps in `development/README.md`.
35
- - `development/update_playwright_driver.sh` can be used as a helper script.
@@ -1,30 +0,0 @@
1
- # RSpec Debugging
2
-
3
- ## Critical execution rule
4
-
5
- - Run RSpec via `rbenv exec`.
6
- - Some environments fail with plain `bundle exec rspec`, so always use `rbenv exec bundle exec rspec ...`.
7
-
8
- ## Debug rule when spec fails
9
-
10
- - On failure, rerun with `DEBUG=1`.
11
- - Use `DEBUG=1` output to inspect Playwright protocol logs and isolate the issue.
12
-
13
- ## Example
14
-
15
- ```sh
16
- rbenv exec bundle exec rspec spec/integration/page/aria_snapshot_ai_spec.rb
17
- ```
18
-
19
- ```sh
20
- DEBUG=1 rbenv exec bundle exec rspec spec/integration/page/aria_snapshot_ai_spec.rb
21
- ```
22
-
23
- ## Node.js Playwright protocol log
24
-
25
- - Node.js Playwright protocol logs can be captured with `DEBUG=pw:*`.
26
- - This is useful when comparing behavior against the Ruby client.
27
-
28
- ```sh
29
- DEBUG=pw:* node script.mjs 2>&1 | head -200
30
- ```
@@ -1,18 +0,0 @@
1
- # unimplemented_examples.md
2
-
3
- ## What it is
4
-
5
- - `development/unimplemented_examples.md` is a generated artifact.
6
- - It lists examples from API docs that could not be converted to Ruby examples.
7
-
8
- ## How examples are converted
9
-
10
- - Source: API doc comments
11
- - Conversion rules: `development/generate_api/example_codes.rb`
12
- - Unmapped examples remain in Python in docs and are listed in `development/unimplemented_examples.md`.
13
-
14
- ## When this file changes
15
-
16
- 1. Review the diff to identify unmapped examples.
17
- 2. Add conversion mappings to `development/generate_api/example_codes.rb` when needed.
18
- 3. Re-run `bundle exec ruby development/generate_api.rb`.