playwright-ruby-client 1.50.1 → 1.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/browser.md +2 -0
  3. data/documentation/docs/api/browser_context.md +2 -2
  4. data/documentation/docs/api/browser_type.md +1 -0
  5. data/documentation/docs/api/experimental/android_device.md +1 -0
  6. data/documentation/docs/api/locator.md +11 -11
  7. data/documentation/docs/api/locator_assertions.md +53 -4
  8. data/documentation/docs/api/page.md +6 -1
  9. data/documentation/docs/api/route.md +2 -0
  10. data/documentation/docs/api/touchscreen.md +2 -0
  11. data/documentation/docs/api/web_socket.md +3 -1
  12. data/documentation/docs/include/api_coverage.md +2 -0
  13. data/lib/playwright/channel_owners/browser_context.rb +2 -2
  14. data/lib/playwright/channel_owners/page.rb +2 -1
  15. data/lib/playwright/javascript/value_parser.rb +54 -2
  16. data/lib/playwright/locator_assertions_impl.rb +34 -1
  17. data/lib/playwright/locator_impl.rb +11 -4
  18. data/lib/playwright/utils.rb +1 -1
  19. data/lib/playwright/version.rb +2 -2
  20. data/lib/playwright_api/android_device.rb +2 -1
  21. data/lib/playwright_api/api_request.rb +2 -0
  22. data/lib/playwright_api/api_request_context.rb +1 -1
  23. data/lib/playwright_api/browser.rb +4 -2
  24. data/lib/playwright_api/browser_context.rb +13 -13
  25. data/lib/playwright_api/browser_type.rb +8 -2
  26. data/lib/playwright_api/locator.rb +13 -13
  27. data/lib/playwright_api/locator_assertions.rb +46 -2
  28. data/lib/playwright_api/page.rb +17 -12
  29. data/lib/playwright_api/request.rb +4 -4
  30. data/lib/playwright_api/route.rb +2 -0
  31. data/lib/playwright_api/touchscreen.rb +2 -0
  32. data/lib/playwright_api/web_socket.rb +3 -1
  33. data/sig/playwright.rbs +10 -8
  34. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1987004c514d458f26c9d9860c2571b749cc92479586e2fd2cdc06758a35af5c
4
- data.tar.gz: 6d74956b9f6a425ec5c5220e4e22c4ec1ead12d15147d25d4f1f1a55886df546
3
+ metadata.gz: 6bcda43c43e75e840a897607afdc89d2b01cd463b937944ad33522d7a36713a1
4
+ data.tar.gz: f92d747e11ef4c55cc9769bc053194a18c2183d13862fe1c7bbb641a6ab6cbfd
5
5
  SHA512:
6
- metadata.gz: 16dc2df9e5b70a8850f5e9eb651e2e0e832d1131e403bd9912811675c407f943f50c97f15872a3c6ef141fae0ec95c61dce7a1168222b38c80cd5176b7438a41
7
- data.tar.gz: 40d560d9faf16aec2a91f514a61ef8b229c7895da320bacd1fccddad27f4465471a57269fb9d084a31ea1827463da112fadf43151c6afc03f0564e8e98b2d0b9
6
+ metadata.gz: 246d118dcb834c6d6a266286c1b2758d57e1480f8c40ffec06e2d08401f1e0b87934a8d1701c400053a5a226a81c22a2a4994ce3615a21e46d8ec689cd1289a2
7
+ data.tar.gz: 1537e5f55e68ff8c11c5d23a1dd1cb973e6aa3df9f8d528e6e93ecc4c744b663a75b8e0cafd38650b39d50d33cd930c3b1c87ebd889ef0cdb7a1481a7ee1c0c2
@@ -92,6 +92,7 @@ def new_context(
92
92
  bypassCSP: nil,
93
93
  clientCertificates: nil,
94
94
  colorScheme: nil,
95
+ contrast: nil,
95
96
  deviceScaleFactor: nil,
96
97
  extraHTTPHeaders: nil,
97
98
  forcedColors: nil,
@@ -152,6 +153,7 @@ def new_page(
152
153
  bypassCSP: nil,
153
154
  clientCertificates: nil,
154
155
  colorScheme: nil,
156
+ contrast: nil,
155
157
  deviceScaleFactor: nil,
156
158
  extraHTTPHeaders: nil,
157
159
  forcedColors: nil,
@@ -421,11 +421,11 @@ alias: `offline=`
421
421
  ## storage_state
422
422
 
423
423
  ```
424
- def storage_state(path: nil)
424
+ def storage_state(indexedDB: nil, path: nil)
425
425
  ```
426
426
 
427
427
 
428
- Returns storage state for this browser context, contains current cookies and local storage snapshot.
428
+ Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
429
429
 
430
430
  ## unroute_all
431
431
 
@@ -124,6 +124,7 @@ def launch_persistent_context(
124
124
  chromiumSandbox: nil,
125
125
  clientCertificates: nil,
126
126
  colorScheme: nil,
127
+ contrast: nil,
127
128
  deviceScaleFactor: nil,
128
129
  devtools: nil,
129
130
  downloadsPath: nil,
@@ -34,6 +34,7 @@ def launch_browser(
34
34
  baseURL: nil,
35
35
  bypassCSP: nil,
36
36
  colorScheme: nil,
37
+ contrast: nil,
37
38
  deviceScaleFactor: nil,
38
39
  extraHTTPHeaders: nil,
39
40
  forcedColors: nil,
@@ -87,7 +87,7 @@ button = page.get_by_role("button").and(page.get_by_title("Subscribe"))
87
87
  ## aria_snapshot
88
88
 
89
89
  ```
90
- def aria_snapshot(timeout: nil)
90
+ def aria_snapshot(ref: nil, timeout: nil)
91
91
  ```
92
92
 
93
93
 
@@ -458,11 +458,6 @@ If `expression` throws or rejects, this method throws.
458
458
 
459
459
  **Usage**
460
460
 
461
- ```ruby
462
- tweet = page.query_selector(".tweet .retweets")
463
- tweet.evaluate("node => node.innerText") # => "10 retweets"
464
- ```
465
-
466
461
  ## evaluate_all
467
462
 
468
463
  ```
@@ -534,7 +529,12 @@ To send fine-grained keyboard events, use [Locator#press_sequentially](./locator
534
529
  ## filter
535
530
 
536
531
  ```
537
- def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
532
+ def filter(
533
+ has: nil,
534
+ hasNot: nil,
535
+ hasNotText: nil,
536
+ hasText: nil,
537
+ visible: nil)
538
538
  ```
539
539
 
540
540
 
@@ -1238,9 +1238,9 @@ Triggers a `change` and `input` event once all the provided options have been se
1238
1238
 
1239
1239
  ```html
1240
1240
  <select multiple>
1241
- <option value="red">Red</div>
1242
- <option value="green">Green</div>
1243
- <option value="blue">Blue</div>
1241
+ <option value="red">Red</option>
1242
+ <option value="green">Green</option>
1243
+ <option value="blue">Blue</option>
1244
1244
  </select>
1245
1245
  ```
1246
1246
 
@@ -1349,7 +1349,7 @@ def tap_point(
1349
1349
  ```
1350
1350
 
1351
1351
 
1352
- Perform a tap gesture on the element matching the locator.
1352
+ Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](https://playwright.dev/python/docs/touch-events) page.
1353
1353
 
1354
1354
  **Details**
1355
1355
 
@@ -116,6 +116,15 @@ expect(locator).not_to be_visible(timeout: nil, visible: nil)
116
116
 
117
117
  The opposite of [LocatorAssertions#to_be_visible](./locator_assertions#to_be_visible).
118
118
 
119
+ ## not_to_contain_class
120
+
121
+ ```ruby
122
+ expect(locator).not_to contain_class(expected, timeout: nil)
123
+ ```
124
+
125
+
126
+ The opposite of [LocatorAssertions#to_contain_class](./locator_assertions#to_contain_class).
127
+
119
128
  ## not_to_contain_text
120
129
 
121
130
  ```ruby
@@ -436,6 +445,43 @@ expect(
436
445
  ).to be_visible
437
446
  ```
438
447
 
448
+ ## to_contain_class
449
+
450
+ ```ruby
451
+ expect(locator).to contain_class(expected, timeout: nil)
452
+ ```
453
+
454
+
455
+ Ensures the [Locator](./locator) points to an element with given CSS classes. All classes from the asserted value, separated by spaces, must be present in the [Element.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList) in any order.
456
+
457
+ **Usage**
458
+
459
+ ```html
460
+ <div class='middle selected row' id='component'></div>
461
+ ```
462
+
463
+ ```ruby
464
+ locator = page.locator("#component")
465
+ expect(locator).to contain_class("middle selected row")
466
+ expect(locator).to contain_class("selected")
467
+ expect(locator).to contain_class("row middle")
468
+ ```
469
+
470
+ When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class lists. Each element's class attribute is matched against the corresponding class in the array:
471
+
472
+ ```html
473
+ <div class='list'></div>
474
+ <div class='component inactive'></div>
475
+ <div class='component active'></div>
476
+ <div class='component inactive'></div>
477
+ </div>
478
+ ```
479
+
480
+ ```ruby
481
+ locator = page.locator(".list > .component")
482
+ expect(locator).to contain_class(["inactive", "active", "inactive"])
483
+ ```
484
+
439
485
  ## to_contain_text
440
486
 
441
487
  ```ruby
@@ -561,7 +607,7 @@ expect(locator).to have_class(expected, timeout: nil)
561
607
  ```
562
608
 
563
609
 
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:
610
+ 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 use [LocatorAssertions#to_contain_class](./locator_assertions#to_contain_class).
565
611
 
566
612
  **Usage**
567
613
 
@@ -569,10 +615,13 @@ Ensures the [Locator](./locator) points to an element with given CSS classes. Wh
569
615
  <div class='middle selected row' id='component'></div>
570
616
  ```
571
617
 
572
- ```ruby
618
+ ```python title="example_a596f37c41d76277b59ed7eb46969c178c89770d0da91bdff20f36d438aa32cd.py"
619
+ from playwright.sync_api import expect
620
+
573
621
  locator = page.locator("#component")
574
- expect(locator).to have_class(/(^|\s)selected(\s|$)/)
575
- expect(locator).to have_class("middle selected row")
622
+ expect(locator).to_have_class("middle selected row")
623
+ expect(locator).to_have_class(re.compile(r"(^|\\s)selected(\\s|$)"))
624
+
576
625
  ```
577
626
 
578
627
  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:
@@ -293,7 +293,12 @@ page.drag_and_drop(
293
293
  ## emulate_media
294
294
 
295
295
  ```
296
- def emulate_media(colorScheme: nil, forcedColors: nil, media: nil, reducedMotion: nil)
296
+ def emulate_media(
297
+ colorScheme: nil,
298
+ contrast: nil,
299
+ forcedColors: nil,
300
+ media: nil,
301
+ reducedMotion: nil)
297
302
  ```
298
303
 
299
304
 
@@ -49,6 +49,8 @@ The `headers` option applies to both the routed request and any redirects it ini
49
49
 
50
50
  [Route#continue](./route#continue) will immediately send the request to the network, other matching handlers won't be invoked. Use [Route#fallback](./route#fallback) If you want next matching handler in the chain to be invoked.
51
51
 
52
+ **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 [BrowserContext#add_cookies](./browser_context#add_cookies).
53
+
52
54
  ## fallback
53
55
 
54
56
  ```
@@ -8,6 +8,8 @@ sidebar_position: 10
8
8
  The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the
9
9
  touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
10
10
 
11
+ This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](https://playwright.dev/python/docs/touch-events) page.
12
+
11
13
  ## tap_point
12
14
 
13
15
  ```
@@ -5,7 +5,9 @@ sidebar_position: 10
5
5
  # WebSocket
6
6
 
7
7
 
8
- The [WebSocket](./web_socket) class represents websocket connections in the page.
8
+ The [WebSocket](./web_socket) class represents WebSocket connections within a page. It provides the ability to inspect and manipulate the data being transmitted and received.
9
+
10
+ If you want to intercept or modify WebSocket frames, consider using `WebSocketRoute`.
9
11
 
10
12
  ## closed?
11
13
 
@@ -563,6 +563,7 @@
563
563
  * not_to_be_hidden
564
564
  * not_to_be_in_viewport
565
565
  * not_to_be_visible
566
+ * not_to_contain_class
566
567
  * not_to_contain_text
567
568
  * not_to_have_accessible_description
568
569
  * not_to_have_accessible_error_message
@@ -588,6 +589,7 @@
588
589
  * to_be_hidden
589
590
  * to_be_in_viewport
590
591
  * to_be_visible
592
+ * to_contain_class
591
593
  * to_contain_text
592
594
  * to_have_accessible_description
593
595
  * to_have_accessible_error_message
@@ -496,8 +496,8 @@ module Playwright
496
496
  @channel.send_message_to_server('pause')
497
497
  end
498
498
 
499
- def storage_state(path: nil)
500
- @channel.send_message_to_server_result('storageState', {}).tap do |result|
499
+ def storage_state(path: nil, indexedDB: nil)
500
+ @channel.send_message_to_server_result('storageState', { indexedDB: indexedDB }.compact).tap do |result|
501
501
  if path
502
502
  File.open(path, 'w') do |f|
503
503
  f.write(JSON.dump(result))
@@ -366,9 +366,10 @@ module Playwright
366
366
  ChannelOwners::Response.from_nullable(resp)
367
367
  end
368
368
 
369
- def emulate_media(colorScheme: nil, forcedColors: nil, media: nil, reducedMotion: nil)
369
+ def emulate_media(colorScheme: nil, contrast: nil, forcedColors: nil, media: nil, reducedMotion: nil)
370
370
  params = {
371
371
  colorScheme: no_override_if_null(colorScheme),
372
+ contrast: no_override_if_null(contrast),
372
373
  forcedColors: no_override_if_null(forcedColors),
373
374
  media: no_override_if_null(media),
374
375
  reducedMotion: no_override_if_null(reducedMotion),
@@ -1,4 +1,5 @@
1
- require 'date'
1
+ require 'base64'
2
+ require 'time'
2
3
 
3
4
  module Playwright
4
5
  module JavaScript
@@ -45,7 +46,7 @@ module Playwright
45
46
  end
46
47
 
47
48
  if hash.key?('d')
48
- return DateTime.parse(hash['d'])
49
+ return Time.parse(hash['d'])
49
50
  end
50
51
 
51
52
  if hash.key?('u')
@@ -105,6 +106,57 @@ module Playwright
105
106
  return @handles[hash['h']]
106
107
  end
107
108
 
109
+ if hash.key?('ta')
110
+ encoded_bytes = hash['ta']['b']
111
+ decoded_bytes = Base64.strict_decode64(encoded_bytes)
112
+ array_type = hash['ta']['k']
113
+
114
+ if array_type == 'i8'
115
+ word_size = 1
116
+ unpack_format = 'c*' # signed char
117
+ elsif array_type == 'ui8' || array_type == 'ui8c'
118
+ word_size = 1
119
+ unpack_format = 'C*' # unsigned char
120
+ elsif array_type == 'i16'
121
+ word_size = 2
122
+ unpack_format = 's<*' # signed short, little-endian
123
+ elsif array_type == 'ui16'
124
+ word_size = 2
125
+ unpack_format = 'S<*' # unsigned short, little-endian
126
+ elsif array_type == 'i32'
127
+ word_size = 4
128
+ unpack_format = 'l<*' # signed long, little-endian
129
+ elsif array_type == 'ui32'
130
+ word_size = 4
131
+ unpack_format = 'L<*' # unsigned long, little-endian
132
+ elsif array_type == 'f32'
133
+ word_size = 4
134
+ unpack_format = 'e*' # float, little-endian
135
+ elsif array_type == 'f64'
136
+ word_size = 8
137
+ unpack_format = 'E*' # double, little-endian
138
+ elsif array_type == 'bi64'
139
+ word_size = 8
140
+ unpack_format = 'q<*' # signed long long, little-endian
141
+ elsif array_type == 'bui64'
142
+ word_size = 8
143
+ unpack_format = 'Q<*' # unsigned long long, little-endian
144
+ else
145
+ raise ArgumentError, "Unsupported array type: #{array_type}"
146
+ end
147
+
148
+ byte_len = decoded_bytes.bytesize
149
+ if byte_len.zero?
150
+ return []
151
+ end
152
+
153
+ if byte_len % word_size != 0
154
+ raise ArgumentError, "Decoded bytes length #{byte_len} is not a multiple of word size #{word_size} for type #{array_type}"
155
+ end
156
+
157
+ return decoded_bytes.unpack(unpack_format)
158
+ end
159
+
108
160
  raise ArgumentError.new("Unexpected value: #{hash}")
109
161
  end
110
162
  end
@@ -232,6 +232,39 @@ module Playwright
232
232
  end
233
233
  _define_negation :to_have_class
234
234
 
235
+ def to_contain_class(expected, timeout: nil)
236
+ if expected.is_a?(Enumerable)
237
+ if expected.any? { |e| e.is_a?(Regexp) }
238
+ raise ArgumentError.new('"expected" argument in toContainClass cannot contain RegExp values')
239
+ end
240
+ expected_text = to_expected_text_values(expected)
241
+ expect_impl(
242
+ "to.contain.class.array",
243
+ {
244
+ expectedText: expected_text,
245
+ timeout: timeout,
246
+ },
247
+ expected,
248
+ "Locator expected to contain class names"
249
+ )
250
+ else # Single string
251
+ if expected.is_a?(Regexp)
252
+ raise ArgumentError.new('"expected" argument in toContainClass cannot be a RegExp value')
253
+ end
254
+ expected_text = to_expected_text_values([expected])
255
+ expect_impl(
256
+ "to.contain.class",
257
+ {
258
+ expectedText: expected_text,
259
+ timeout: timeout,
260
+ },
261
+ expected,
262
+ "Locator expected to contain class"
263
+ )
264
+ end
265
+ end
266
+ _define_negation :to_contain_class
267
+
235
268
  def to_have_count(count, timeout: nil)
236
269
  expect_impl(
237
270
  "to.have.count",
@@ -494,7 +527,7 @@ module Playwright
494
527
  def to_be_in_viewport(ratio: nil, timeout: nil)
495
528
  expect_impl(
496
529
  "to.be.in.viewport",
497
- { timeout: timeout, expectedNumber: ratio },
530
+ { timeout: timeout, expectedNumber: ratio }.compact,
498
531
  nil,
499
532
  "Locator expected to be in viewport"
500
533
  )
@@ -5,7 +5,7 @@ module Playwright
5
5
  define_api_implementation :LocatorImpl do
6
6
  include LocatorUtils
7
7
 
8
- def initialize(frame:, timeout_settings:, selector:, has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
8
+ def initialize(frame:, timeout_settings:, selector:, has: nil, hasNot: nil, hasNotText: nil, hasText: nil, visible: nil)
9
9
  @frame = frame
10
10
  @timeout_settings = timeout_settings
11
11
  selector_scopes = [selector]
@@ -32,6 +32,10 @@ module Playwright
32
32
  selector_scopes << "internal:has-not=#{hasNot.send(:selector_json)}"
33
33
  end
34
34
 
35
+ if [true, false].include?(visible)
36
+ selector_scopes << "visible=#{visible}"
37
+ end
38
+
35
39
  @selector = selector_scopes.join(' >> ')
36
40
  end
37
41
 
@@ -241,7 +245,7 @@ module Playwright
241
245
  )
242
246
  end
243
247
 
244
- def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
248
+ def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil, visible: nil)
245
249
  LocatorImpl.new(
246
250
  frame: @frame,
247
251
  timeout_settings: @timeout_settings,
@@ -249,7 +253,9 @@ module Playwright
249
253
  has: has,
250
254
  hasNot: hasNot,
251
255
  hasNotText: hasNotText,
252
- hasText: hasText)
256
+ hasText: hasText,
257
+ visible: visible,
258
+ )
253
259
  end
254
260
 
255
261
  def first
@@ -391,10 +397,11 @@ module Playwright
391
397
  end
392
398
  end
393
399
 
394
- def aria_snapshot(timeout: nil)
400
+ def aria_snapshot(timeout: nil, ref: nil)
395
401
  @frame.channel.send_message_to_server('ariaSnapshot', {
396
402
  selector: @selector,
397
403
  timeout: timeout,
404
+ ref: ref,
398
405
  }.compact)
399
406
  end
400
407
 
@@ -57,7 +57,7 @@ module Playwright
57
57
  params[:storageState] = JSON.parse(File.read(params[:storageState]))
58
58
  end
59
59
 
60
- %i[colorScheme reducedMotion forcedColors].each do |key|
60
+ %i[colorScheme reducedMotion forcedColors contrast].each do |key|
61
61
  if params[key] == 'null'
62
62
  params[key] = 'no-override'
63
63
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.50.1'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.50.1'
4
+ VERSION = '1.52.0'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.52.0'
6
6
  end
@@ -51,6 +51,7 @@ module Playwright
51
51
  baseURL: nil,
52
52
  bypassCSP: nil,
53
53
  colorScheme: nil,
54
+ contrast: nil,
54
55
  deviceScaleFactor: nil,
55
56
  extraHTTPHeaders: nil,
56
57
  forcedColors: nil,
@@ -81,7 +82,7 @@ module Playwright
81
82
  userAgent: nil,
82
83
  viewport: nil,
83
84
  &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
+ 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), contrast: unwrap_impl(contrast), 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
86
  end
86
87
 
87
88
  #
@@ -12,8 +12,10 @@ module Playwright
12
12
  baseURL: nil,
13
13
  clientCertificates: nil,
14
14
  extraHTTPHeaders: nil,
15
+ failOnStatusCode: nil,
15
16
  httpCredentials: nil,
16
17
  ignoreHTTPSErrors: nil,
18
+ maxRedirects: nil,
17
19
  proxy: nil,
18
20
  storageState: nil,
19
21
  timeout: nil,
@@ -282,7 +282,7 @@ module Playwright
282
282
 
283
283
  #
284
284
  # Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to the constructor.
285
- def storage_state(path: nil)
285
+ def storage_state(indexedDB: nil, path: nil)
286
286
  raise NotImplementedError.new('storage_state is not implemented yet.')
287
287
  end
288
288
 
@@ -92,6 +92,7 @@ module Playwright
92
92
  bypassCSP: nil,
93
93
  clientCertificates: nil,
94
94
  colorScheme: nil,
95
+ contrast: nil,
95
96
  deviceScaleFactor: nil,
96
97
  extraHTTPHeaders: nil,
97
98
  forcedColors: nil,
@@ -122,7 +123,7 @@ module Playwright
122
123
  userAgent: nil,
123
124
  viewport: nil,
124
125
  &block)
125
- wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), clientCertificates: unwrap_impl(clientCertificates), 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), 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), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
126
+ wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), clientCertificates: unwrap_impl(clientCertificates), colorScheme: unwrap_impl(colorScheme), contrast: unwrap_impl(contrast), 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), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
126
127
  end
127
128
 
128
129
  #
@@ -137,6 +138,7 @@ module Playwright
137
138
  bypassCSP: nil,
138
139
  clientCertificates: nil,
139
140
  colorScheme: nil,
141
+ contrast: nil,
140
142
  deviceScaleFactor: nil,
141
143
  extraHTTPHeaders: nil,
142
144
  forcedColors: nil,
@@ -167,7 +169,7 @@ module Playwright
167
169
  userAgent: nil,
168
170
  viewport: nil,
169
171
  &block)
170
- wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), clientCertificates: unwrap_impl(clientCertificates), 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), 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), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
172
+ wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), clientCertificates: unwrap_impl(clientCertificates), colorScheme: unwrap_impl(colorScheme), contrast: unwrap_impl(contrast), 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), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
171
173
  end
