playwright-ruby-client 0.7.1 → 1.14.beta1

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -0
  3. data/documentation/docs/api/accessibility.md +52 -1
  4. data/documentation/docs/api/browser.md +8 -2
  5. data/documentation/docs/api/browser_context.md +28 -0
  6. data/documentation/docs/api/browser_type.md +1 -0
  7. data/documentation/docs/api/download.md +97 -0
  8. data/documentation/docs/api/element_handle.md +38 -4
  9. data/documentation/docs/api/experimental/android_device.md +1 -0
  10. data/documentation/docs/api/frame.md +89 -17
  11. data/documentation/docs/api/keyboard.md +11 -20
  12. data/documentation/docs/api/locator.md +650 -0
  13. data/documentation/docs/api/page.md +135 -19
  14. data/documentation/docs/api/response.md +16 -0
  15. data/documentation/docs/api/touchscreen.md +8 -0
  16. data/documentation/docs/api/worker.md +37 -0
  17. data/documentation/docs/article/guides/inspector.md +31 -0
  18. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +91 -0
  19. data/documentation/docs/article/guides/semi_automation.md +5 -1
  20. data/documentation/docs/include/api_coverage.md +77 -14
  21. data/lib/playwright.rb +36 -4
  22. data/lib/playwright/accessibility_impl.rb +50 -0
  23. data/lib/playwright/channel_owners/artifact.rb +4 -0
  24. data/lib/playwright/channel_owners/browser_context.rb +77 -3
  25. data/lib/playwright/channel_owners/element_handle.rb +11 -4
  26. data/lib/playwright/channel_owners/frame.rb +107 -34
  27. data/lib/playwright/channel_owners/page.rb +163 -55
  28. data/lib/playwright/channel_owners/response.rb +8 -0
  29. data/lib/playwright/channel_owners/worker.rb +23 -0
  30. data/lib/playwright/connection.rb +2 -4
  31. data/lib/playwright/{download.rb → download_impl.rb} +5 -1
  32. data/lib/playwright/javascript/expression.rb +5 -4
  33. data/lib/playwright/locator_impl.rb +314 -0
  34. data/lib/playwright/route_handler_entry.rb +3 -2
  35. data/lib/playwright/timeout_settings.rb +4 -4
  36. data/lib/playwright/touchscreen_impl.rb +7 -0
  37. data/lib/playwright/transport.rb +0 -1
  38. data/lib/playwright/url_matcher.rb +12 -2
  39. data/lib/playwright/version.rb +2 -2
  40. data/lib/playwright/web_socket_client.rb +164 -0
  41. data/lib/playwright/web_socket_transport.rb +104 -0
  42. data/lib/playwright_api/accessibility.rb +1 -1
  43. data/lib/playwright_api/android_device.rb +6 -5
  44. data/lib/playwright_api/browser.rb +10 -4
  45. data/lib/playwright_api/browser_context.rb +12 -7
  46. data/lib/playwright_api/browser_type.rb +2 -1
  47. data/lib/playwright_api/cdp_session.rb +6 -6
  48. data/lib/playwright_api/download.rb +70 -0
  49. data/lib/playwright_api/element_handle.rb +38 -18
  50. data/lib/playwright_api/frame.rb +95 -44
  51. data/lib/playwright_api/locator.rb +509 -0
  52. data/lib/playwright_api/page.rb +102 -49
  53. data/lib/playwright_api/response.rb +10 -0
  54. data/lib/playwright_api/touchscreen.rb +1 -1
  55. data/lib/playwright_api/worker.rb +13 -3
  56. metadata +17 -7
@@ -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,24 @@ 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)))
242
+ end
243
+
244
+ def drag_and_drop(
245
+ source,
246
+ target,
247
+ force: nil,
248
+ noWaitAfter: nil,
249
+ strict: nil,
250
+ timeout: nil,
251
+ trial: nil)
252
+ wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
234
253
  end
235
254
 
236
255
  # This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media
@@ -282,8 +301,8 @@ module Playwright
282
301
  # ```
