playwright-ruby-client 0.8.1 → 1.14.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/documentation/docs/api/accessibility.md +51 -1
  3. data/documentation/docs/api/browser_context.md +28 -0
  4. data/documentation/docs/api/download.md +97 -0
  5. data/documentation/docs/api/element_handle.md +28 -3
  6. data/documentation/docs/api/experimental/android.md +15 -2
  7. data/documentation/docs/api/frame.md +116 -114
  8. data/documentation/docs/api/locator.md +650 -0
  9. data/documentation/docs/api/mouse.md +3 -4
  10. data/documentation/docs/api/page.md +109 -19
  11. data/documentation/docs/api/request.md +15 -19
  12. data/documentation/docs/api/touchscreen.md +8 -0
  13. data/documentation/docs/api/tracing.md +13 -12
  14. data/documentation/docs/api/worker.md +37 -0
  15. data/documentation/docs/article/guides/inspector.md +31 -0
  16. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +1 -1
  17. data/documentation/docs/article/guides/semi_automation.md +1 -1
  18. data/documentation/docs/include/api_coverage.md +70 -14
  19. data/lib/playwright.rb +0 -1
  20. data/lib/playwright/accessibility_impl.rb +50 -0
  21. data/lib/playwright/channel_owners/browser_context.rb +70 -0
  22. data/lib/playwright/channel_owners/frame.rb +79 -33
  23. data/lib/playwright/channel_owners/page.rb +133 -42
  24. data/lib/playwright/channel_owners/request.rb +8 -8
  25. data/lib/playwright/channel_owners/worker.rb +23 -0
  26. data/lib/playwright/{download.rb → download_impl.rb} +1 -1
  27. data/lib/playwright/javascript/expression.rb +5 -4
  28. data/lib/playwright/locator_impl.rb +314 -0
  29. data/lib/playwright/timeout_settings.rb +4 -4
  30. data/lib/playwright/touchscreen_impl.rb +7 -0
  31. data/lib/playwright/tracing_impl.rb +9 -8
  32. data/lib/playwright/version.rb +2 -2
  33. data/lib/playwright_api/accessibility.rb +1 -1
  34. data/lib/playwright_api/android.rb +21 -8
  35. data/lib/playwright_api/android_device.rb +6 -6
  36. data/lib/playwright_api/browser.rb +6 -6
  37. data/lib/playwright_api/browser_context.rb +16 -11
  38. data/lib/playwright_api/browser_type.rb +6 -6
  39. data/lib/playwright_api/cdp_session.rb +6 -6
  40. data/lib/playwright_api/console_message.rb +6 -6
  41. data/lib/playwright_api/dialog.rb +6 -6
  42. data/lib/playwright_api/download.rb +70 -0
  43. data/lib/playwright_api/element_handle.rb +34 -20
  44. data/lib/playwright_api/frame.rb +85 -53
  45. data/lib/playwright_api/js_handle.rb +6 -6
  46. data/lib/playwright_api/locator.rb +509 -0
  47. data/lib/playwright_api/page.rb +91 -57
  48. data/lib/playwright_api/playwright.rb +6 -6
  49. data/lib/playwright_api/request.rb +6 -6
  50. data/lib/playwright_api/response.rb +6 -6
  51. data/lib/playwright_api/route.rb +6 -6
  52. data/lib/playwright_api/selectors.rb +6 -6
  53. data/lib/playwright_api/touchscreen.rb +1 -1
  54. data/lib/playwright_api/web_socket.rb +6 -6
  55. data/lib/playwright_api/worker.rb +16 -6
  56. metadata +13 -6
@@ -122,9 +122,10 @@ module Playwright
122
122
  force: nil,
123
123
  noWaitAfter: nil,
124
124
  position: nil,
125
+ strict: nil,
125
126
  timeout: nil,
126
127
  trial: nil)