172
174
 
173
175
  #
@@ -404,9 +404,9 @@ module Playwright
404
404
  alias_method :offline=, :set_offline
405
405
 
406
406
  #
407
- # Returns storage state for this browser context, contains current cookies and local storage snapshot.
408
- def storage_state(path: nil)
409
- wrap_impl(@impl.storage_state(path: unwrap_impl(path)))
407
+ # Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
408
+ def storage_state(indexedDB: nil, path: nil)
409
+ wrap_impl(@impl.storage_state(indexedDB: unwrap_impl(indexedDB), path: unwrap_impl(path)))
410
410
  end
411
411
 
412
412
  #
@@ -463,16 +463,6 @@ module Playwright
463
463
  raise NotImplementedError.new('wait_for_event is not implemented yet.')
464
464
  end
465
465
 
466
- # @nodoc
467
- def owner_page=(req)
468
- wrap_impl(@impl.owner_page=(unwrap_impl(req)))
469
- end
470
-
471
- # @nodoc
472
- def options=(req)
473
- wrap_impl(@impl.options=(unwrap_impl(req)))
474
- end
475
-
476
466
  # @nodoc
477
467
  def enable_debug_console!
478
468
  wrap_impl(@impl.enable_debug_console!)
@@ -488,6 +478,16 @@ module Playwright
488
478
  wrap_impl(@impl.browser=(unwrap_impl(req)))
