playwright-ruby-client 1.20.1 → 1.22.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/api_request_context.md +15 -2
  3. data/documentation/docs/api/browser_type.md +1 -1
  4. data/documentation/docs/api/console_message.md +27 -1
  5. data/documentation/docs/api/element_handle.md +23 -8
  6. data/documentation/docs/api/experimental/android.md +1 -1
  7. data/documentation/docs/api/file_chooser.md +1 -1
  8. data/documentation/docs/api/frame.md +12 -5
  9. data/documentation/docs/api/frame_locator.md +1 -1
  10. data/documentation/docs/api/locator.md +32 -8
  11. data/documentation/docs/api/page.md +18 -8
  12. data/documentation/docs/api/route.md +2 -0
  13. data/documentation/docs/include/api_coverage.md +1 -0
  14. data/documentation/package.json +6 -6
  15. data/documentation/yarn.lock +2931 -3220
  16. data/lib/playwright/channel_owners/android.rb +2 -1
  17. data/lib/playwright/channel_owners/android_device.rb +0 -4
  18. data/lib/playwright/channel_owners/browser_context.rb +10 -2
  19. data/lib/playwright/channel_owners/element_handle.rb +12 -3
  20. data/lib/playwright/channel_owners/frame.rb +4 -5
  21. data/lib/playwright/channel_owners/page.rb +12 -8
  22. data/lib/playwright/channel_owners/writable_stream.rb +14 -0
  23. data/lib/playwright/input_files.rb +60 -8
  24. data/lib/playwright/javascript/value_parser.rb +30 -17
  25. data/lib/playwright/javascript/value_serializer.rb +13 -2
  26. data/lib/playwright/javascript/visitor_info.rb +26 -0
  27. data/lib/playwright/locator_impl.rb +15 -0
  28. data/lib/playwright/playwright_api.rb +26 -6
  29. data/lib/playwright/transport.rb +12 -3
  30. data/lib/playwright/version.rb +2 -2
  31. data/lib/playwright_api/accessibility.rb +2 -1
  32. data/lib/playwright_api/android.rb +2 -2
  33. data/lib/playwright_api/android_device.rb +0 -5
  34. data/lib/playwright_api/api_request.rb +3 -3
  35. data/lib/playwright_api/api_request_context.rb +15 -2
  36. data/lib/playwright_api/browser_context.rb +5 -5
  37. data/lib/playwright_api/browser_type.rb +2 -2
  38. data/lib/playwright_api/console_message.rb +20 -1
  39. data/lib/playwright_api/element_handle.rb +53 -38
  40. data/lib/playwright_api/file_chooser.rb +1 -1
  41. data/lib/playwright_api/frame.rb +30 -23
  42. data/lib/playwright_api/frame_locator.rb +1 -1
  43. data/lib/playwright_api/locator.rb +48 -27
  44. data/lib/playwright_api/page.rb +39 -29
  45. data/lib/playwright_api/playwright.rb +1 -1
  46. data/lib/playwright_api/route.rb +2 -0
  47. data/lib/playwright_api/selectors.rb +1 -1
  48. data/lib/playwright_api/tracing.rb +1 -1
  49. data/lib/playwright_api/worker.rb +4 -4
  50. metadata +5 -3
@@ -2,7 +2,7 @@ module Playwright
2
2
  # Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way
3
3
  # to find element(s) on the page at any moment. Locator can be created with the [`method: Page.locator`] method.
4
4
  #
5
- # [Learn more about locators](./locators.md).
5
+ # [Learn more about locators](../locators.md).
6
6
  class Locator < PlaywrightApi
7
7
 
8
8
  # Returns an array of `node.innerText` values for all matching nodes.
@@ -39,7 +39,7 @@ module Playwright
39
39
  # This method checks the element by performing the following steps:
40
40
  # 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already checked,
41
41
  # this method returns immediately.
42
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
42
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
43
43
  # 1. Scroll the element into view if needed.
44
44
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
45
45
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
@@ -59,7 +59,7 @@ module Playwright
59
59
  end
60
60
 
61
61
  # This method clicks the element by performing the following steps:
62
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
62
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
63
63
  # 1. Scroll the element into view if needed.
64
64
  # 1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.
65
65
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
@@ -87,7 +87,7 @@ module Playwright
87
87
  end