283
302
  #
284
303
  # Shortcut for main frame's [`method: Frame.evalOnSelector`].
285
- def eval_on_selector(selector, expression, arg: nil)
286
- wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg)))
304
+ def eval_on_selector(selector, expression, arg: nil, strict: nil)
305
+ wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg), strict: unwrap_impl(strict)))
287
306
  end
288
307
 
289
308
  # The method finds all elements matching the specified selector within the page and passes an array of matched elements as
@@ -481,16 +500,22 @@ module Playwright
481
500
  # To send fine-grained keyboard events, use [`method: Page.type`].
482
501
  #
483
502
  # Shortcut for main frame's [`method: Frame.fill`].
484
- def fill(selector, value, noWaitAfter: nil, timeout: nil)
485
- wrap_impl(@impl.fill(unwrap_impl(selector), unwrap_impl(value), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
503
+ def fill(
504
+ selector,
505
+ value,
506
+ force: nil,
507
+ noWaitAfter: nil,
508
+ strict: nil,
509
+ timeout: nil)
510
+ 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)))
486
511
  end
487
512
 
488
513
  # This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method
489
514
  # waits until a matching element appears in the DOM.
490
515
  #
491
516
  # Shortcut for main frame's [`method: Frame.focus`].
492
- def focus(selector, timeout: nil)
493
- wrap_impl(@impl.focus(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
517
+ def focus(selector, strict: nil, timeout: nil)
518
+ wrap_impl(@impl.focus(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
494
519
  end
495
520
 
496
521
  # Returns frame matching the specified criteria. Either `name` or `url` must be specified.
@@ -512,8 +537,8 @@ module Playwright
512
537
  end
513
538
 
514
539
  # Returns element attribute value.
515
- def get_attribute(selector, name, timeout: nil)
516
- wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), timeout: unwrap_impl(timeout)))
540
+ def get_attribute(selector, name, strict: nil, timeout: nil)
541
+ wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
517
542
  end
518
543
 
519
544
  # Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
@@ -573,24 +598,30 @@ module Playwright
573
598
  force: nil,
574
599
  modifiers: nil,
575
600
  position: nil,
601
+ strict: nil,
576
602
  timeout: nil,
577
603
  trial: nil)
578
- 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)))
604
+ 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)))
579
605
  end
580
606
 
581
607
  # Returns `element.innerHTML`.