489
479
  end
490
480
 
481
+ # @nodoc
482
+ def options=(req)
483
+ wrap_impl(@impl.options=(unwrap_impl(req)))
484
+ end
485
+
486
+ # @nodoc
487
+ def owner_page=(req)
488
+ wrap_impl(@impl.owner_page=(unwrap_impl(req)))
489
+ end
490
+
491
491
  # -- inherited from EventEmitter --
492
492
  # @nodoc
493
493
  def on(event, callback)
@@ -23,7 +23,12 @@ module Playwright
23
23
  # This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
24
24
  #
25
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
26
+ def connect(
27
+ wsEndpoint,
28
+ exposeNetwork: nil,
29
+ headers: nil,
30
+ slowMo: nil,
31
+ timeout: nil)
27
32
  raise NotImplementedError.new('connect is not implemented yet.')
28
33
  end
29
34
 
@@ -123,6 +128,7 @@ module Playwright
123
128
  chromiumSandbox: nil,
124
129
  clientCertificates: nil,
125
130
  colorScheme: nil,
131
+ contrast: nil,
126
132
  deviceScaleFactor: nil,
127
133
  devtools: nil,
128
134
  downloadsPath: nil,
@@ -165,7 +171,7 @@ module Playwright
165
171
  userAgent: nil,