127
- wrap_impl(@impl.check(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
128
+ wrap_impl(@impl.check(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
128
129
  end
129
130
 
130
131
  # This method clicks an element matching `selector` by performing the following steps:
@@ -148,9 +149,10 @@ module Playwright
148
149
  modifiers: nil,
149
150
  noWaitAfter: nil,
150
151
  position: nil,
152
+ strict: nil,
151
153
  timeout: nil,
152
154
  trial: nil)
153
- wrap_impl(@impl.click(unwrap_impl(selector), button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
155
+ wrap_impl(@impl.click(unwrap_impl(selector), button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
154
156
  end
155
157
 
156
158
  # If `runBeforeUnload` is `false`, does not run any unload handlers and waits for the page to be closed. If
@@ -197,9 +199,10 @@ module Playwright
197
199
  modifiers: nil,
198
200
  noWaitAfter: nil,
199
201
  position: nil,
202
+ strict: nil,
200
203
  timeout: nil,
201
204
  trial: nil)
202
- wrap_impl(@impl.dblclick(unwrap_impl(selector), button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
205
+ wrap_impl(@impl.dblclick(unwrap_impl(selector), button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
203
206
  end
204
207
 
205
208
  # The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,
@@ -229,8 +232,13 @@ module Playwright
229
232
  # data_transfer = page.evaluate_handle("new DataTransfer()")
230
233
  # page.dispatch_event("#source", "dragstart", { "dataTransfer": data_transfer })
231
234
  # ```
232
- def dispatch_event(selector, type, eventInit: nil, timeout: nil)
233
- wrap_impl(@impl.dispatch_event(unwrap_impl(selector), unwrap_impl(type), eventInit: unwrap_impl(eventInit), timeout: unwrap_impl(timeout)))
235
+ def dispatch_event(
236
+ selector,
237
+ type,
238
+ eventInit: nil,
239
+ strict: nil,
240
+ timeout: nil)
241
+ wrap_impl(@impl.dispatch_event(unwrap_impl(selector), unwrap_impl(type), eventInit: unwrap_impl(eventInit), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
234
242
  end
235
243
 
236
244
  def drag_and_drop(
@@ -238,9 +246,12 @@ module Playwright
238
246
  target,
239
247
  force: nil,
240
248
  noWaitAfter: nil,
249
+ sourcePosition: nil,
250
+ strict: nil,
251
+ targetPosition: nil,
241
252
  timeout: nil,
242
253
  trial: nil)
243
- wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
254
+ wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
244
255
  end
245
256
 
246
257
  # This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media
@@ -292,8 +303,8 @@ module Playwright
292
303
  # ```
293
304
  #
294
305
  # Shortcut for main frame's [`method: Frame.evalOnSelector`].
295
- def eval_on_selector(selector, expression, arg: nil)
296
- wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg)))
306
+ def eval_on_selector(selector, expression, arg: nil, strict: nil)
307
+ wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg), strict: unwrap_impl(strict)))
297
308
  end
298
309
 
299
310
  # The method finds all elements matching the specified selector within the page and passes an array of matched elements as
@@ -496,16 +507,17 @@ module Playwright
496
507
  value,
497
508
  force: nil,
498
509
  noWaitAfter: nil,
510
+ strict: nil,
499
511
  timeout: nil)
500
- wrap_impl(@impl.fill(unwrap_impl(selector), unwrap_impl(value), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
512
+ wrap_impl(@impl.fill(unwrap_impl(selector), unwrap_impl(value), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
501
513
  end
502
514
 
503
515
  # This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method
504
516
  # waits until a matching element appears in the DOM.
505
517
  #
506
518
  # Shortcut for main frame's [`method: Frame.focus`].
507
- def focus(selector, timeout: nil)
508
- wrap_impl(@impl.focus(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
519
+ def focus(selector, strict: nil, timeout: nil)
520
+ wrap_impl(@impl.focus(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
509
521
  end
510
522
 
511
523
  # Returns frame matching the specified criteria. Either `name` or `url` must be specified.
@@ -527,8 +539,8 @@ module Playwright
527
539
  end
528
540
 
529
541
  # Returns element attribute value.
530
- def get_attribute(selector, name, timeout: nil)
531
- wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), timeout: unwrap_impl(timeout)))
542
+ def get_attribute(selector, name, strict: nil, timeout: nil)
543
+ wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
532
544
  end
533
545
 
534
546
  # Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
@@ -588,29 +600,30 @@ module Playwright
588
600
  force: nil,
589
601
  modifiers: nil,
590
602
  position: nil,
603
+ strict: nil,
591
604
  timeout: nil,
592
605
  trial: nil)
593
- wrap_impl(@impl.hover(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
606
+ wrap_impl(@impl.hover(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
594
607
  end
595
608
 
596
609
  # Returns `element.innerHTML`.
597
- def inner_html(selector, timeout: nil)
598
- wrap_impl(@impl.inner_html(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
610
+ def inner_html(selector, strict: nil, timeout: nil)
611
+ wrap_impl(@impl.inner_html(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
599
612
  end
600
613
 
601
614
  # Returns `element.innerText`.
602
- def inner_text(selector, timeout: nil)
603
- wrap_impl(@impl.inner_text(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
615
+ def inner_text(selector, strict: nil, timeout: nil)
616
+ wrap_impl(@impl.inner_text(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
604
617
  end
605
618
 
606
- # Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
607
- def input_value(selector, timeout: nil)
608
- wrap_impl(@impl.input_value(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
619
+ # Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element. Throws for non-input elements.
620
+ def input_value(selector, strict: nil, timeout: nil)
621
+ wrap_impl(@impl.input_value(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
609
622
  end
610
623
 
611
624
  # Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
612
- def checked?(selector, timeout: nil)
613
- wrap_impl(@impl.checked?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
625
+ def checked?(selector, strict: nil, timeout: nil)
626
+ wrap_impl(@impl.checked?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
614
627
  end
615
628
 
616
629
  # Indicates that the page has been closed.
@@ -619,30 +632,41 @@ module Playwright
619
632
  end
620
633
 
621
634
  # Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
622
- def disabled?(selector, timeout: nil)
623
- wrap_impl(@impl.disabled?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
635
+ def disabled?(selector, strict: nil, timeout: nil)
636
+ wrap_impl(@impl.disabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
624
637
  end
625
638
 
626
639
  # Returns whether the element is [editable](./actionability.md#editable).
627
- def editable?(selector, timeout: nil)
628
- wrap_impl(@impl.editable?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
640
+ def editable?(selector, strict: nil, timeout: nil)
641
+ wrap_impl(@impl.editable?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
629
642
  end
630
643
 
631
644
  # Returns whether the element is [enabled](./actionability.md#enabled).
632
- def enabled?(selector, timeout: nil)
633
- wrap_impl(@impl.enabled?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
645
+ def enabled?(selector, strict: nil, timeout: nil)
646
+ wrap_impl(@impl.enabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
634
647
  end
635
648
 
636
649
  # Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
637
650
  # match any elements is considered hidden.
638
- def hidden?(selector, timeout: nil)
639
- wrap_impl(@impl.hidden?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
651
+ def hidden?(selector, strict: nil, timeout: nil)
652
+ wrap_impl(@impl.hidden?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
640
653
  end
641
654
 
642
655
  # Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
643
656
  # considered not visible.
644
- def visible?(selector, timeout: nil)
645
- wrap_impl(@impl.visible?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
657
+ def visible?(selector, strict: nil, timeout: nil)
658
+ wrap_impl(@impl.visible?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
659
+ end
660
+
661
+ # The method returns an element locator that can be used to perform actions on the page. Locator is resolved to the
662
+ # element immediately before performing an action, so a series of actions on the same locator can in fact be performed on
663
+ # different DOM elements. That would happen if the DOM structure between those actions has changed.
664
+ #
665
+ # Note that locator always implies visibility, so it will always be locating visible elements.
666
+ #
667
+ # Shortcut for main frame's [`method: Frame.locator`].
668
+ def locator(selector)
669
+ wrap_impl(@impl.locator(unwrap_impl(selector)))
646
670
  end
647
671
 
648
672
  # The page's main frame. Page is guaranteed to have a main frame which persists during navigations.
@@ -664,7 +688,7 @@ module Playwright
664
688
  # > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the
665
689
  # [`method: BrowserType.launch`].
666
690
  def pause
667
- raise NotImplementedError.new('pause is not implemented yet.')
691
+ wrap_impl(@impl.pause)
668
692
  end
669
693
 
670
694
  # Returns the PDF buffer.
@@ -764,16 +788,17 @@ module Playwright
764
788
  key,
765
789
  delay: nil,
766
790
  noWaitAfter: nil,
791
+ strict: nil,
767
792
  timeout: nil)
768
- wrap_impl(@impl.press(unwrap_impl(selector), unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
793
+ wrap_impl(@impl.press(unwrap_impl(selector), unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
769
794
  end
770
795
 
771
796
  # The method finds an element matching the specified selector within the page. If no elements match the selector, the
772
797
  # return value resolves to `null`. To wait for an element on the page, use [`method: Page.waitForSelector`].
773
798
  #
774
799
  # Shortcut for main frame's [`method: Frame.querySelector`].
775
- def query_selector(selector)
776
- wrap_impl(@impl.query_selector(unwrap_impl(selector)))
800
+ def query_selector(selector, strict: nil)
801
+ wrap_impl(@impl.query_selector(unwrap_impl(selector), strict: unwrap_impl(strict)))
777
802
  end
778
803
 
779
804
  # The method finds all elements matching the specified selector within the page. If no elements match the selector, the
@@ -877,8 +902,9 @@ module Playwright
877
902
  label: nil,
878
903
  force: nil,
879
904
  noWaitAfter: nil,
905
+ strict: nil,
880
906
  timeout: nil)
881
- wrap_impl(@impl.select_option(unwrap_impl(selector), 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)))
907
+ wrap_impl(@impl.select_option(unwrap_impl(selector), element: unwrap_impl(element), index: unwrap_impl(index), value: unwrap_impl(value), label: unwrap_impl(label), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
882
908
  end
883
909
 
884
910
  def set_content(html, timeout: nil, waitUntil: nil)
@@ -923,8 +949,13 @@ module Playwright
923
949
  #
924
950
  # Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
925
951
  # are resolved relative to the the current working directory. For empty array, clears the selected files.
926
- def set_input_files(selector, files, noWaitAfter: nil, timeout: nil)
927
- wrap_impl(@impl.set_input_files(unwrap_impl(selector), unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
952
+ def set_input_files(
953
+ selector,
954
+ files,
955
+ noWaitAfter: nil,
956
+ strict: nil,
957
+ timeout: nil)
958
+ wrap_impl(@impl.set_input_files(unwrap_impl(selector), unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
928
959
  end
929
960
 
930
961
  # In the case of multiple pages in a single browser, each page can have its own viewport size. However,
@@ -963,14 +994,15 @@ module Playwright
963
994
  modifiers: nil,
964
995
  noWaitAfter: nil,
965
996
  position: nil,
997
+ strict: nil,
966
998
  timeout: nil,
967
999
  trial: nil)
968
- wrap_impl(@impl.tap_point(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
1000
+ wrap_impl(@impl.tap_point(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
969
1001
  end
970
1002
 
971
1003
  # Returns `element.textContent`.
972
- def text_content(selector, timeout: nil)
973
- wrap_impl(@impl.text_content(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
1004
+ def text_content(selector, strict: nil, timeout: nil)
1005
+ wrap_impl(@impl.text_content(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
974
1006
  end
975
1007
 
976
1008
  # Returns the page's title. Shortcut for main frame's [`method: Frame.title`].
@@ -994,8 +1026,9 @@ module Playwright
994
1026
  text,
995
1027
  delay: nil,
996
1028
  noWaitAfter: nil,
1029
+ strict: nil,
997
1030
  timeout: nil)
998
- wrap_impl(@impl.type(unwrap_impl(selector), unwrap_impl(text), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
1031
+ wrap_impl(@impl.type(unwrap_impl(selector), unwrap_impl(text), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
999
1032
  end
1000
1033
 
1001
1034
  # This method unchecks an element matching `selector` by performing the following steps:
@@ -1018,9 +1051,10 @@ module Playwright
1018
1051
  force: nil,
1019
1052
  noWaitAfter: nil,
1020
1053
  position: nil,
1054
+ strict: nil,
1021
1055
  timeout: nil,
1022
1056
  trial: nil)
1023
- wrap_impl(@impl.uncheck(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
1057
+ wrap_impl(@impl.uncheck(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
1024
1058
  end
1025
1059
 
1026
1060
  # Removes a route created with [`method: Page.route`]. When `handler` is not specified, removes all routes for the `url`.
@@ -1226,8 +1260,8 @@ module Playwright
1226
1260
  # with sync_playwright() as playwright:
1227
1261
  # run(playwright)
1228
1262
  # ```
1229
- def wait_for_selector(selector, state: nil, timeout: nil)
1230
- wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
1263
+ def wait_for_selector(selector, state: nil, strict: nil, timeout: nil)
1264
+ wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
1231
1265
  end
1232
1266
 
1233
1267
  # Waits for the given `timeout` in milliseconds.
@@ -1242,7 +1276,7 @@ module Playwright
1242
1276
  #
1243
1277
  # Shortcut for main frame's [`method: Frame.waitForTimeout`].
1244
1278
  def wait_for_timeout(timeout)
1245
- raise NotImplementedError.new('wait_for_timeout is not implemented yet.')
1279
+ wrap_impl(@impl.wait_for_timeout(unwrap_impl(timeout)))
1246
1280
  end
1247
1281
 
1248
1282
  # Waits for the main frame to navigate to the given URL.
@@ -1267,8 +1301,8 @@ module Playwright
1267
1301
  # Performs action and waits for a new `Worker`. If predicate is provided, it passes `Worker` value into the `predicate`
1268
1302
  # function and waits for `predicate(worker)` to return a truthy value. Will throw an error if the page is closed before
1269
1303
  # the worker event is fired.
1270
- def expect_worker(predicate: nil, timeout: nil)
1271
- raise NotImplementedError.new('expect_worker is not implemented yet.')
1304
+ def expect_worker(predicate: nil, timeout: nil, &block)
1305
+ wrap_impl(@impl.expect_worker(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
1272
1306
  end
1273
1307
 
1274
1308
  # This method returns all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
@@ -1276,7 +1310,7 @@ module Playwright
1276
1310
  #
1277
1311
  # > NOTE: This does not contain ServiceWorkers
1278
1312
  def workers
1279
- raise NotImplementedError.new('workers is not implemented yet.')
1313
+ wrap_impl(@impl.workers)
1280
1314
  end
1281
1315
 
1282
1316
  # > NOTE: In most cases, you should use [`method: Page.waitForEvent`].
@@ -1318,12 +1352,6 @@ module Playwright
1318
1352
  wrap_impl(@impl.guid)
1319
1353
  end
1320
1354
 
1321
- # -- inherited from EventEmitter --
1322
- # @nodoc
1323
- def off(event, callback)
1324
- event_emitter_proxy.off(event, callback)
1325
- end
1326
-
1327
1355
  # -- inherited from EventEmitter --
1328
1356
  # @nodoc
1329
1357
  def once(event, callback)
@@ -1336,6 +1364,12 @@ module Playwright
1336
1364
  event_emitter_proxy.on(event, callback)
1337
1365
  end
1338
1366
 
1367
+ # -- inherited from EventEmitter --
1368
+ # @nodoc
1369
+ def off(event, callback)
1370
+ event_emitter_proxy.off(event, callback)
1371
+ end
1372
+
1339
1373
  private def event_emitter_proxy
1340
1374
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
1341
1375
  end
@@ -91,12 +91,6 @@ module Playwright
91
91
  wrap_impl(@impl.electron)
92
92
  end
93
93
 
94
- # -- inherited from EventEmitter --
95
- # @nodoc
96
- def off(event, callback)
97
- event_emitter_proxy.off(event, callback)
98
- end
99
-
100
94
  # -- inherited from EventEmitter --
101
95
  # @nodoc
102
96
  def once(event, callback)
@@ -109,6 +103,12 @@ module Playwright
109
103
  event_emitter_proxy.on(event, callback)
110
104
  end
111
105
 
106
+ # -- inherited from EventEmitter --
107
+ # @nodoc
108
+ def off(event, callback)
109
+ event_emitter_proxy.off(event, callback)
110
+ end
111
+
112
112
  private def event_emitter_proxy
113
113
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
114
114
  end
@@ -128,12 +128,6 @@ module Playwright
128
128
  wrap_impl(@impl.url)
129
129
  end
130
130
 
131
- # -- inherited from EventEmitter --
132
- # @nodoc
133
- def off(event, callback)
134
- event_emitter_proxy.off(event, callback)
135
- end
136
-
137
131
  # -- inherited from EventEmitter --
138
132
  # @nodoc
139
133
  def once(event, callback)
@@ -146,6 +140,12 @@ module Playwright
146
140
  event_emitter_proxy.on(event, callback)
147
141
  end
148
142
 
143
+ # -- inherited from EventEmitter --
144
+ # @nodoc
145
+ def off(event, callback)
146
+ event_emitter_proxy.off(event, callback)
147
+ end
148
+
149
149
  private def event_emitter_proxy
150
150
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
151
151
  end
@@ -74,12 +74,6 @@ module Playwright
74
74
  wrap_impl(@impl.ok?)
75
75
  end
76
76
 
77
- # -- inherited from EventEmitter --
78
- # @nodoc
79
- def off(event, callback)
80
- event_emitter_proxy.off(event, callback)
81
- end
82
-
83
77
  # -- inherited from EventEmitter --
84
78
  # @nodoc
85
79
  def once(event, callback)
@@ -92,6 +86,12 @@ module Playwright
92
86
  event_emitter_proxy.on(event, callback)
93
87
  end
94
88
 
89
+ # -- inherited from EventEmitter --
90
+ # @nodoc
91
+ def off(event, callback)
92
+ event_emitter_proxy.off(event, callback)
93
+ end
94
+
95
95
  private def event_emitter_proxy
96
96
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
97
97
  end
@@ -56,12 +56,6 @@ module Playwright
56
56
  wrap_impl(@impl.request)
57
57
  end
58
58
 
59
- # -- inherited from EventEmitter --
60
- # @nodoc
61
- def off(event, callback)
62
- event_emitter_proxy.off(event, callback)
63
- end
64
-
65
59
  # -- inherited from EventEmitter --
66
60
  # @nodoc
67
61
  def once(event, callback)
@@ -74,6 +68,12 @@ module Playwright
74
68
  event_emitter_proxy.on(event, callback)
75
69
  end
76
70
 
71
+ # -- inherited from EventEmitter --
72
+ # @nodoc
73
+ def off(event, callback)
74
+ event_emitter_proxy.off(event, callback)
75
+ end
76
+
77
77
  private def event_emitter_proxy
78
78
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
79
79
  end