playwright-ruby-client 1.49.0 → 1.50.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/browser.md +1 -1
  3. data/documentation/docs/api/browser_type.md +2 -0
  4. data/documentation/docs/api/clock.md +10 -0
  5. data/documentation/docs/api/element_handle.md +0 -1
  6. data/documentation/docs/api/experimental/android_device.md +1 -1
  7. data/documentation/docs/api/frame.md +0 -1
  8. data/documentation/docs/api/locator.md +6 -4
  9. data/documentation/docs/api/locator_assertions.md +41 -8
  10. data/documentation/docs/api/page.md +0 -3
  11. data/documentation/docs/include/api_coverage.md +3 -0
  12. data/lib/playwright/locator_assertions_impl.rb +33 -5
  13. data/lib/playwright/version.rb +2 -2
  14. data/lib/playwright_api/android.rb +4 -4
  15. data/lib/playwright_api/android_device.rb +10 -10
  16. data/lib/playwright_api/api_request_context.rb +4 -4
  17. data/lib/playwright_api/browser.rb +5 -5
  18. data/lib/playwright_api/browser_context.rb +13 -13
  19. data/lib/playwright_api/browser_type.rb +10 -11
  20. data/lib/playwright_api/cdp_session.rb +4 -4
  21. data/lib/playwright_api/clock.rb +10 -0
  22. data/lib/playwright_api/dialog.rb +4 -4
  23. data/lib/playwright_api/element_handle.rb +4 -4
  24. data/lib/playwright_api/frame.rb +8 -8
  25. data/lib/playwright_api/js_handle.rb +4 -4
  26. data/lib/playwright_api/locator.rb +6 -4
  27. data/lib/playwright_api/locator_assertions.rb +33 -9
  28. data/lib/playwright_api/page.rb +12 -14
  29. data/lib/playwright_api/playwright.rb +4 -4
  30. data/lib/playwright_api/request.rb +4 -4
  31. data/lib/playwright_api/response.rb +4 -4
  32. data/lib/playwright_api/route.rb +4 -4
  33. data/lib/playwright_api/selectors.rb +4 -4
  34. data/lib/playwright_api/tracing.rb +4 -4
  35. data/lib/playwright_api/web_socket.rb +4 -4
  36. data/lib/playwright_api/worker.rb +8 -8
  37. data/sig/playwright.rbs +5 -2
  38. metadata +4 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5e833f23292dc337b4ed19f216fd53f9ecc362426b9980e5de3a2a5a23a5542
4
- data.tar.gz: e7b0ffa7a775f4b677a6102e18d9ac8718d102613ef43ef71e3fbaca3f546c6d
3
+ metadata.gz: 495885bd9a517ab41add673d1855ea2d3aaf892c396c3422ded05bc0867f9c8e
4
+ data.tar.gz: c5e2dc6ad6f41f9675eefec747faef96537e78c2af550db2fe4d496c1ba76a24
5
5
  SHA512:
6
- metadata.gz: f3b917af5bca36c7bc2adf5e2b81809d813fcf0d73126b4084ce4caaffa51b313c441f6c0c70eea41411af1228c45e83f6af24e254c4b7abf1268189d0b1f8dc
7
- data.tar.gz: 76105c1d7c6a022d6e503cc17fc4261a0bb545d91890db2a67c4fcb5ae354ea45a326bdcdae4cb4990e0be6f5bb5e4f69da35ed175b76969f27ca73ce20315c5
6
+ metadata.gz: 141cef34e7039d7c04709eb99ca1cc5693bc9c17625616daf964bffe80e8103bdd9a976353f5c2137335048a9d4324e564e30bb993a9e3bd0197154ad457e988
7
+ data.tar.gz: d1e2ee7c636a328621f9228c2b44f050e066ef5eeb5532b47434a45849152840e7e534c8fb76556d437aa90337b0c2e83ae7569062825cf11f67bc8f5a87d275
@@ -40,7 +40,7 @@ were opened).
40
40
  In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the
41
41
  browser server.
42
42
 