166
172
  viewport: nil,
167
173
  &block)
168
- wrap_impl(@impl.launch_persistent_context(unwrap_impl(userDataDir), acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), channel: unwrap_impl(channel), chromiumSandbox: unwrap_impl(chromiumSandbox), clientCertificates: unwrap_impl(clientCertificates), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), firefoxUserPrefs: unwrap_impl(firefoxUserPrefs), forcedColors: unwrap_impl(forcedColors), geolocation: unwrap_impl(geolocation), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), hasTouch: unwrap_impl(hasTouch), headless: unwrap_impl(headless), httpCredentials: unwrap_impl(httpCredentials), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), 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), slowMo: unwrap_impl(slowMo), strictSelectors: unwrap_impl(strictSelectors), timeout: unwrap_impl(timeout), timezoneId: unwrap_impl(timezoneId), tracesDir: unwrap_impl(tracesDir), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
174
+ wrap_impl(@impl.launch_persistent_context(unwrap_impl(userDataDir), acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), channel: unwrap_impl(channel), chromiumSandbox: unwrap_impl(chromiumSandbox), clientCertificates: unwrap_impl(clientCertificates), colorScheme: unwrap_impl(colorScheme), contrast: unwrap_impl(contrast), deviceScaleFactor: unwrap_impl(deviceScaleFactor), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), firefoxUserPrefs: unwrap_impl(firefoxUserPrefs), forcedColors: unwrap_impl(forcedColors), geolocation: unwrap_impl(geolocation), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), hasTouch: unwrap_impl(hasTouch), headless: unwrap_impl(headless), httpCredentials: unwrap_impl(httpCredentials), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), 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), slowMo: unwrap_impl(slowMo), strictSelectors: unwrap_impl(strictSelectors), timeout: unwrap_impl(timeout), timezoneId: unwrap_impl(timezoneId), tracesDir: unwrap_impl(tracesDir), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
169
175
  end
170
176
 
171
177
  #
@@ -103,8 +103,8 @@ module Playwright
103
103
  # - listitem:
104
104
  # - link "About"
105
105
  # ```
106
- def aria_snapshot(timeout: nil)
107
- wrap_impl(@impl.aria_snapshot(timeout: unwrap_impl(timeout)))
106
+ def aria_snapshot(ref: nil, timeout: nil)
107
+ wrap_impl(@impl.aria_snapshot(ref: unwrap_impl(ref), timeout: unwrap_impl(timeout)))
108
108
  end
109
109
 
110
110
  #
@@ -393,11 +393,6 @@ module Playwright
393
393
  # If `expression` throws or rejects, this method throws.
394
394
  #
395
395
  # **Usage**
396
- #
397
- # ```python sync
398
- # tweets = page.locator(".tweet .retweets")
399
- # assert tweets.evaluate("node => node.innerText") == "10 retweets"
400
- # ```
401
396
  def evaluate(expression, arg: nil, timeout: nil)