88
88
 
89
89
  # This method double clicks the element by performing the following steps:
90
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
90
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
91
91
  # 1. Scroll the element into view if needed.
92
92
  # 1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.
93
93
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
@@ -211,7 +211,7 @@ module Playwright
211
211
  wrap_impl(@impl.evaluate_handle(unwrap_impl(expression), arg: unwrap_impl(arg), timeout: unwrap_impl(timeout)))
212
212
  end
213
213
 
214
- # This method waits for [actionability](./actionability.md) checks, focuses the element, fills it and triggers an `input`
214
+ # This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input`
215
215
  # event after filling. Note that you can pass an empty string to clear the input field.
216
216
  #
217
217
  # If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
@@ -224,6 +224,11 @@ module Playwright
224
224
  wrap_impl(@impl.fill(unwrap_impl(value), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
225
225
  end
226
226
 
227
+ # This method narrows existing locator according to the options, for example filters by text.
228
+ def filter(has: nil, hasText: nil)
229
+ wrap_impl(@impl.filter(has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
230
+ end
231
+
227
232
  # Returns locator to the first matching element.
228
233
  def first
229
234
  wrap_impl(@impl.first)
@@ -257,7 +262,7 @@ module Playwright
257
262
  end
258
263
 
259
264
  # This method hovers over the element by performing the following steps:
260
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
265
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
261
266
  # 1. Scroll the element into view if needed.
262
267
  # 1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.
263
268
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
@@ -285,7 +290,10 @@ module Playwright
285
290
  wrap_impl(@impl.inner_text(timeout: unwrap_impl(timeout)))
286
291
  end
287
292
 
288
- # Returns `input.value` for `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
293
+ # Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
294
+ #
295
+ # Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
296
+ # [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
289
297
  def input_value(timeout: nil)
290
298
  wrap_impl(@impl.input_value(timeout: unwrap_impl(timeout)))
291
299
  end
@@ -295,27 +303,27 @@ module Playwright
295
303
  wrap_impl(@impl.checked?(timeout: unwrap_impl(timeout)))
296
304
  end
297
305
 
298
- # Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
306
+ # Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
299
307
  def disabled?(timeout: nil)
300
308
  wrap_impl(@impl.disabled?(timeout: unwrap_impl(timeout)))
301
309
  end
302
310
 
303
- # Returns whether the element is [editable](./actionability.md#editable).
311
+ # Returns whether the element is [editable](../actionability.md#editable).
304
312
  def editable?(timeout: nil)
305
313
  wrap_impl(@impl.editable?(timeout: unwrap_impl(timeout)))
306
314
  end
307
315
 
308
- # Returns whether the element is [enabled](./actionability.md#enabled).
316
+ # Returns whether the element is [enabled](../actionability.md#enabled).
309
317
  def enabled?(timeout: nil)
310
318
  wrap_impl(@impl.enabled?(timeout: unwrap_impl(timeout)))
311
319
  end
312
320
 
313
- # Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible).
321
+ # Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible).
314
322
  def hidden?(timeout: nil)
315
323
  wrap_impl(@impl.hidden?(timeout: unwrap_impl(timeout)))
316
324
  end
317
325
 
318
- # Returns whether the element is [visible](./actionability.md#visible).
326
+ # Returns whether the element is [visible](../actionability.md#visible).
319
327
  def visible?(timeout: nil)
320
328
  wrap_impl(@impl.visible?(timeout: unwrap_impl(timeout)))
321
329
  end
@@ -325,12 +333,13 @@ module Playwright
325
333
  wrap_impl(@impl.last)
326
334
  end
327
335
 
328
- # The method finds an element matching the specified selector in the `Locator`'s subtree.
336
+ # The method finds an element matching the specified selector in the `Locator`'s subtree. It also accepts filter options,
337
+ # similar to [`method: Locator.filter`] method.
329
338
  def locator(selector, has: nil, hasText: nil)
330
339
  wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
331
340
  end
332
341
 
333
- # Returns locator to the n-th matching element.
342
+ # Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element.
334
343
  def nth(index)
335
344
  wrap_impl(@impl.nth(unwrap_impl(index)))
336
345
  end
@@ -362,29 +371,35 @@ module Playwright
362
371
  wrap_impl(@impl.press(unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
363
372
  end
364
373
 
365
- # Returns the buffer with the captured screenshot.
374
+ # This method captures a screenshot of the page, clipped to the size and position of a particular element matching the
375
+ # locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element
376
+ # is a scrollable container, only the currently scrolled content will be visible on the screenshot.
366
377
  #
367
- # This method waits for the [actionability](./actionability.md) checks, then scrolls element into view before taking a
378
+ # This method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking a
368
379
  # screenshot. If the element is detached from DOM, the method throws an error.
380
+ #
381
+ # Returns the buffer with the captured screenshot.
369
382
  def screenshot(
370
383
  animations: nil,
384
+ caret: nil,
371
385
  mask: nil,
372
386
  omitBackground: nil,
373
387
  path: nil,
374
388
  quality: nil,
389
+ scale: nil,
375
390
  timeout: nil,
376
391
  type: nil)
377
- wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
392
+ wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
378
393
  end
379
394
 
380
- # This method waits for [actionability](./actionability.md) checks, then tries to scroll element into view, unless it is
395
+ # This method waits for [actionability](../actionability.md) checks, then tries to scroll element into view, unless it is
381
396
  # completely visible as defined by
382
397
  # [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.
383
398
  def scroll_into_view_if_needed(timeout: nil)
384
399
  wrap_impl(@impl.scroll_into_view_if_needed(timeout: unwrap_impl(timeout)))
385
400
  end
386
401
 
387
- # This method waits for [actionability](./actionability.md) checks, waits until all specified options are present in the
402
+ # This method waits for [actionability](../actionability.md) checks, waits until all specified options are present in the
388
403
  # `<select>` element and selects these options.
389
404
  #
390
405
  # If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
@@ -425,8 +440,12 @@ module Playwright
425
440
  wrap_impl(@impl.select_option(element: unwrap_impl(element), index: unwrap_impl(index), value: unwrap_impl(value), label: unwrap_impl(label), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
426
441
  end
427
442
 
428
- # This method waits for [actionability](./actionability.md) checks, then focuses the element and selects all its text
443
+ # This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its text
429
444
  # content.
445
+ #
446
+ # If the element is inside the `<label>` element that has an associated
447
+ # [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the
448
+ # control instead.
430
449
  def select_text(force: nil, timeout: nil)
431
450
  wrap_impl(@impl.select_text(force: unwrap_impl(force), timeout: unwrap_impl(timeout)))
432
451
  end
@@ -434,7 +453,7 @@ module Playwright
434
453
  # This method checks or unchecks an element by performing the following steps:
435
454
  # 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
436
455
  # 1. If the element already has the right checked state, this method returns immediately.
437
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
456
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
438
457
  # element is detached during the checks, the whole action is retried.
439
458
  # 1. Scroll the element into view if needed.
440
459
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
@@ -454,18 +473,20 @@ module Playwright
454
473
  end
455
474
  alias_method :checked=, :set_checked
456
475
 
457
- # This method expects `element` to point to an
458
- # [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
459
- #
460
476
  # Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
461
- # are resolved relative to the the current working directory. For empty array, clears the selected files.
477
+ # are resolved relative to the current working directory. For empty array, clears the selected files.
478
+ #
479
+ # This method expects `Locator` to point to an
480
+ # [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
481
+ # `<label>` element that has an associated
482
+ # [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
462
483
  def set_input_files(files, noWaitAfter: nil, timeout: nil)
463
484
  wrap_impl(@impl.set_input_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
464
485
  end
465
486
  alias_method :input_files=, :set_input_files
466
487
 
467
488
  # This method taps the element by performing the following steps:
468
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
489
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
469
490
  # 1. Scroll the element into view if needed.
470
491
  # 1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.
471
492
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
@@ -514,7 +535,7 @@ module Playwright
514
535
  # This method checks the element by performing the following steps:
515
536
  # 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already
516
537
  # unchecked, this method returns immediately.
517
- # 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
538
+ # 1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.
518
539
  # 1. Scroll the element into view if needed.
519
540
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
520
541
  # 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
@@ -56,7 +56,8 @@ module Playwright
56
56
  wrap_impl(@impl.mouse)
57
57
  end
58
58
 
59
- # API testing helper associated with this page. Requests made with this API will use page cookies.
59
+ # API testing helper associated with this page. This method returns the same instance as
60
+ # [`property: BrowserContext.request`] on the page's context. See [`property: BrowserContext.request`] for more details.
60
61
  def request # property
61
62
  wrap_impl(@impl.request)
62
63
  end
@@ -111,7 +112,7 @@ module Playwright
111
112
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
112
113
  # 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
113
114
  # checked, this method returns immediately.
114
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
115
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
115
116
  # element is detached during the checks, the whole action is retried.
116
117
  # 1. Scroll the element into view if needed.
117
118
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
@@ -135,7 +136,7 @@ module Playwright
135
136
 
136
137
  # This method clicks an element matching `selector` by performing the following steps:
137
138
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
138
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
139
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
139
140
  # element is detached during the checks, the whole action is retried.
140
141
  # 1. Scroll the element into view if needed.
141
142
  # 1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.
@@ -183,7 +184,7 @@ module Playwright
183
184
 
184
185
  # This method double clicks an element matching `selector` by performing the following steps:
185
186
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
186
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
187
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
187
188
  # element is detached during the checks, the whole action is retried.
188
189
  # 1. Scroll the element into view if needed.
189
190
  # 1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.
@@ -501,7 +502,7 @@ module Playwright
501
502
  wrap_impl(@impl.expose_function(unwrap_impl(name), unwrap_impl(callback)))
502
503
  end
503
504
 
504
- # This method waits for an element matching `selector`, waits for [actionability](./actionability.md) checks, focuses the
505
+ # This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, focuses the
505
506
  # element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input
506
507
  # field.
507
508
  #
@@ -582,8 +583,8 @@ module Playwright
582
583
  wrap_impl(@impl.go_forward(timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
583
584
  end
584
585
 
585
- # Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
586
- # last redirect.
586
+ # Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first
587
+ # non-redirect response.
587
588
  #
588
589
  # The method will throw an error if:
589
590
  # - there's an SSL error (e.g. in case of self-signed certificates).
@@ -608,7 +609,7 @@ module Playwright
608
609
 
609
610
  # This method hovers over an element matching `selector` by performing the following steps:
610
611
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
611
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
612
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
612
613
  # element is detached during the checks, the whole action is retried.
613
614
  # 1. Scroll the element into view if needed.
614
615
  # 1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.
@@ -639,7 +640,10 @@ module Playwright
639
640
  wrap_impl(@impl.inner_text(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
640
641
  end
641
642
 
642
- # Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
643
+ # Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
644
+ #
645
+ # Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
646
+ # [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
643
647
  def input_value(selector, strict: nil, timeout: nil)
644
648
  wrap_impl(@impl.input_value(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
645
649
  end
@@ -654,28 +658,28 @@ module Playwright
654
658
  wrap_impl(@impl.closed?)
655
659
  end
656
660
 
657
- # Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
661
+ # Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
658
662
  def disabled?(selector, strict: nil, timeout: nil)
659
663
  wrap_impl(@impl.disabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
660
664
  end
661
665
 
662
- # Returns whether the element is [editable](./actionability.md#editable).
666
+ # Returns whether the element is [editable](../actionability.md#editable).
663
667
  def editable?(selector, strict: nil, timeout: nil)
664
668
  wrap_impl(@impl.editable?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
665
669
  end
666
670
 
667
- # Returns whether the element is [enabled](./actionability.md#enabled).
671
+ # Returns whether the element is [enabled](../actionability.md#enabled).
668
672
  def enabled?(selector, strict: nil, timeout: nil)
669
673
  wrap_impl(@impl.enabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
670
674
  end
671
675
 
672
- # Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
676
+ # Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). `selector` that does not
673
677
  # match any elements is considered hidden.
674
678
  def hidden?(selector, strict: nil, timeout: nil)
675
679
  wrap_impl(@impl.hidden?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
676
680
  end
677
681
 
678
- # Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
682
+ # Returns whether the element is [visible](../actionability.md#visible). `selector` that does not match any elements is
679
683
  # considered not visible.
680
684
  def visible?(selector, strict: nil, timeout: nil)
681
685
  wrap_impl(@impl.visible?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
@@ -685,6 +689,8 @@ module Playwright
685
689
  # element immediately before performing an action, so a series of actions on the same locator can in fact be performed on
686
690
  # different DOM elements. That would happen if the DOM structure between those actions has changed.
687
691
  #
692
+ # [Learn more about locators](../locators.md).
693
+ #
688
694
  # Shortcut for main frame's [`method: Frame.locator`].
689
695
  def locator(selector, has: nil, hasText: nil)
690
696
  wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
@@ -892,18 +898,20 @@ module Playwright
892
898
  # Returns the buffer with the captured screenshot.
893
899
  def screenshot(
894
900
  animations: nil,
901
+ caret: nil,
895
902
  clip: nil,
896
903
  fullPage: nil,
897
904
  mask: nil,
898
905
  omitBackground: nil,
899
906
  path: nil,
900
907
  quality: nil,
908
+ scale: nil,
901
909
  timeout: nil,
902
910
  type: nil)
903
- wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), clip: unwrap_impl(clip), fullPage: unwrap_impl(fullPage), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
911
+ wrap_impl(@impl.screenshot(animations: unwrap_impl(animations), caret: unwrap_impl(caret), clip: unwrap_impl(clip), fullPage: unwrap_impl(fullPage), mask: unwrap_impl(mask), omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), scale: unwrap_impl(scale), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
904
912
  end
905
913
 
906
- # This method waits for an element matching `selector`, waits for [actionability](./actionability.md) checks, waits until
914
+ # This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, waits until
907
915
  # all specified options are present in the `<select>` element and selects these options.
908
916
  #
909
917
  # If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
@@ -941,7 +949,7 @@ module Playwright
941
949
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
942
950
  # 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
943
951
  # 1. If the element already has the right checked state, this method returns immediately.
944
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
952
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
945
953
  # element is detached during the checks, the whole action is retried.
946
954
  # 1. Scroll the element into view if needed.
947
955
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
@@ -1001,11 +1009,13 @@ module Playwright
1001
1009
  end
1002
1010
  alias_method :extra_http_headers=, :set_extra_http_headers
1003
1011
 
1004
- # This method expects `selector` to point to an
1005
- # [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
1006
- #
1007
1012
  # Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
1008
- # are resolved relative to the the current working directory. For empty array, clears the selected files.
1013
+ # are resolved relative to the current working directory. For empty array, clears the selected files.
1014
+ #
1015
+ # This method expects `selector` to point to an
1016
+ # [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
1017
+ # `<label>` element that has an associated
1018
+ # [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
1009
1019
  def set_input_files(
1010
1020
  selector,
1011
1021
  files,
@@ -1035,7 +1045,7 @@ module Playwright
1035
1045
 
1036
1046
  # This method taps an element matching `selector` by performing the following steps:
1037
1047
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
1038
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
1048
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
1039
1049
  # element is detached during the checks, the whole action is retried.
1040
1050
  # 1. Scroll the element into view if needed.
1041
1051
  # 1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.
@@ -1094,7 +1104,7 @@ module Playwright
1094
1104
  # 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
1095
1105
  # 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
1096
1106
  # unchecked, this method returns immediately.
1097
- # 1. Wait for [actionability](./actionability.md) checks on the matched element, unless `force` option is set. If the
1107
+ # 1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If the
1098
1108
  # element is detached during the checks, the whole action is retried.
1099
1109
  # 1. Scroll the element into view if needed.
1100
1110
  # 1. Use [`property: Page.mouse`] to click in the center of the element.
@@ -1252,7 +1262,7 @@ module Playwright
1252
1262
  wrap_impl(@impl.expect_popup(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
1253
1263
  end
1254
1264
 
1255
- # Waits for the matching request and returns it. See [waiting for event](./events.md#waiting-for-event) for more details
1265
+ # Waits for the matching request and returns it. See [waiting for event](../events.md#waiting-for-event) for more details
1256
1266
  # about events.
1257
1267
  #
1258
1268
  # ```python sync
@@ -1276,7 +1286,7 @@ module Playwright
1276
1286
  wrap_impl(@impl.expect_request_finished(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
1277
1287
  end
1278
1288
 
1279
- # Returns the matched response. See [waiting for event](./events.md#waiting-for-event) for more details about events.
1289
+ # Returns the matched response. See [waiting for event](../events.md#waiting-for-event) for more details about events.
1280
1290
  #
1281
1291
  # ```python sync
1282
1292
  # with page.expect_response("https://example.com/resource") as response_info:
@@ -1395,13 +1405,13 @@ module Playwright
1395
1405
  end
1396
1406
 
1397
1407
  # @nodoc
1398
- def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1399
- wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1408
+ def stop_js_coverage
1409
+ wrap_impl(@impl.stop_js_coverage)
1400
1410
  end
1401
1411
 
1402
1412
  # @nodoc
1403
- def stop_js_coverage
1404
- wrap_impl(@impl.stop_js_coverage)
1413
+ def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
1414
+ wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
1405
1415
  end
1406
1416
 
1407
1417
  # @nodoc
@@ -55,7 +55,7 @@ module Playwright
55
55
  raise NotImplementedError.new('request is not implemented yet.')
56
56
  end
57
57
 
58
- # Selectors can be used to install custom selector engines. See [Working with selectors](./selectors.md) for more
58
+ # Selectors can be used to install custom selector engines. See [Working with selectors](../selectors.md) for more
59
59
  # information.
60
60
  def selectors # property
61
61
  wrap_impl(@impl.selectors)
@@ -1,6 +1,8 @@
1
1
  module Playwright
2
2
  # Whenever a network route is set up with [`method: Page.route`] or [`method: BrowserContext.route`], the `Route` object
3
3
  # allows to handle the route.
4
+ #
5
+ # Learn more about [networking](../network.md).
4
6
  class Route < PlaywrightApi
5
7
 
6
8
  # Aborts the route's request.
@@ -1,5 +1,5 @@
1
1
  module Playwright
2
- # Selectors can be used to install custom selector engines. See [Working with selectors](./selectors.md) for more
2
+ # Selectors can be used to install custom selector engines. See [Working with selectors](../selectors.md) for more
3
3
  # information.
4
4
  class Selectors < PlaywrightApi
5
5
 
@@ -1,5 +1,5 @@
1
1
  module Playwright
2
- # API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](./trace-viewer.md)
2
+ # API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](../trace-viewer.md)
3
3
  # after Playwright script runs.
4
4
  #
5
5
  # Start recording a trace before performing actions. At the end, stop tracing and save it to a file.
@@ -44,13 +44,13 @@ module Playwright
44
44
  end
45
45
 
46
46
  # @nodoc
47
- def context=(req)
48
- wrap_impl(@impl.context=(unwrap_impl(req)))
47
+ def page=(req)
48
+ wrap_impl(@impl.page=(unwrap_impl(req)))
49
49
  end
50
50
 
51
51
  # @nodoc
52
- def page=(req)
53
- wrap_impl(@impl.page=(unwrap_impl(req)))
52
+ def context=(req)
53
+ wrap_impl(@impl.context=(unwrap_impl(req)))
54
54
  end
55
55
 
56
56
  # -- inherited from EventEmitter --
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.1
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-26 00:00:00.000000000 Z
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -307,6 +307,7 @@ files:
307
307
  - lib/playwright/channel_owners/tracing.rb
308
308
  - lib/playwright/channel_owners/web_socket.rb
309
309
  - lib/playwright/channel_owners/worker.rb
310
+ - lib/playwright/channel_owners/writable_stream.rb
310
311
  - lib/playwright/connection.rb
311
312
  - lib/playwright/download_impl.rb
312
313
  - lib/playwright/errors.rb
@@ -321,6 +322,7 @@ files:
321
322
  - lib/playwright/javascript/expression.rb
322
323
  - lib/playwright/javascript/value_parser.rb
323
324
  - lib/playwright/javascript/value_serializer.rb
325
+ - lib/playwright/javascript/visitor_info.rb
324
326
  - lib/playwright/keyboard_impl.rb
325
327
  - lib/playwright/locator_impl.rb
326
328
  - lib/playwright/mouse_impl.rb
@@ -396,5 +398,5 @@ requirements: []
396
398
  rubygems_version: 3.3.7
397
399
  signing_key:
398
400
  specification_version: 4
399
- summary: The Ruby binding of playwright driver 1.20.1
401
+ summary: The Ruby binding of playwright driver 1.22.1
400
402
  test_files: []