582
- def inner_html(selector, timeout: nil)
583
- wrap_impl(@impl.inner_html(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
608
+ def inner_html(selector, strict: nil, timeout: nil)
609
+ wrap_impl(@impl.inner_html(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
584
610
  end
585
611
 
586
612
  # Returns `element.innerText`.
587
- def inner_text(selector, timeout: nil)
588
- wrap_impl(@impl.inner_text(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
613
+ def inner_text(selector, strict: nil, timeout: nil)
614
+ wrap_impl(@impl.inner_text(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
615
+ end
616
+
617
+ # Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
618
+ def input_value(selector, strict: nil, timeout: nil)
619
+ wrap_impl(@impl.input_value(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
589
620
  end
590
621
 
591
622
  # Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
592
- def checked?(selector, timeout: nil)
593
- wrap_impl(@impl.checked?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
623
+ def checked?(selector, strict: nil, timeout: nil)
624
+ wrap_impl(@impl.checked?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
594
625
  end
595
626
 
596
627
  # Indicates that the page has been closed.
@@ -599,30 +630,41 @@ module Playwright
599
630
  end
600
631
 
601
632
  # Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
602
- def disabled?(selector, timeout: nil)
603
- wrap_impl(@impl.disabled?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
633
+ def disabled?(selector, strict: nil, timeout: nil)
634
+ wrap_impl(@impl.disabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
604
635
  end
605
636
 
606
637
  # Returns whether the element is [editable](./actionability.md#editable).
607
- def editable?(selector, timeout: nil)
608
- wrap_impl(@impl.editable?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
638
+ def editable?(selector, strict: nil, timeout: nil)
639
+ wrap_impl(@impl.editable?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
609
640
  end
610
641
 
611
642
  # Returns whether the element is [enabled](./actionability.md#enabled).
612
- def enabled?(selector, timeout: nil)
613
- wrap_impl(@impl.enabled?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
643
+ def enabled?(selector, strict: nil, timeout: nil)
644
+ wrap_impl(@impl.enabled?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
614
645
  end
615
646
 
616
647
  # Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
617
648
  # match any elements is considered hidden.
618
- def hidden?(selector, timeout: nil)
619
- wrap_impl(@impl.hidden?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
649
+ def hidden?(selector, strict: nil, timeout: nil)
650
+ wrap_impl(@impl.hidden?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
620
651
  end
621
652
 
622
653
  # Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
623
654
  # considered not visible.
624
- def visible?(selector, timeout: nil)
625
- wrap_impl(@impl.visible?(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
655
+ def visible?(selector, strict: nil, timeout: nil)
656
+ wrap_impl(@impl.visible?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
657
+ end
658
+
659
+ # The method returns an element locator that can be used to perform actions on the page. Locator is resolved to the
660
+ # element immediately before performing an action, so a series of actions on the same locator can in fact be performed on
661
+ # different DOM elements. That would happen if the DOM structure between those actions has changed.
662
+ #
663
+ # Note that locator always implies visibility, so it will always be locating visible elements.
664
+ #
665
+ # Shortcut for main frame's [`method: Frame.locator`].
666
+ def locator(selector)
667
+ wrap_impl(@impl.locator(unwrap_impl(selector)))
626
668
  end
627
669
 
628
670
  # The page's main frame. Page is guaranteed to have a main frame which persists during navigations.
@@ -644,7 +686,7 @@ module Playwright
644
686
  # > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the
645
687
  # [`method: BrowserType.launch`].
646
688
  def pause
647
- raise NotImplementedError.new('pause is not implemented yet.')
689
+ wrap_impl(@impl.pause)
648
690
  end
649
691
 
650
692
  # Returns the PDF buffer.
@@ -744,16 +786,17 @@ module Playwright
744
786
  key,
745
787
  delay: nil,
746
788
  noWaitAfter: nil,
789
+ strict: nil,
747
790
  timeout: nil)
748
- wrap_impl(@impl.press(unwrap_impl(selector), unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
791
+ 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)))
749
792
  end
750
793
 
751
794
  # The method finds an element matching the specified selector within the page. If no elements match the selector, the
752
795
  # return value resolves to `null`. To wait for an element on the page, use [`method: Page.waitForSelector`].
753
796
  #
754
797
  # Shortcut for main frame's [`method: Frame.querySelector`].
755
- def query_selector(selector)
756
- wrap_impl(@impl.query_selector(unwrap_impl(selector)))
798
+ def query_selector(selector, strict: nil)
799
+ wrap_impl(@impl.query_selector(unwrap_impl(selector), strict: unwrap_impl(strict)))
757
800
  end
758
801
 
759
802
  # The method finds all elements matching the specified selector within the page. If no elements match the selector, the
@@ -855,9 +898,11 @@ module Playwright
855
898
  index: nil,
856
899
  value: nil,
857
900
  label: nil,
901
+ force: nil,
858
902
  noWaitAfter: nil,
903
+ strict: nil,
859
904
  timeout: nil)
860
- wrap_impl(@impl.select_option(unwrap_impl(selector), element: unwrap_impl(element), index: unwrap_impl(index), value: unwrap_impl(value), label: unwrap_impl(label), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
905
+ 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)))
861
906
  end
862
907
 
863
908
  def set_content(html, timeout: nil, waitUntil: nil)
@@ -902,8 +947,13 @@ module Playwright
902
947
  #
903
948
  # Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
904
949
  # are resolved relative to the the current working directory. For empty array, clears the selected files.
905
- def set_input_files(selector, files, noWaitAfter: nil, timeout: nil)
906
- wrap_impl(@impl.set_input_files(unwrap_impl(selector), unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
950
+ def set_input_files(
951
+ selector,
952
+ files,
953
+ noWaitAfter: nil,
954
+ strict: nil,
955
+ timeout: nil)
956
+ wrap_impl(@impl.set_input_files(unwrap_impl(selector), unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
907
957
  end
908
958
 
909
959
  # In the case of multiple pages in a single browser, each page can have its own viewport size. However,
@@ -942,14 +992,15 @@ module Playwright
942
992
  modifiers: nil,
943
993
  noWaitAfter: nil,
944
994
  position: nil,
995
+ strict: nil,
945
996
  timeout: nil,
946
997
  trial: nil)
947
- 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)))
998
+ 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)))
948
999
  end
949
1000
 
950
1001
  # Returns `element.textContent`.
951
- def text_content(selector, timeout: nil)
952
- wrap_impl(@impl.text_content(unwrap_impl(selector), timeout: unwrap_impl(timeout)))
1002
+ def text_content(selector, strict: nil, timeout: nil)
1003
+ wrap_impl(@impl.text_content(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
953
1004
  end
954
1005
 
955
1006
  # Returns the page's title. Shortcut for main frame's [`method: Frame.title`].
@@ -973,8 +1024,9 @@ module Playwright
973
1024
  text,
974
1025
  delay: nil,
975
1026
  noWaitAfter: nil,
1027
+ strict: nil,
976
1028
  timeout: nil)
977
- wrap_impl(@impl.type(unwrap_impl(selector), unwrap_impl(text), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
1029
+ 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)))
978
1030
  end
979
1031
 
980
1032
  # This method unchecks an element matching `selector` by performing the following steps:
@@ -997,9 +1049,10 @@ module Playwright
997
1049
  force: nil,
998
1050
  noWaitAfter: nil,
999
1051
  position: nil,
1052
+ strict: nil,
1000
1053
  timeout: nil,
1001
1054
  trial: nil)
1002
- 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)))
1055
+ 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)))
1003
1056
  end
1004
1057
 
1005
1058
  # Removes a route created with [`method: Page.route`]. When `handler` is not specified, removes all routes for the `url`.
@@ -1138,7 +1191,7 @@ module Playwright
1138
1191
  wrap_impl(@impl.expect_popup(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
1139
1192
  end
1140
1193
 
1141
- # Waits for the matching request and returns it. See [waiting for event](./events.md#waiting-for-event) for more details
1194
+ # Waits for the matching request and returns it. See [waiting for event](./events.md#waiting-for-event) for more details
1142
1195
  # about events.
1143
1196
  #
1144
1197
  # ```python sync
@@ -1205,8 +1258,8 @@ module Playwright
1205
1258
  # with sync_playwright() as playwright:
1206
1259
  # run(playwright)
1207
1260
  # ```
1208
- def wait_for_selector(selector, state: nil, timeout: nil)
1209
- wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
1261
+ def wait_for_selector(selector, state: nil, strict: nil, timeout: nil)
1262
+ wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
1210
1263
  end
1211
1264
 
1212
1265
  # Waits for the given `timeout` in milliseconds.
@@ -1221,7 +1274,7 @@ module Playwright
1221
1274
  #
1222
1275
  # Shortcut for main frame's [`method: Frame.waitForTimeout`].
1223
1276
  def wait_for_timeout(timeout)
1224
- raise NotImplementedError.new('wait_for_timeout is not implemented yet.')
1277
+ wrap_impl(@impl.wait_for_timeout(unwrap_impl(timeout)))
1225
1278
  end
1226
1279
 
1227
1280
  # Waits for the main frame to navigate to the given URL.
@@ -1246,8 +1299,8 @@ module Playwright
1246
1299
  # Performs action and waits for a new `Worker`. If predicate is provided, it passes `Worker` value into the `predicate`
1247
1300
  # function and waits for `predicate(worker)` to return a truthy value. Will throw an error if the page is closed before
1248
1301
  # the worker event is fired.
1249
- def expect_worker(predicate: nil, timeout: nil)
1250
- raise NotImplementedError.new('expect_worker is not implemented yet.')
1302
+ def expect_worker(predicate: nil, timeout: nil, &block)
1303
+ wrap_impl(@impl.expect_worker(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
1251
1304
  end
1252
1305
 
1253
1306
  # This method returns all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
@@ -1255,7 +1308,7 @@ module Playwright
1255
1308
  #
1256
1309
  # > NOTE: This does not contain ServiceWorkers
1257
1310
  def workers
1258
- raise NotImplementedError.new('workers is not implemented yet.')
1311
+ wrap_impl(@impl.workers)
1259
1312
  end
1260
1313
 
1261
1314
  # > NOTE: In most cases, you should use [`method: Page.waitForEvent`].
@@ -39,6 +39,16 @@ module Playwright
39
39
  wrap_impl(@impl.request)
40
40
  end
41
41
 
42
+ # Returns SSL and other security information.
43
+ def security_details
44
+ wrap_impl(@impl.security_details)
45
+ end
46
+
47
+ # Returns the IP address and port of the server.
48
+ def server_addr
49
+ wrap_impl(@impl.server_addr)
50
+ end
51
+
42
52
  # Contains the status code of the response (e.g., 200 for a success).
43
53
  def status
44
54
  wrap_impl(@impl.status)
@@ -5,7 +5,7 @@ module Playwright
5
5
 
6
6
  # Dispatches a `touchstart` and `touchend` event with a single touch at the position (`x`,`y`).
7
7
  def tap_point(x, y)
8
- raise NotImplementedError.new('tap_point is not implemented yet.')
8
+ wrap_impl(@impl.tap_point(unwrap_impl(x), unwrap_impl(y)))
9
9
  end
10
10
  end
11
11
  end
@@ -25,7 +25,7 @@ module Playwright
25
25
  # [`method: Worker.evaluate`] returns `undefined`. Playwright also supports transferring some additional values that are
26
26
  # not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
27
27
  def evaluate(expression, arg: nil)
28
- raise NotImplementedError.new('evaluate is not implemented yet.')
28
+ wrap_impl(@impl.evaluate(unwrap_impl(expression), arg: unwrap_impl(arg)))
29
29
  end
30
30
 
31
31
  # Returns the return value of `expression` as a `JSHandle`.
@@ -36,11 +36,21 @@ module Playwright
36
36
  # If the function passed to the [`method: Worker.evaluateHandle`] returns a [Promise], then
37
37
  # [`method: Worker.evaluateHandle`] would wait for the promise to resolve and return its value.
38
38
  def evaluate_handle(expression, arg: nil)
39
- raise NotImplementedError.new('evaluate_handle is not implemented yet.')
39
+ wrap_impl(@impl.evaluate_handle(unwrap_impl(expression), arg: unwrap_impl(arg)))
40
40
  end
41
41
 
42
42
  def url
43
- raise NotImplementedError.new('url is not implemented yet.')
43
+ wrap_impl(@impl.url)
44
+ end
45
+
46
+ # @nodoc
47
+ def context=(req)
48
+ wrap_impl(@impl.context=(unwrap_impl(req)))
49
+ end
50
+
51
+ # @nodoc
52
+ def page=(req)
53
+ wrap_impl(@impl.page=(unwrap_impl(req)))
44
54
  end
45
55
 
46
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: 0.7.1
4
+ version: 1.14.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2021-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -216,6 +216,7 @@ files:
216
216
  - documentation/docs/api/cdp_session.md
217
217
  - documentation/docs/api/console_message.md
218
218
  - documentation/docs/api/dialog.md
219
+ - documentation/docs/api/download.md
219
220
  - documentation/docs/api/element_handle.md
220
221
  - documentation/docs/api/experimental/_category_.yml
221
222
  - documentation/docs/api/experimental/android.md
@@ -227,6 +228,7 @@ files:
227
228
  - documentation/docs/api/frame.md
228
229
  - documentation/docs/api/js_handle.md
229
230
  - documentation/docs/api/keyboard.md
231
+ - documentation/docs/api/locator.md
230
232
  - documentation/docs/api/mouse.md
231
233
  - documentation/docs/api/page.md
232
234
  - documentation/docs/api/playwright.md
@@ -242,7 +244,9 @@ files:
242
244
  - documentation/docs/article/getting_started.md
243
245
  - documentation/docs/article/guides/_category_.yml
244
246
  - documentation/docs/article/guides/download_playwright_driver.md
247
+ - documentation/docs/article/guides/inspector.md
245
248
  - documentation/docs/article/guides/launch_browser.md
249
+ - documentation/docs/article/guides/playwright_on_alpine_linux.md
246
250
  - documentation/docs/article/guides/rails_integration.md
247
251
  - documentation/docs/article/guides/recording_video.md
248
252
  - documentation/docs/article/guides/semi_automation.md
@@ -263,6 +267,7 @@ files:
263
267
  - documentation/static/img/undraw_windows.svg
264
268
  - documentation/yarn.lock
265
269
  - lib/playwright.rb
270
+ - lib/playwright/accessibility_impl.rb
266
271
  - lib/playwright/android_input_impl.rb
267
272
  - lib/playwright/api_implementation.rb
268
273
  - lib/playwright/channel.rb
@@ -291,7 +296,7 @@ files:
291
296
  - lib/playwright/channel_owners/web_socket.rb
292
297
  - lib/playwright/channel_owners/worker.rb
293
298
  - lib/playwright/connection.rb
294
- - lib/playwright/download.rb
299
+ - lib/playwright/download_impl.rb
295
300
  - lib/playwright/errors.rb
296
301
  - lib/playwright/event_emitter.rb
297
302
  - lib/playwright/event_emitter_proxy.rb
@@ -304,6 +309,7 @@ files:
304
309
  - lib/playwright/javascript/value_parser.rb
305
310
  - lib/playwright/javascript/value_serializer.rb
306
311
  - lib/playwright/keyboard_impl.rb
312
+ - lib/playwright/locator_impl.rb
307
313
  - lib/playwright/mouse_impl.rb
308
314
  - lib/playwright/playwright_api.rb
309
315
  - lib/playwright/route_handler_entry.rb
@@ -317,6 +323,8 @@ files:
317
323
  - lib/playwright/version.rb
318
324
  - lib/playwright/video.rb
319
325
  - lib/playwright/wait_helper.rb
326
+ - lib/playwright/web_socket_client.rb
327
+ - lib/playwright/web_socket_transport.rb
320
328
  - lib/playwright_api/accessibility.rb
321
329
  - lib/playwright_api/android.rb
322
330
  - lib/playwright_api/android_device.rb
@@ -329,11 +337,13 @@ files:
329
337
  - lib/playwright_api/cdp_session.rb
330
338
  - lib/playwright_api/console_message.rb
331
339
  - lib/playwright_api/dialog.rb
340
+ - lib/playwright_api/download.rb
332
341
  - lib/playwright_api/element_handle.rb
333
342
  - lib/playwright_api/file_chooser.rb
334
343
  - lib/playwright_api/frame.rb
335
344
  - lib/playwright_api/js_handle.rb
336
345
  - lib/playwright_api/keyboard.rb
346
+ - lib/playwright_api/locator.rb
337
347
  - lib/playwright_api/mouse.rb
338
348
  - lib/playwright_api/page.rb
339
349
  - lib/playwright_api/playwright.rb
@@ -361,12 +371,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
361
371
  version: '2.4'
362
372
  required_rubygems_version: !ruby/object:Gem::Requirement
363
373
  requirements:
364
- - - ">="
374
+ - - ">"
365
375
  - !ruby/object:Gem::Version
366
- version: '0'
376
+ version: 1.3.1
367
377
  requirements: []
368
- rubygems_version: 3.2.15
378
+ rubygems_version: 3.2.22
369
379
  signing_key:
370
380
  specification_version: 4
371
- summary: The Ruby binding of playwright driver 1.12.0
381
+ summary: The Ruby binding of playwright driver 1.14.0
372
382
  test_files: []