402
397
  wrap_impl(@impl.evaluate(unwrap_impl(expression), arg: unwrap_impl(arg), timeout: unwrap_impl(timeout)))
403
398
  end
@@ -474,8 +469,13 @@ module Playwright
474
469
  # has=page.get_by_role("button", name="column 2 button")
475
470
  # ).screenshot()
476
471
  # ```
477
- def filter(has: nil, hasNot: nil, hasNotText: nil, hasText: nil)
478
- wrap_impl(@impl.filter(has: unwrap_impl(has), hasNot: unwrap_impl(hasNot), hasNotText: unwrap_impl(hasNotText), hasText: unwrap_impl(hasText)))
472
+ def filter(
473
+ has: nil,
474
+ hasNot: nil,
475
+ hasNotText: nil,
476
+ hasText: nil,
477
+ visible: nil)
478
+ wrap_impl(@impl.filter(has: unwrap_impl(has), hasNot: unwrap_impl(hasNot), hasNotText: unwrap_impl(hasNotText), hasText: unwrap_impl(hasText), visible: unwrap_impl(visible)))
479
479
  end
480
480
 
481
481
  #
@@ -1047,9 +1047,9 @@ module Playwright
1047
1047
  #
1048
1048
  # ```html
1049
1049
  # <select multiple>
1050
- # <option value="red">Red</div>
1051
- # <option value="green">Green</div>
1052
- # <option value="blue">Blue</div>
1050
+ # <option value="red">Red</option>
1051
+ # <option value="green">Green</option>
1052
+ # <option value="blue">Blue</option>
1053
1053
  # </select>
1054
1054
  # ```
1055
1055
  #
@@ -1153,7 +1153,7 @@ module Playwright
1153
1153
  alias_method :input_files=, :set_input_files
1154
1154
 
1155
1155
  #
1156
- # Perform a tap gesture on the element matching the locator.
1156
+ # Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.md) page.
1157
1157
  #
1158
1158
  # **Details**
1159
1159
  #
@@ -72,6 +72,12 @@ module Playwright
72
72
  wrap_impl(@impl.not_to_be_visible(timeout: unwrap_impl(timeout), visible: unwrap_impl(visible)))
73
73
  end
74
74
 
75
+ #
76
+ # The opposite of [`method: LocatorAssertions.toContainClass`].
77
+ def not_to_contain_class(expected, timeout: nil)
78
+ wrap_impl(@impl.not_to_contain_class(unwrap_impl(expected), timeout: unwrap_impl(timeout)))
79
+ end
80
+
75
81
  #
76
82
  # The opposite of [`method: LocatorAssertions.toContainText`].
77
83
  def not_to_contain_text(expected, ignoreCase: nil, timeout: nil, useInnerText: nil)
@@ -328,6 +334,44 @@ module Playwright
328
334
  wrap_impl(@impl.to_be_visible(timeout: unwrap_impl(timeout), visible: unwrap_impl(visible)))
329
335
  end
330
336
 
337
+ #
338
+ # Ensures the `Locator` points to an element with given CSS classes. All classes from the asserted value, separated by spaces, must be present in the [Element.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList) in any order.
339
+ #
340
+ # **Usage**
341
+ #
342
+ # ```html
343
+ # <div class='middle selected row' id='component'></div>
344
+ # ```
345
+ #
346
+ # ```python sync
347
+ # from playwright.sync_api import expect
348
+ #
349
+ # locator = page.locator("#component")
350
+ # expect(locator).to_contain_class("middle selected row")
351
+ # expect(locator).to_contain_class("selected")
352
+ # expect(locator).to_contain_class("row middle")
353
+ # ```
354
+ #
355
+ # When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class lists. Each element's class attribute is matched against the corresponding class in the array:
356
+ #
357
+ # ```html
358
+ # <div class='list'></div>
359
+ # <div class='component inactive'></div>
360
+ # <div class='component active'></div>
361
+ # <div class='component inactive'></div>
362
+ # </div>
363
+ # ```
364
+ #
365
+ # ```python sync
366
+ # from playwright.sync_api import expect
367
+ #
368
+ # locator = page.locator("list > .component")
369
+ # await expect(locator).to_contain_class(["inactive", "active", "inactive"])
370
+ # ```
371
+ def to_contain_class(expected, timeout: nil)
372
+ wrap_impl(@impl.to_contain_class(unwrap_impl(expected), timeout: unwrap_impl(timeout)))
373
+ end
374
+
331
375
  #
332
376
  # Ensures the `Locator` points to an element that contains the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well.
333
377
  #
@@ -439,7 +483,7 @@ module Playwright
439
483
  end
440
484
 
441
485
  #
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:
486
+ # 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 use [`method: LocatorAssertions.toContainClass`].
443
487
  #
444
488
  # **Usage**
445
489
  #
@@ -451,8 +495,8 @@ module Playwright
451
495
  # from playwright.sync_api import expect
452
496
  #
453
497
  # locator = page.locator("#component")
454
- # expect(locator).to_have_class(re.compile(r"(^|\\s)selected(\\s|$)"))
455
498
  # expect(locator).to_have_class("middle selected row")
499
+ # expect(locator).to_have_class(re.compile(r"(^|\\s)selected(\\s|$)"))
456
500
  # ```
457
501
  #
458
502
  # 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:
@@ -316,8 +316,13 @@ module Playwright
316
316
  # page.evaluate("matchMedia('(prefers-color-scheme: light)').matches")
317
317
  # # → False
318
318
  # ```
319
- def emulate_media(colorScheme: nil, forcedColors: nil, media: nil, reducedMotion: nil)
320
- wrap_impl(@impl.emulate_media(colorScheme: unwrap_impl(colorScheme), forcedColors: unwrap_impl(forcedColors), media: unwrap_impl(media), reducedMotion: unwrap_impl(reducedMotion)))
319
+ def emulate_media(
320
+ colorScheme: nil,
321
+ contrast: nil,
322
+ forcedColors: nil,
323
+ media: nil,
324
+ reducedMotion: nil)
325
+ wrap_impl(@impl.emulate_media(colorScheme: unwrap_impl(colorScheme), contrast: unwrap_impl(contrast), forcedColors: unwrap_impl(forcedColors), media: unwrap_impl(media), reducedMotion: unwrap_impl(reducedMotion)))
321
326
  end