43
- **NOTE**: This is similar to force quitting the browser. Therefore, you should call [BrowserContext#close](./browser_context#close) on any [BrowserContext](./browser_context)'s you explicitly created earlier with [Browser#new_context](./browser#new_context) **before** calling [Browser#close](./browser#close).
43
+ **NOTE**: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call [BrowserContext#close](./browser_context#close) on any [BrowserContext](./browser_context) instances you explicitly created earlier using [Browser#new_context](./browser#new_context) **before** calling [Browser#close](./browser#close).
44
44
 
45
45
  The [Browser](./browser) object itself is considered to be disposed and cannot be used anymore.
46
46
 
@@ -37,6 +37,8 @@ The default browser context is accessible via [Browser#contexts](./browser#conte
37
37
 
38
38
  **NOTE**: Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
39
39
 
40
+ **NOTE**: This connection is significantly lower fidelity than the Playwright protocol connection via [BrowserType#connect](./browser_type#connect). If you are experiencing issues or attempting to use advanced functionality, you probably want to use [BrowserType#connect](./browser_type#connect).
41
+
40
42
  **Usage**
41
43
 
42
44
  ```ruby
@@ -85,6 +85,16 @@ page.clock.pause_at(Time.parse("2020-02-02"))
85
85
  page.clock.pause_at("2020-02-02")
86
86
  ```
87
87
 
88
+ For best results, install the clock before navigating the page and set it to a time slightly before the intended test time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the page has fully loaded, you can safely use [Clock#pause_at](./clock#pause_at) to pause the clock.
89
+
90
+ ```ruby
91
+ # Initialize clock with some time before the test time and let the page load
92
+ # naturally. `Date.now` will progress as the timers fire.
93
+ page.clock.install(Time.parse("2024-12-10T08:00:00Z"))
94
+ page.goto("http://localhost:3333")
95
+ page.clock.pause_at(Time.parse("2024-12-10T10:00:00Z"))
96
+ ```
97
+
88
98
  ## resume
89
99
 
90
100
  ```
@@ -192,7 +192,6 @@ properties:
192
192
  You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
193
193
 
194
194
  ```ruby
195
- # note you can only create data_transfer in chromium and firefox
196
195
  data_transfer = page.evaluate_handle("new DataTransfer()")
197
196
  element_handle.dispatch_event("dragstart", eventInit: { dataTransfer: data_transfer })
198
197
  ```
@@ -34,7 +34,6 @@ def launch_browser(
34
34
  baseURL: nil,
35
35
  bypassCSP: nil,
36
36
  colorScheme: nil,
37
- command: nil,
38
37
  deviceScaleFactor: nil,
39
38
  extraHTTPHeaders: nil,
40
39
  forcedColors: nil,
@@ -48,6 +47,7 @@ def launch_browser(
48
47
  noViewport: nil,
49
48
  offline: nil,
50
49
  permissions: nil,
50
+ pkg: nil,
51
51
  proxy: nil,
52
52
  record_har_content: nil,
53
53
  record_har_mode: nil,
@@ -190,7 +190,6 @@ properties:
190
190
  You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
191
191
 
192
192
  ```ruby
193
- # note you can only create data_transfer in chromium and firefox
194
193
  data_transfer = frame.evaluate_handle("new DataTransfer()")
195
194
  frame.dispatch_event("#source", "dragstart", eventInit: { dataTransfer: data_transfer })
196
195
  ```
@@ -358,7 +358,6 @@ properties:
358
358
  You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
359
359
 
360
360
  ```ruby
361
- # note you can only create data_transfer in chromium and firefox
362
361
  data_transfer = page.evaluate_handle("new DataTransfer()")
363
362
  locator.dispatch_event("dragstart", eventInit: { dataTransfer: data_transfer })
364
363
  ```
@@ -945,7 +944,7 @@ def editable?(timeout: nil)
945
944
  ```
946
945
 
947
946
 
948
- Returns whether the element is [editable](https://playwright.dev/python/docs/actionability#editable).
947
+ Returns whether the element is [editable](https://playwright.dev/python/docs/actionability#editable). If the target element is not an `<input>`, `<textarea>`, `<select>`, `[contenteditable]` and does not have a role allowing `[aria-readonly]`, this method throws an error.
949
948
 
950
949
  **NOTE**: If you need to assert that an element is editable, prefer [LocatorAssertions#to_be_editable](./locator_assertions#to_be_editable) to avoid flakiness. See [assertions guide](https://playwright.dev/python/docs/test-assertions) for more details.
951
950
 
@@ -1061,16 +1060,19 @@ def or(locator)
1061
1060
 
1062
1061
  Creates a locator matching all elements that match one or both of the two locators.
1063
1062
 
1064
- Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](https://playwright.dev/python/docs/locators#strictness) guidelines.
1063
+ Note that when both locators match something, the resulting locator will have multiple matches, potentially causing a [locator strictness](https://playwright.dev/python/docs/locators#strictness) violation.
1065
1064
 
1066
1065
  **Usage**
1067
1066
 
1068
1067
  Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.
1069
1068
 
1069
+ **NOTE**: If both "New email" button and security dialog appear on screen, the "or" locator will match both of them,
1070
+ possibly throwing the ["strict mode violation" error](https://playwright.dev/python/docs/locators#strictness). In this case, you can use [Locator#first](./locator#first) to only match one of them.
1071
+
1070
1072
  ```ruby
1071
1073
  new_email = page.get_by_role("button", name: "New")
1072
1074
  dialog = page.get_by_text("Confirm security settings")
1073
- new_email.or(dialog).wait_for(state: 'visible')
1075
+ new_email.or(dialog).first.wait_for(state: 'visible')
1074
1076
  if dialog.visible?
1075
1077
  page.get_by_role("button", name: "Dismiss").click
1076
1078
  end
@@ -134,6 +134,15 @@ expect(locator).not_to have_accessible_description(name, ignoreCase: nil, timeou
134
134
 
135
135
  The opposite of [LocatorAssertions#to_have_accessible_description](./locator_assertions#to_have_accessible_description).
136
136
 
137
+ ## not_to_have_accessible_error_message
138
+
139
+ ```ruby
140
+ expect(locator).not_to have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
141
+ ```
142
+
143
+
144
+ The opposite of [LocatorAssertions#to_have_accessible_error_message](./locator_assertions#to_have_accessible_error_message).
145
+
137
146
  ## not_to_have_accessible_name
138
147
 
139
148
  ```ruby
@@ -233,6 +242,15 @@ expect(locator).not_to have_values(values, timeout: nil)
233
242
 
234
243
  The opposite of [LocatorAssertions#to_have_values](./locator_assertions#to_have_values).
235
244
 
245
+ ## not_to_match_aria_snapshot
246
+
247
+ ```ruby
248
+ expect(locator).not_to match_aria_snapshot(expected, timeout: nil)
249
+ ```
250
+
251
+
252
+ The opposite of [LocatorAssertions#to_match_aria_snapshot](./locator_assertions#to_match_aria_snapshot).
253
+
236
254
  ## to_be_attached
237
255
 
238
256
  ```ruby
@@ -257,7 +275,7 @@ expect(page.get_by_text("Hidden text")).to be_attached
257
275
  ## to_be_checked
258
276
 
259
277
  ```ruby
260
- expect(locator).to be_checked(checked: nil, timeout: nil)
278
+ expect(locator).to be_checked(checked: nil, indeterminate: nil, timeout: nil)
261
279
  ```
262
280
 
263
281
 
@@ -488,6 +506,22 @@ locator = page.get_by_test_id("save-button")
488
506
  expect(locator).to have_accessible_description("Save results to disk")
489
507
  ```
490
508
 
509
+ ## to_have_accessible_error_message
510
+
511
+ ```ruby
512
+ expect(locator).to have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
513
+ ```
514
+
515
+
516
+ Ensures the [Locator](./locator) points to an element with a given [aria errormessage](https://w3c.github.io/aria/#aria-errormessage).
517
+
518
+ **Usage**
519
+
520
+ ```ruby
521
+ locator = page.get_by_test_id("username-input")
522
+ expect(locator).to have_accessible_error_message("Username is required.")
523
+ ```
524
+
491
525
  ## to_have_accessible_name
492
526
 
493
527
  ```ruby
@@ -527,22 +561,21 @@ expect(locator).to have_class(expected, timeout: nil)
527
561
  ```
528
562
 
529
563
 
530
- Ensures the [Locator](./locator) points to an element with given CSS classes. This needs to be a full match
531
- or using a relaxed regular expression.
564
+ Ensures the [Locator](./locator) points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes or perform partial matches, use a regular expression:
532
565
 
533
566
  **Usage**
534
567
 
535
568
  ```html
536
- <div class='selected row' id='component'></div>
569
+ <div class='middle selected row' id='component'></div>
537
570
  ```
538
571
 
539
572
  ```ruby
540
573
  locator = page.locator("#component")
541
- expect(locator).to have_class(/selected/)
542
- expect(locator).to have_class("selected row")
574
+ expect(locator).to have_class(/(^|\s)selected(\s|$)/)
575
+ expect(locator).to have_class("middle selected row")
543
576
  ```
544
577
 
545
- Note that if array is passed as an expected value, entire lists of elements can be asserted:
578
+ When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array:
546
579
 
547
580
  ```ruby
548
581
  locator = page.locator("list > .component")
@@ -741,7 +774,7 @@ Asserts that the target element matches the given [accessibility snapshot](https
741
774
 
742
775
  ```ruby
743
776
  page.goto('https://demo.playwright.dev/todomvc/')
744
- expect(page.locator('body')).to_match_aria_snapshot(<<~YAML)
777
+ expect(page.locator('body')).to match_aria_snapshot(<<~YAML)
745
778
  - heading "todos"
746
779
  - textbox "What needs to be done?"
747
780
  YAML
@@ -253,7 +253,6 @@ You can also specify [JSHandle](./js_handle) as the property value if you want l
253
253
  ```ruby
254
254
  page.content = '<div id="source">Drag</div>'
255
255
 
256
- # note you can only create data_transfer in chromium and firefox
257
256
  data_transfer = page.evaluate_handle("new DataTransfer()")
258
257
  page.dispatch_event("#source", "dragstart", eventInit: { dataTransfer: data_transfer })
259
258
  ```
@@ -1063,8 +1062,6 @@ def pdf(
1063
1062
 
1064
1063
  Returns the PDF buffer.
1065
1064
 
1066
- **NOTE**: Generating a pdf is currently only supported in Chromium headless.
1067
-
1068
1065
  `page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call
1069
1066
  [Page#emulate_media](./page#emulate_media) before calling `page.pdf()`:
1070
1067
 
@@ -565,6 +565,7 @@
565
565
  * not_to_be_visible
566
566
  * not_to_contain_text
567
567
  * not_to_have_accessible_description
568
+ * not_to_have_accessible_error_message
568
569
  * not_to_have_accessible_name
569
570
  * not_to_have_attribute
570
571
  * not_to_have_class
@@ -576,6 +577,7 @@
576
577
  * not_to_have_text
577
578
  * not_to_have_value
578
579
  * not_to_have_values
580
+ * not_to_match_aria_snapshot
579
581
  * to_be_attached
580
582
  * to_be_checked
581
583
  * to_be_disabled
@@ -588,6 +590,7 @@
588
590
  * to_be_visible
589
591
  * to_contain_text
590
592
  * to_have_accessible_description
593
+ * to_have_accessible_error_message
591
594
  * to_have_accessible_name
592
595
  * to_have_attribute
593
596
  * to_have_class
@@ -149,7 +149,7 @@ module Playwright
149
149
  _define_negation :to_contain_text
150
150
 
151
151
  def to_have_accessible_name(name, ignoreCase: nil, timeout: nil)
152
- expected_text = to_expected_text_values([name], ignore_case: ignoreCase)
152
+ expected_text = to_expected_text_values([name], ignore_case: ignoreCase, normalize_white_space: true)
153
153
  expect_impl(
154
154
  "to.have.accessible.name",
155
155
  {
@@ -163,7 +163,7 @@ module Playwright
163
163
  _define_negation :to_have_accessible_name
164
164
 
165
165
  def to_have_accessible_description(name, ignoreCase: nil, timeout: nil)
166
- expected_text = to_expected_text_values([name], ignore_case: ignoreCase)
166
+ expected_text = to_expected_text_values([name], ignore_case: ignoreCase, normalize_white_space: true)
167
167
  expect_impl(
168
168
  "to.have.accessible.description",
169
169
  {
@@ -176,6 +176,20 @@ module Playwright
176
176
  end
177
177
  _define_negation :to_have_accessible_description
178
178
 
179
+ def to_have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
180
+ expected_text = to_expected_text_values([errorMessage], ignore_case: ignoreCase, normalize_white_space: true)
181
+ expect_impl(
182
+ "to.have.accessible.error.message",
183
+ {
184
+ expectedText: expected_text,
185
+ timeout: timeout,
186
+ },
187
+ errorMessage,
188
+ "Locator expected to have accessible error message"
189
+ )
190
+ end
191
+ _define_negation :to_have_accessible_error_message
192
+
179
193
  def to_have_attribute(name, value, ignoreCase: nil, timeout: nil)
180
194
  expected_text = to_expected_text_values([value], ignore_case: ignoreCase)
181
195
  expect_impl(
@@ -372,6 +386,7 @@ module Playwright
372
386
  'Locator expected to match Aria snapshot',
373
387
  )
374
388
  end
389
+ _define_negation :to_match_aria_snapshot
375
390
 
376
391
  def to_be_attached(attached: nil, timeout: nil)
377
392
  expect_impl(
@@ -383,10 +398,23 @@ module Playwright
383
398
  end
384
399
  _define_negation :to_be_attached
385
400
 
386
- def to_be_checked(checked: nil, timeout: nil)
401
+ def to_be_checked(checked: nil, indeterminate: nil, timeout: nil)
402
+ expected_value = {
403
+ indeterminate: indeterminate,
404
+ checked: checked,
405
+ }.compact
406
+ checked_string =
407
+ if indeterminate
408
+ "indeterminate"
409
+ elsif checked
410
+ "checked"
411
+ else
412
+ "unchecked"
413
+ end
414
+
387
415
  expect_impl(
388
- (checked || checked.nil?) ? "to.be.checked" : "to.be.unchecked",
389
- { timeout: timeout },
416
+ "to.be.checked",
417
+ { timeout: timeout, expectedValue: expected_value },
390
418
  nil,
391
419
  "Locator expected to be checked"
392
420
  )
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.49.0'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.49.0'
4
+ VERSION = '1.50.0'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.50.1'
6
6
  end
@@ -46,14 +46,14 @@ module Playwright
46
46
 
47
47
  # -- inherited from EventEmitter --
48
48
  # @nodoc
49
- def once(event, callback)
50
- event_emitter_proxy.once(event, callback)
49
+ def on(event, callback)
50
+ event_emitter_proxy.on(event, callback)
51
51
  end
52
52
 
53
53
  # -- inherited from EventEmitter --
54
54
  # @nodoc
55
- def on(event, callback)
56
- event_emitter_proxy.on(event, callback)
55
+ def once(event, callback)
56
+ event_emitter_proxy.once(event, callback)
57
57
  end
58
58
 
59
59
  private def event_emitter_proxy
@@ -51,7 +51,6 @@ module Playwright
51
51
  baseURL: nil,
52
52
  bypassCSP: nil,
53
53
  colorScheme: nil,
54
- command: nil,
55
54
  deviceScaleFactor: nil,
56
55
  extraHTTPHeaders: nil,
57
56
  forcedColors: nil,
@@ -65,6 +64,7 @@ module Playwright
65
64
  noViewport: nil,
66
65
  offline: nil,
67
66
  permissions: nil,
67
+ pkg: nil,
68
68
  proxy: nil,
69
69
  record_har_content: nil,
70
70
  record_har_mode: nil,
@@ -81,7 +81,7 @@ module Playwright
81
81
  userAgent: nil,
82
82
  viewport: nil,
83
83
  &block)
84
- wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), command: unwrap_impl(command), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), forcedColors: unwrap_impl(forcedColors), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_content: unwrap_impl(record_har_content), record_har_mode: unwrap_impl(record_har_mode), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_har_url_filter: unwrap_impl(record_har_url_filter), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), serviceWorkers: unwrap_impl(serviceWorkers), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
84
+ wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), forcedColors: unwrap_impl(forcedColors), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), pkg: unwrap_impl(pkg), proxy: unwrap_impl(proxy), record_har_content: unwrap_impl(record_har_content), record_har_mode: unwrap_impl(record_har_mode), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_har_url_filter: unwrap_impl(record_har_url_filter), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), serviceWorkers: unwrap_impl(serviceWorkers), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
85
85
  end
86
86
 
87
87
  #
@@ -194,13 +194,13 @@ module Playwright
194
194
  end
195
195
 
196
196
  # @nodoc
197
- def tap_on(selector, duration: nil, timeout: nil)
198
- wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
197
+ def should_close_connection_on_close!
198
+ wrap_impl(@impl.should_close_connection_on_close!)
199
199
  end
200
200
 
201
201
  # @nodoc
202
- def should_close_connection_on_close!
203
- wrap_impl(@impl.should_close_connection_on_close!)
202
+ def tap_on(selector, duration: nil, timeout: nil)
203
+ wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
204
204
  end
205
205
 
206
206
  # -- inherited from EventEmitter --
@@ -211,14 +211,14 @@ module Playwright
211
211
 
212
212
  # -- inherited from EventEmitter --
213
213
  # @nodoc
214
- def once(event, callback)
215
- event_emitter_proxy.once(event, callback)
214
+ def on(event, callback)
215
+ event_emitter_proxy.on(event, callback)
216
216
  end
217
217
 
218
218
  # -- inherited from EventEmitter --
219
219
  # @nodoc
220
- def on(event, callback)
221
- event_emitter_proxy.on(event, callback)
220
+ def once(event, callback)
221
+ event_emitter_proxy.once(event, callback)
222
222
  end
223
223
 
224
224
  private def event_emitter_proxy
@@ -294,14 +294,14 @@ module Playwright
294
294
 
295
295
  # -- inherited from EventEmitter --
296
296
  # @nodoc
297
- def once(event, callback)
298
- event_emitter_proxy.once(event, callback)
297
+ def on(event, callback)
298
+ event_emitter_proxy.on(event, callback)
299
299
  end
300
300
 
301
301
  # -- inherited from EventEmitter --
302
302
  # @nodoc
303
- def on(event, callback)
304
- event_emitter_proxy.on(event, callback)
303
+ def once(event, callback)
304
+ event_emitter_proxy.once(event, callback)
305
305
  end
306
306
 
307
307
  private def event_emitter_proxy
@@ -30,7 +30,7 @@ module Playwright
30
30
  # In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the
31
31
  # browser server.
32
32
  #
33
- # **NOTE**: This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`] on any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling [`method: Browser.close`].
33
+ # **NOTE**: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call [`method: BrowserContext.close`] on any `BrowserContext` instances you explicitly created earlier using [`method: Browser.newContext`] **before** calling [`method: Browser.close`].
34
34
  #
35
35
  # The `Browser` object itself is considered to be disposed and cannot be used anymore.
36
36
  def close(reason: nil)
@@ -209,14 +209,14 @@ module Playwright
209
209
 
210
210
  # -- inherited from EventEmitter --
211
211
  # @nodoc
212
- def once(event, callback)
213
- event_emitter_proxy.once(event, callback)
212
+ def on(event, callback)
213
+ event_emitter_proxy.on(event, callback)
214
214
  end
215
215
 
216
216
  # -- inherited from EventEmitter --
217
217
  # @nodoc
218
- def on(event, callback)
219
- event_emitter_proxy.on(event, callback)
218
+ def once(event, callback)
219
+ event_emitter_proxy.once(event, callback)
220
220
  end
221
221
 
222
222
  private def event_emitter_proxy
@@ -463,6 +463,11 @@ module Playwright
463
463
  raise NotImplementedError.new('wait_for_event is not implemented yet.')
464
464
  end
465
465
 
466
+ # @nodoc
467
+ def enable_debug_console!
468
+ wrap_impl(@impl.enable_debug_console!)
469
+ end
470
+
466
471
  # @nodoc
467
472
  def pause
468
473
  wrap_impl(@impl.pause)
@@ -474,18 +479,13 @@ module Playwright
474
479
  end
475
480
 
476
481
  # @nodoc
477
- def owner_page=(req)
478
- wrap_impl(@impl.owner_page=(unwrap_impl(req)))
479
- end
480
-
481
- # @nodoc
482
- def enable_debug_console!
483
- wrap_impl(@impl.enable_debug_console!)
482
+ def browser=(req)
483
+ wrap_impl(@impl.browser=(unwrap_impl(req)))
484
484
  end
485
485
 
486
486
  # @nodoc
487
- def browser=(req)
488
- wrap_impl(@impl.browser=(unwrap_impl(req)))
487
+ def owner_page=(req)
488
+ wrap_impl(@impl.owner_page=(unwrap_impl(req)))
489
489
  end
490
490
 
491
491
  # -- inherited from EventEmitter --
@@ -496,14 +496,14 @@ module Playwright
496
496
 
497
497
  # -- inherited from EventEmitter --
498
498
  # @nodoc
499
- def once(event, callback)
500
- event_emitter_proxy.once(event, callback)
499
+ def on(event, callback)
500
+ event_emitter_proxy.on(event, callback)
501
501
  end
502
502
 
503
503
  # -- inherited from EventEmitter --
504
504
  # @nodoc
505
- def on(event, callback)
506
- event_emitter_proxy.on(event, callback)
505
+ def once(event, callback)
506
+ event_emitter_proxy.once(event, callback)
507
507
  end
508
508
 
509
509
  private def event_emitter_proxy
@@ -20,13 +20,10 @@ module Playwright
20
20
  class BrowserType < PlaywrightApi
21
21
 
22
22
  #
23
- # This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x).
24
- def connect(
25
- wsEndpoint,
26
- exposeNetwork: nil,
27
- headers: nil,
28
- slowMo: nil,
29
- timeout: nil)
23
+ # This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
24
+ #
25
+ # **NOTE**: The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
26
+ def connect
30
27
  raise NotImplementedError.new('connect is not implemented yet.')
31
28
  end
32
29
 
@@ -37,6 +34,8 @@ module Playwright
37
34
  #
38
35
  # **NOTE**: Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
39
36
  #
37
+ # **NOTE**: This connection is significantly lower fidelity than the Playwright protocol connection via [`method: BrowserType.connect`]. If you are experiencing issues or attempting to use advanced functionality, you probably want to use [`method: BrowserType.connect`].
38
+ #
40
39
  # **Usage**
41
40
  #
42
41
  # ```python sync
@@ -183,14 +182,14 @@ module Playwright
183
182
 
184
183
  # -- inherited from EventEmitter --
185
184
  # @nodoc
186
- def once(event, callback)
187
- event_emitter_proxy.once(event, callback)
185
+ def on(event, callback)
186
+ event_emitter_proxy.on(event, callback)
188
187
  end
189
188
 
190
189
  # -- inherited from EventEmitter --
191
190
  # @nodoc
192
- def on(event, callback)
193
- event_emitter_proxy.on(event, callback)
191
+ def once(event, callback)
192
+ event_emitter_proxy.once(event, callback)
194
193
  end
195
194
 
196
195
  private def event_emitter_proxy
@@ -39,14 +39,14 @@ module Playwright
39
39
 
40
40
  # -- inherited from EventEmitter --
41
41
  # @nodoc
42
- def once(event, callback)
43
- event_emitter_proxy.once(event, callback)
42
+ def on(event, callback)
43
+ event_emitter_proxy.on(event, callback)
44
44
  end
45
45
 
46
46
  # -- inherited from EventEmitter --
47
47
  # @nodoc
48
- def on(event, callback)
49
- event_emitter_proxy.on(event, callback)
48
+ def once(event, callback)
49
+ event_emitter_proxy.once(event, callback)
50
50
  end
51
51
 
52
52
  private def event_emitter_proxy
@@ -65,6 +65,16 @@ module Playwright
65
65
  # page.clock.pause_at(datetime.datetime(2020, 2, 2))
66
66
  # page.clock.pause_at("2020-02-02")
67
67
  # ```
68
+ #
69
+ # For best results, install the clock before navigating the page and set it to a time slightly before the intended test time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the page has fully loaded, you can safely use [`method: Clock.pauseAt`] to pause the clock.
70
+ #
71
+ # ```python sync
72
+ # # Initialize clock with some time before the test time and let the page load
73
+ # # naturally. `Date.now` will progress as the timers fire.
74
+ # page.clock.install(time=datetime.datetime(2024, 12, 10, 8, 0, 0))
75
+ # page.goto("http://localhost:3333")
76
+ # page.clock.pause_at(datetime.datetime(2024, 12, 10, 10, 0, 0))
77
+ # ```
68
78
  def pause_at(time)
69
79
  wrap_impl(@impl.pause_at(unwrap_impl(time)))
70
80
  end
@@ -76,14 +76,14 @@ module Playwright
76
76
 
77
77
  # -- inherited from EventEmitter --
78
78
  # @nodoc
79
- def once(event, callback)
80
- event_emitter_proxy.once(event, callback)
79
+ def on(event, callback)
80
+ event_emitter_proxy.on(event, callback)
81
81
  end
82
82
 
83
83
  # -- inherited from EventEmitter --
84
84
  # @nodoc
85
- def on(event, callback)
86
- event_emitter_proxy.on(event, callback)
85
+ def once(event, callback)
86
+ event_emitter_proxy.once(event, callback)
87
87
  end
88
88
 
89
89
  private def event_emitter_proxy
@@ -580,14 +580,14 @@ module Playwright
580
580
 
581
581
  # -- inherited from EventEmitter --
582
582
  # @nodoc
583
- def once(event, callback)
584
- event_emitter_proxy.once(event, callback)
583
+ def on(event, callback)
584
+ event_emitter_proxy.on(event, callback)
585
585
  end
586
586
 
587
587
  # -- inherited from EventEmitter --
588
588
  # @nodoc
589
- def on(event, callback)
590
- event_emitter_proxy.on(event, callback)
589
+ def once(event, callback)
590
+ event_emitter_proxy.once(event, callback)
591
591
  end
592
592
 
593
593
  private def event_emitter_proxy
@@ -1039,13 +1039,13 @@ module Playwright
1039
1039
  end
1040
1040
 
1041
1041
  # @nodoc
1042
- def detached=(req)
1043
- wrap_impl(@impl.detached=(unwrap_impl(req)))
1042
+ def highlight(selector)
1043
+ wrap_impl(@impl.highlight(unwrap_impl(selector)))
1044
1044
  end
1045
1045
 
1046
1046
  # @nodoc
1047
- def highlight(selector)
1048
- wrap_impl(@impl.highlight(unwrap_impl(selector)))
1047
+ def detached=(req)
1048
+ wrap_impl(@impl.detached=(unwrap_impl(req)))
1049
1049
  end
1050
1050
 
1051
1051
  # -- inherited from EventEmitter --
@@ -1056,14 +1056,14 @@ module Playwright
1056
1056
 
1057
1057
  # -- inherited from EventEmitter --
1058
1058
  # @nodoc
1059
- def once(event, callback)
1060
- event_emitter_proxy.once(event, callback)
1059
+ def on(event, callback)
1060
+ event_emitter_proxy.on(event, callback)
1061
1061
  end
1062
1062
 
1063
1063
  # -- inherited from EventEmitter --
1064
1064
  # @nodoc
1065
- def on(event, callback)
1066
- event_emitter_proxy.on(event, callback)
1065
+ def once(event, callback)
1066
+ event_emitter_proxy.once(event, callback)
1067
1067
  end
1068
1068
 
1069
1069
  private def event_emitter_proxy
@@ -106,14 +106,14 @@ module Playwright
106
106
 
107
107
  # -- inherited from EventEmitter --
108
108
  # @nodoc
109
- def once(event, callback)
110
- event_emitter_proxy.once(event, callback)
109
+ def on(event, callback)
110
+ event_emitter_proxy.on(event, callback)
111
111
  end
112
112
 
113
113
  # -- inherited from EventEmitter --
114
114
  # @nodoc
115
- def on(event, callback)
116
- event_emitter_proxy.on(event, callback)
115
+ def once(event, callback)
116
+ event_emitter_proxy.once(event, callback)
117
117
  end
118
118
 
119
119
  private def event_emitter_proxy
@@ -309,7 +309,6 @@ module Playwright
309
309
  # You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:
310
310
  #
311
311
  # ```python sync
312
- # # note you can only create data_transfer in chromium and firefox
313
312
  # data_transfer = page.evaluate_handle("new DataTransfer()")
314
313
  # locator.dispatch_event("#source", "dragstart", {"dataTransfer": data_transfer})
315
314
  # ```
@@ -801,7 +800,7 @@ module Playwright
801
800
  end
802
801
 
803
802
  #
804
- # Returns whether the element is [editable](../actionability.md#editable).
803
+ # Returns whether the element is [editable](../actionability.md#editable). If the target element is not an `<input>`, `<textarea>`, `<select>`, `[contenteditable]` and does not have a role allowing `[aria-readonly]`, this method throws an error.
805
804
  #
806
805
  # **NOTE**: If you need to assert that an element is editable, prefer [`method: LocatorAssertions.toBeEditable`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.
807
806
  #
@@ -896,16 +895,19 @@ module Playwright
896
895
  #
897
896
  # Creates a locator matching all elements that match one or both of the two locators.
898
897
  #
899
- # Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.md#strictness) guidelines.
898
+ # Note that when both locators match something, the resulting locator will have multiple matches, potentially causing a [locator strictness](../locators.md#strictness) violation.
900
899
  #
901
900
  # **Usage**
902
901
  #
903
902
  # Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.
904
903
  #
904
+ # **NOTE**: If both "New email" button and security dialog appear on screen, the "or" locator will match both of them,
905
+ # possibly throwing the ["strict mode violation" error](../locators.md#strictness). In this case, you can use [`method: Locator.first`] to only match one of them.
906
+ #
905
907
  # ```python sync
906
908
  # new_email = page.get_by_role("button", name="New")
907
909
  # dialog = page.get_by_text("Confirm security settings")
908
- # expect(new_email.or_(dialog)).to_be_visible()
910
+ # expect(new_email.or_(dialog).first).to_be_visible()
909
911
  # if (dialog.is_visible()):
910
912
  # page.get_by_role("button", name="Dismiss").click()
911
913
  # new_email.click()
@@ -84,6 +84,12 @@ module Playwright
84
84
  wrap_impl(@impl.not_to_have_accessible_description(unwrap_impl(name), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
85
85
  end
86
86
 
87
+ #
88
+ # The opposite of [`method: LocatorAssertions.toHaveAccessibleErrorMessage`].
89
+ def not_to_have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
90
+ wrap_impl(@impl.not_to_have_accessible_error_message(unwrap_impl(errorMessage), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
91
+ end
92
+
87
93
  #
88
94
  # The opposite of [`method: LocatorAssertions.toHaveAccessibleName`].
89
95
  def not_to_have_accessible_name(name, ignoreCase: nil, timeout: nil)
@@ -150,6 +156,12 @@ module Playwright
150
156
  wrap_impl(@impl.not_to_have_values(unwrap_impl(values), timeout: unwrap_impl(timeout)))
151
157
  end
152
158
 
159
+ #
160
+ # The opposite of [`method: LocatorAssertions.toMatchAriaSnapshot`].
161
+ def not_to_match_aria_snapshot(expected, timeout: nil)
162
+ wrap_impl(@impl.not_to_match_aria_snapshot(unwrap_impl(expected), timeout: unwrap_impl(timeout)))
163
+ end
164
+
153
165
  #
154
166
  # Ensures that `Locator` points to an element that is [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.
155
167
  #
@@ -173,8 +185,8 @@ module Playwright
173
185
  # locator = page.get_by_label("Subscribe to newsletter")
174
186
  # expect(locator).to_be_checked()
175
187
  # ```
176
- def to_be_checked(checked: nil, timeout: nil)
177
- wrap_impl(@impl.to_be_checked(checked: unwrap_impl(checked), timeout: unwrap_impl(timeout)))
188
+ def to_be_checked(checked: nil, indeterminate: nil, timeout: nil)
189
+ wrap_impl(@impl.to_be_checked(checked: unwrap_impl(checked), indeterminate: unwrap_impl(indeterminate), timeout: unwrap_impl(timeout)))
178
190
  end
179
191
 
180
192
  #
@@ -385,6 +397,19 @@ module Playwright
385
397
  wrap_impl(@impl.to_have_accessible_description(unwrap_impl(description), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
386
398
  end
387
399
 
400
+ #
401
+ # Ensures the `Locator` points to an element with a given [aria errormessage](https://w3c.github.io/aria/#aria-errormessage).
402
+ #
403
+ # **Usage**
404
+ #
405
+ # ```python sync
406
+ # locator = page.get_by_test_id("username-input")
407
+ # expect(locator).to_have_accessible_error_message("Username is required.")
408
+ # ```
409
+ def to_have_accessible_error_message(errorMessage, ignoreCase: nil, timeout: nil)
410
+ wrap_impl(@impl.to_have_accessible_error_message(unwrap_impl(errorMessage), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
411
+ end
412
+
388
413
  #
389
414
  # Ensures the `Locator` points to an element with a given [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
390
415
  #
@@ -414,24 +439,23 @@ module Playwright
414
439
  end
415
440
 
416
441
  #
417
- # Ensures the `Locator` points to an element with given CSS classes. This needs to be a full match
418
- # or using a relaxed regular expression.
442
+ # Ensures the `Locator` points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes or perform partial matches, use a regular expression:
419
443
  #
420
444
  # **Usage**
421
445
  #
422
446
  # ```html
423
- # <div class='selected row' id='component'></div>
447
+ # <div class='middle selected row' id='component'></div>
424
448
  # ```
425
449
  #
426
450
  # ```python sync
427
451
  # from playwright.sync_api import expect
428
452
  #
429
453
  # locator = page.locator("#component")
430
- # expect(locator).to_have_class(re.compile(r"selected"))
431
- # expect(locator).to_have_class("selected row")
454
+ # expect(locator).to_have_class(re.compile(r"(^|\\s)selected(\\s|$)"))
455
+ # expect(locator).to_have_class("middle selected row")
432
456
  # ```
433
457
  #
434
- # Note that if array is passed as an expected value, entire lists of elements can be asserted:
458
+ # When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array:
435
459
  #
436
460
  # ```python sync
437
461
  # from playwright.sync_api import expect
@@ -623,7 +647,7 @@ module Playwright
623
647
  # **Usage**
624
648
  #
625
649
  # ```python sync
626
- # page.goto('https://demo.playwright.dev/todomvc/')
650
+ # page.goto("https://demo.playwright.dev/todomvc/")
627
651
  # expect(page.locator('body')).to_match_aria_snapshot('''
628
652
  # - heading "todos"
629
653
  # - textbox "What needs to be done?"
@@ -957,8 +957,6 @@ module Playwright
957
957
  #
958
958
  # Returns the PDF buffer.
959
959
  #
960
- # **NOTE**: Generating a pdf is currently only supported in Chromium headless.
961
- #
962
960
  # `page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call
963
961
  # [`method: Page.emulateMedia`] before calling `page.pdf()`:
964
962
  #
@@ -1795,13 +1793,13 @@ module Playwright
1795
1793
  end
1796
1794
 
1797
1795
  # @nodoc
1798
- def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1799
- wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1796
+ def stop_js_coverage
1797
+ wrap_impl(@impl.stop_js_coverage)
1800
1798
  end
1801
1799
 
1802
1800
  # @nodoc
1803
- def stop_js_coverage
1804
- wrap_impl(@impl.stop_js_coverage)
1801
+ def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1802
+ wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1805
1803
  end
1806
1804
 
1807
1805
  # @nodoc
@@ -1810,13 +1808,13 @@ module Playwright
1810
1808
  end
1811
1809
 
1812
1810
  # @nodoc
1813
- def guid
1814
- wrap_impl(@impl.guid)
1811
+ def owned_context=(req)
1812
+ wrap_impl(@impl.owned_context=(unwrap_impl(req)))
1815
1813
  end
1816
1814
 
1817
1815
  # @nodoc
1818
- def owned_context=(req)
1819
- wrap_impl(@impl.owned_context=(unwrap_impl(req)))
1816
+ def guid
1817
+ wrap_impl(@impl.guid)
1820
1818
  end
1821
1819
 
1822
1820
  # -- inherited from EventEmitter --
@@ -1827,14 +1825,14 @@ module Playwright
1827
1825
 
1828
1826
  # -- inherited from EventEmitter --
1829
1827
  # @nodoc
1830
- def once(event, callback)
1831
- event_emitter_proxy.once(event, callback)
1828
+ def on(event, callback)
1829
+ event_emitter_proxy.on(event, callback)
1832
1830
  end
1833
1831
 
1834
1832
  # -- inherited from EventEmitter --
1835
1833
  # @nodoc
1836
- def on(event, callback)
1837
- event_emitter_proxy.on(event, callback)
1834
+ def once(event, callback)
1835
+ event_emitter_proxy.once(event, callback)
1838
1836
  end
1839
1837
 
1840
1838
  private def event_emitter_proxy
@@ -111,14 +111,14 @@ module Playwright
111
111
 
112
112
  # -- inherited from EventEmitter --
113
113
  # @nodoc
114
- def once(event, callback)
115
- event_emitter_proxy.once(event, callback)
114
+ def on(event, callback)
115
+ event_emitter_proxy.on(event, callback)
116
116
  end
117
117
 
118
118
  # -- inherited from EventEmitter --
119
119
  # @nodoc
120
- def on(event, callback)
121
- event_emitter_proxy.on(event, callback)
120
+ def once(event, callback)
121
+ event_emitter_proxy.once(event, callback)
122
122
  end
123
123
 
124
124
  private def event_emitter_proxy
@@ -213,14 +213,14 @@ module Playwright
213
213
 
214
214
  # -- inherited from EventEmitter --
215
215
  # @nodoc
216
- def once(event, callback)
217
- event_emitter_proxy.once(event, callback)
216
+ def on(event, callback)
217
+ event_emitter_proxy.on(event, callback)
218
218
  end
219
219
 
220
220
  # -- inherited from EventEmitter --
221
221
  # @nodoc
222
- def on(event, callback)
223
- event_emitter_proxy.on(event, callback)
222
+ def once(event, callback)
223
+ event_emitter_proxy.once(event, callback)
224
224
  end
225
225
 
226
226
  private def event_emitter_proxy
@@ -135,14 +135,14 @@ module Playwright
135
135
 
136
136
  # -- inherited from EventEmitter --
137
137
  # @nodoc
138
- def once(event, callback)
139
- event_emitter_proxy.once(event, callback)
138
+ def on(event, callback)
139
+ event_emitter_proxy.on(event, callback)
140
140
  end
141
141
 
142
142
  # -- inherited from EventEmitter --
143
143
  # @nodoc
144
- def on(event, callback)
145
- event_emitter_proxy.on(event, callback)
144
+ def once(event, callback)
145
+ event_emitter_proxy.once(event, callback)
146
146
  end
147
147
 
148
148
  private def event_emitter_proxy
@@ -180,14 +180,14 @@ module Playwright
180
180
 
181
181
  # -- inherited from EventEmitter --
182
182
  # @nodoc
183
- def once(event, callback)
184
- event_emitter_proxy.once(event, callback)
183
+ def on(event, callback)
184
+ event_emitter_proxy.on(event, callback)
185
185
  end
186
186
 
187
187
  # -- inherited from EventEmitter --
188
188
  # @nodoc
189
- def on(event, callback)
190
- event_emitter_proxy.on(event, callback)
189
+ def once(event, callback)
190
+ event_emitter_proxy.once(event, callback)
191
191
  end
192
192
 
193
193
  private def event_emitter_proxy
@@ -69,14 +69,14 @@ module Playwright
69
69
 
70
70
  # -- inherited from EventEmitter --
71
71
  # @nodoc
72
- def once(event, callback)
73
- event_emitter_proxy.once(event, callback)
72
+ def on(event, callback)
73
+ event_emitter_proxy.on(event, callback)
74
74
  end
75
75
 
76
76
  # -- inherited from EventEmitter --
77
77
  # @nodoc
78
- def on(event, callback)
79
- event_emitter_proxy.on(event, callback)
78
+ def once(event, callback)
79
+ event_emitter_proxy.once(event, callback)
80
80
  end
81
81
 
82
82
  private def event_emitter_proxy
@@ -103,14 +103,14 @@ module Playwright
103
103
 
104
104
  # -- inherited from EventEmitter --
105
105
  # @nodoc
106
- def once(event, callback)
107
- event_emitter_proxy.once(event, callback)
106
+ def on(event, callback)
107
+ event_emitter_proxy.on(event, callback)
108
108
  end
109
109
 
110
110
  # -- inherited from EventEmitter --
111
111
  # @nodoc
112
- def on(event, callback)
113
- event_emitter_proxy.on(event, callback)
112
+ def once(event, callback)
113
+ event_emitter_proxy.once(event, callback)
114
114
  end
115
115
 
116
116
  private def event_emitter_proxy
@@ -40,14 +40,14 @@ module Playwright
40
40
 
41
41
  # -- inherited from EventEmitter --
42
42
  # @nodoc
43
- def once(event, callback)
44
- event_emitter_proxy.once(event, callback)
43
+ def on(event, callback)
44
+ event_emitter_proxy.on(event, callback)
45
45
  end
46
46
 
47
47
  # -- inherited from EventEmitter --
48
48
  # @nodoc
49
- def on(event, callback)
50
- event_emitter_proxy.on(event, callback)
49
+ def once(event, callback)
50
+ event_emitter_proxy.once(event, callback)
51
51
  end
52
52
 
53
53
  private def event_emitter_proxy
@@ -47,13 +47,13 @@ module Playwright
47
47
  end
48
48
 
49
49
  # @nodoc
50
- def context=(req)
51
- wrap_impl(@impl.context=(unwrap_impl(req)))
50
+ def page=(req)
51
+ wrap_impl(@impl.page=(unwrap_impl(req)))
52
52
  end
53
53
 
54
54
  # @nodoc
55
- def page=(req)
56
- wrap_impl(@impl.page=(unwrap_impl(req)))
55
+ def context=(req)
56
+ wrap_impl(@impl.context=(unwrap_impl(req)))
57
57
  end
58
58
 
59
59
  # -- inherited from EventEmitter --
@@ -64,14 +64,14 @@ module Playwright
64
64
 
65
65
  # -- inherited from EventEmitter --
66
66
  # @nodoc
67
- def once(event, callback)
68
- event_emitter_proxy.once(event, callback)
67
+ def on(event, callback)
68
+ event_emitter_proxy.on(event, callback)
69
69
  end
70
70
 
71
71
  # -- inherited from EventEmitter --
72
72
  # @nodoc
73
- def on(event, callback)
74
- event_emitter_proxy.on(event, callback)
73
+ def once(event, callback)
74
+ event_emitter_proxy.once(event, callback)
75
75
  end
76
76
 
77
77
  private def event_emitter_proxy
data/sig/playwright.rbs CHANGED
@@ -572,6 +572,7 @@ module Playwright
572
572
  def not_to_be_visible: (?timeout: Float, ?visible: bool) -> void
573
573
  def not_to_contain_text: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?ignoreCase: bool, ?timeout: Float, ?useInnerText: bool) -> void
574
574
  def not_to_have_accessible_description: ((String | Regexp) name, ?ignoreCase: bool, ?timeout: Float) -> void
575
+ def not_to_have_accessible_error_message: ((String | Regexp) errorMessage, ?ignoreCase: bool, ?timeout: Float) -> void
575
576
  def not_to_have_accessible_name: ((String | Regexp) name, ?ignoreCase: bool, ?timeout: Float) -> void
576
577
  def not_to_have_attribute: (String name, (String | Regexp) value, ?ignoreCase: bool, ?timeout: Float) -> void
577
578
  def not_to_have_class: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?timeout: Float) -> void
@@ -583,8 +584,9 @@ module Playwright
583
584
  def not_to_have_text: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?ignoreCase: bool, ?timeout: Float, ?useInnerText: bool) -> void
584
585
  def not_to_have_value: ((String | Regexp) value, ?timeout: Float) -> void
585
586
  def not_to_have_values: ((Array[untyped] | Array[untyped] | Array[untyped]) values, ?timeout: Float) -> void
587
+ def not_to_match_aria_snapshot: (String expected, ?timeout: Float) -> void
586
588
  def to_be_attached: (?attached: bool, ?timeout: Float) -> void
587
- def to_be_checked: (?checked: bool, ?timeout: Float) -> void
589
+ def to_be_checked: (?checked: bool, ?indeterminate: bool, ?timeout: Float) -> void
588
590
  def to_be_disabled: (?timeout: Float) -> void
589
591
  def to_be_editable: (?editable: bool, ?timeout: Float) -> void
590
592
  def to_be_empty: (?timeout: Float) -> void
@@ -595,6 +597,7 @@ module Playwright
595
597
  def to_be_visible: (?timeout: Float, ?visible: bool) -> void
596
598
  def to_contain_text: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?ignoreCase: bool, ?timeout: Float, ?useInnerText: bool) -> void
597
599
  def to_have_accessible_description: ((String | Regexp) description, ?ignoreCase: bool, ?timeout: Float) -> void
600
+ def to_have_accessible_error_message: ((String | Regexp) errorMessage, ?ignoreCase: bool, ?timeout: Float) -> void
598
601
  def to_have_accessible_name: ((String | Regexp) name, ?ignoreCase: bool, ?timeout: Float) -> void
599
602
  def to_have_attribute: (String name, (String | Regexp) value, ?ignoreCase: bool, ?timeout: Float) -> void
600
603
  def to_have_class: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?timeout: Float) -> void
@@ -623,7 +626,7 @@ module Playwright
623
626
  class AndroidDevice
624
627
  def close: -> void
625
628
  def info: (untyped selector) -> untyped
626
- def launch_browser: (?acceptDownloads: bool, ?args: Array[untyped], ?baseURL: String, ?bypassCSP: bool, ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?command: String, ?deviceScaleFactor: Float, ?extraHTTPHeaders: Hash[untyped, untyped], ?forcedColors: ("active" | "none" | "null"), ?geolocation: Hash[untyped, untyped], ?hasTouch: bool, ?httpCredentials: Hash[untyped, 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"), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (untyped) -> untyped } -> BrowserContext
629
+ def launch_browser: (?acceptDownloads: bool, ?args: Array[untyped], ?baseURL: String, ?bypassCSP: bool, ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?deviceScaleFactor: Float, ?extraHTTPHeaders: Hash[untyped, untyped], ?forcedColors: ("active" | "none" | "null"), ?geolocation: Hash[untyped, untyped], ?hasTouch: bool, ?httpCredentials: Hash[untyped, untyped], ?ignoreHTTPSErrors: bool, ?isMobile: bool, ?javaScriptEnabled: bool, ?locale: String, ?noViewport: bool, ?offline: bool, ?permissions: Array[untyped], ?pkg: String, ?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"), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (untyped) -> untyped } -> BrowserContext
627
630
  def model: -> String
628
631
  def screenshot: (?path: (String | File)) -> String
629
632
  def serial: -> String
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.49.0
4
+ version: 1.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-03 00:00:00.000000000 Z
10
+ date: 2025-02-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: concurrent-ruby
@@ -192,7 +191,6 @@ dependencies:
192
191
  - - ">="
193
192
  - !ruby/object:Gem::Version
194
193
  version: '0'
195
- description:
196
194
  email:
197
195
  - q7w8e9w8q7w8e9@yahoo.co.jp
198
196
  executables: []
@@ -395,7 +393,6 @@ homepage: https://github.com/YusukeIwaki/playwright-ruby-client
395
393
  licenses:
396
394
  - MIT
397
395
  metadata: {}
398
- post_install_message:
399
396
  rdoc_options: []
400
397
  require_paths:
401
398
  - lib
@@ -410,8 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
407
  - !ruby/object:Gem::Version
411
408
  version: '0'
412
409
  requirements: []
413
- rubygems_version: 3.3.27
414
- signing_key:
410
+ rubygems_version: 3.6.2
415
411
  specification_version: 4
416
- summary: The Ruby binding of playwright driver 1.49.0
412
+ summary: The Ruby binding of playwright driver 1.50.1
417
413
  test_files: []