322
327
 
323
328
  #
@@ -1787,16 +1792,6 @@ module Playwright
1787
1792
  raise NotImplementedError.new('wait_for_event is not implemented yet.')
1788
1793
  end
1789
1794
 
1790
- # @nodoc
1791
- def owned_context=(req)
1792
- wrap_impl(@impl.owned_context=(unwrap_impl(req)))
1793
- end
1794
-
1795
- # @nodoc
1796
- def guid
1797
- wrap_impl(@impl.guid)
1798
- end
1799
-
1800
1795
  # @nodoc
1801
1796
  def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1802
1797
  wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
@@ -1817,6 +1812,16 @@ module Playwright
1817
1812
  wrap_impl(@impl.stop_css_coverage)
1818
1813
  end
1819
1814
 
1815
+ # @nodoc
1816
+ def owned_context=(req)
1817
+ wrap_impl(@impl.owned_context=(unwrap_impl(req)))
1818
+ end
1819
+
1820
+ # @nodoc
1821
+ def guid
1822
+ wrap_impl(@impl.guid)
1823
+ end
1824
+
1820
1825
  # -- inherited from EventEmitter --
1821
1826
  # @nodoc
1822
1827
  def on(event, callback)
@@ -196,13 +196,13 @@ module Playwright
196
196
  end
197
197
 
198
198
  # @nodoc
199
- def apply_fallback_overrides(overrides)
200
- wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
199
+ def header_values(name)
200
+ wrap_impl(@impl.header_values(unwrap_impl(name)))
201
201
  end
202
202
 
203
203
  # @nodoc
204
- def header_values(name)
205
- wrap_impl(@impl.header_values(unwrap_impl(name)))
204
+ def apply_fallback_overrides(overrides)
205
+ wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
206
206
  end
207
207
 
208
208
  # -- inherited from EventEmitter --
@@ -35,6 +35,8 @@ module Playwright
35
35
  # The `headers` option applies to both the routed request and any redirects it initiates. However, `url`, `method`, and `postData` only apply to the original request and are not carried over to redirected requests.
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
+ #
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`].
38
40
  def continue(headers: nil, method: nil, postData: nil, url: nil)
39
41
  wrap_impl(@impl.continue(headers: unwrap_impl(headers), method: unwrap_impl(method), postData: unwrap_impl(postData), url: unwrap_impl(url)))
40
42
  end
@@ -2,6 +2,8 @@ module Playwright
2
2
  #
3
3
  # The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the
4
4
  # touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
5
+ #
6
+ # This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.md) page.
5
7
  class Touchscreen < PlaywrightApi
6
8
 
7
9
  #
@@ -1,6 +1,8 @@
1
1
  module Playwright
2
2
  #
3
- # The `WebSocket` class represents websocket connections in the page.
3
+ # The `WebSocket` class represents WebSocket connections within a page. It provides the ability to inspect and manipulate the data being transmitted and received.
4
+ #
5
+ # If you want to intercept or modify WebSocket frames, consider using `WebSocketRoute`.
4
6
  class WebSocket < PlaywrightApi
5
7
 
6
8
  #
data/sig/playwright.rbs CHANGED
@@ -273,7 +273,7 @@ module Playwright
273
273
  def dblclick: (String selector, ?button: ("left" | "right" | "middle"), ?delay: Float, ?force: bool, ?modifiers: Array[untyped], ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?strict: bool, ?timeout: Float, ?trial: bool) -> void
274
274
  def dispatch_event: (String selector, String type_, ?eventInit: untyped, ?strict: bool, ?timeout: Float) -> void
275
275
  def drag_and_drop: (String source, String target, ?force: bool, ?noWaitAfter: bool, ?sourcePosition: Hash[untyped, untyped], ?strict: bool, ?targetPosition: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
276
- def emulate_media: (?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?forcedColors: ("active" | "none" | "null"), ?media: ("screen" | "print" | "null"), ?reducedMotion: ("reduce" | "no-preference" | "null")) -> void
276
+ def emulate_media: (?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "null"), ?forcedColors: ("active" | "none" | "null"), ?media: ("screen" | "print" | "null"), ?reducedMotion: ("reduce" | "no-preference" | "null")) -> void
277
277
  def eval_on_selector: (String selector, String expression, ?arg: untyped, ?strict: bool) -> untyped
278
278
  def eval_on_selector_all: (String selector, String expression, ?arg: untyped) -> untyped
279
279
  def evaluate: (String expression, ?arg: untyped) -> untyped
@@ -396,7 +396,7 @@ module Playwright
396
396
  def geolocation=: ((nil | Hash[untyped, untyped]) geolocation) -> void
397
397
  def set_offline: (bool offline) -> void
398
398
  def offline=: (bool offline) -> void
399
- def storage_state: (?path: (String | File)) -> Hash[untyped, untyped]
399
+ def storage_state: (?indexedDB: bool, ?path: (String | File)) -> Hash[untyped, untyped]
400
400
  def unroute_all: (?behavior: ("wait" | "ignoreErrors" | "default")) -> void
401
401
  def unroute: ((String | Regexp | function) url, ?handler: function) -> void
402
402
  def expect_console_message: (?predicate: function, ?timeout: Float) { () -> void } -> ConsoleMessage
@@ -419,8 +419,8 @@ module Playwright
419
419
  def contexts: -> Array[untyped]
420
420
  def connected?: -> bool
421
421
  def new_browser_cdp_session: -> CDPSession
422
- def new_context: (?acceptDownloads: bool, ?baseURL: String, ?bypassCSP: bool, ?clientCertificates: Array[untyped], ?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], ?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"), ?storageState: ((String | File) | Hash[untyped, untyped]), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (BrowserContext) -> untyped } -> BrowserContext
423
- def new_page: (?acceptDownloads: bool, ?baseURL: String, ?bypassCSP: bool, ?clientCertificates: Array[untyped], ?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], ?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"), ?storageState: ((String | File) | Hash[untyped, untyped]), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (Page) -> untyped } -> Page
422
+ def new_context: (?acceptDownloads: bool, ?baseURL: String, ?bypassCSP: bool, ?clientCertificates: Array[untyped], ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "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], ?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"), ?storageState: ((String | File) | Hash[untyped, untyped]), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (BrowserContext) -> untyped } -> BrowserContext
423
+ def new_page: (?acceptDownloads: bool, ?baseURL: String, ?bypassCSP: bool, ?clientCertificates: Array[untyped], ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "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], ?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"), ?storageState: ((String | File) | Hash[untyped, untyped]), ?strictSelectors: bool, ?timezoneId: String, ?userAgent: String, ?viewport: (nil | Hash[untyped, untyped])) ?{ (Page) -> untyped } -> Page
424
424
  def start_tracing: (?page: Page, ?categories: Array[untyped], ?path: (String | File), ?screenshots: bool) -> void
425
425
  def stop_tracing: -> String
426
426
  def version: -> String
@@ -430,7 +430,7 @@ module Playwright
430
430
  def connect_over_cdp: (String endpointURL, ?headers: Hash[untyped, untyped], ?slowMo: Float, ?timeout: Float) ?{ (untyped) -> untyped } -> Browser
431
431
  def executable_path: -> String
432
432
  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
433
- 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"), ?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
433
+ 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
434
434
  def name: -> String
435
435
  end
436
436
 
@@ -456,7 +456,7 @@ module Playwright
456
456
  def all_inner_texts: -> Array[untyped]
457
457
  def all_text_contents: -> Array[untyped]
458
458
  def and: (Locator locator) -> Locator
459
- def aria_snapshot: (?timeout: Float) -> String
459
+ def aria_snapshot: (?ref: bool, ?timeout: Float) -> String
460
460
  def blur: (?timeout: Float) -> void
461
461
  def bounding_box: (?timeout: Float) -> (nil | Hash[untyped, untyped])
462
462
  def check: (?force: bool, ?noWaitAfter: bool, ?position: Hash[untyped, untyped], ?timeout: Float, ?trial: bool) -> void
@@ -473,7 +473,7 @@ module Playwright
473
473
  def evaluate_all: (String expression, ?arg: untyped) -> untyped
474
474
  def evaluate_handle: (String expression, ?arg: untyped, ?timeout: Float) -> JSHandle
475
475
  def fill: (String value, ?force: bool, ?noWaitAfter: bool, ?timeout: Float) -> void
476
- def filter: (?has: Locator, ?hasNot: Locator, ?hasNotText: (String | Regexp), ?hasText: (String | Regexp)) -> Locator
476
+ def filter: (?has: Locator, ?hasNot: Locator, ?hasNotText: (String | Regexp), ?hasText: (String | Regexp), ?visible: bool) -> Locator
477
477
  def first: -> Locator
478
478
  def focus: (?timeout: Float) -> void
479
479
  def frame_locator: (String selector) -> FrameLocator
@@ -570,6 +570,7 @@ module Playwright
570
570
  def not_to_be_hidden: (?timeout: Float) -> void
571
571
  def not_to_be_in_viewport: (?ratio: Float, ?timeout: Float) -> void
572
572
  def not_to_be_visible: (?timeout: Float, ?visible: bool) -> void
573
+ def not_to_contain_class: ((String | Array[untyped]) expected, ?timeout: Float) -> void
573
574
  def not_to_contain_text: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?ignoreCase: bool, ?timeout: Float, ?useInnerText: bool) -> void
574
575
  def not_to_have_accessible_description: ((String | Regexp) name, ?ignoreCase: bool, ?timeout: Float) -> void
575
576
  def not_to_have_accessible_error_message: ((String | Regexp) errorMessage, ?ignoreCase: bool, ?timeout: Float) -> void
@@ -595,6 +596,7 @@ module Playwright
595
596
  def to_be_hidden: (?timeout: Float) -> void
596
597
  def to_be_in_viewport: (?ratio: Float, ?timeout: Float) -> void
597
598
  def to_be_visible: (?timeout: Float, ?visible: bool) -> void
599
+ def to_contain_class: ((String | Array[untyped]) expected, ?timeout: Float) -> void
598
600
  def to_contain_text: ((String | Regexp | Array[untyped] | Array[untyped] | Array[untyped]) expected, ?ignoreCase: bool, ?timeout: Float, ?useInnerText: bool) -> void
599
601
  def to_have_accessible_description: ((String | Regexp) description, ?ignoreCase: bool, ?timeout: Float) -> void
600
602
  def to_have_accessible_error_message: ((String | Regexp) errorMessage, ?ignoreCase: bool, ?timeout: Float) -> void
@@ -626,7 +628,7 @@ module Playwright
626
628
  class AndroidDevice
627
629
  def close: -> void
628
630
  def info: (untyped selector) -> untyped
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
631
+ def launch_browser: (?acceptDownloads: bool, ?args: Array[untyped], ?baseURL: String, ?bypassCSP: bool, ?colorScheme: ("light" | "dark" | "no-preference" | "null"), ?contrast: ("no-preference" | "more" | "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
630
632
  def model: -> String
631
633
  def screenshot: (?path: (String | File)) -> String
632
634
  def serial: -> String
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.50.1
4
+ version: 1.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: concurrent-ruby
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  - !ruby/object:Gem::Version
408
408
  version: '0'
409
409
  requirements: []
410
- rubygems_version: 3.6.2
410
+ rubygems_version: 3.6.7
411
411
  specification_version: 4
412
- summary: The Ruby binding of playwright driver 1.50.1
412
+ summary: The Ruby binding of playwright driver 1.52.0
413
413
  test_files: []