playwright-ruby-client 0.8.0 → 1.14.beta2
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.
- checksums.yaml +4 -4
- data/documentation/docs/api/accessibility.md +52 -1
- data/documentation/docs/api/browser.md +8 -2
- data/documentation/docs/api/browser_context.md +28 -0
- data/documentation/docs/api/browser_type.md +1 -0
- data/documentation/docs/api/download.md +97 -0
- data/documentation/docs/api/element_handle.md +28 -3
- data/documentation/docs/api/experimental/android_device.md +1 -0
- data/documentation/docs/api/frame.md +78 -18
- data/documentation/docs/api/keyboard.md +11 -20
- data/documentation/docs/api/locator.md +650 -0
- data/documentation/docs/api/page.md +124 -20
- data/documentation/docs/api/touchscreen.md +8 -0
- data/documentation/docs/api/worker.md +37 -0
- data/documentation/docs/article/guides/inspector.md +31 -0
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +91 -0
- data/documentation/docs/article/guides/semi_automation.md +5 -1
- data/documentation/docs/include/api_coverage.md +72 -15
- data/lib/playwright.rb +0 -1
- data/lib/playwright/accessibility_impl.rb +50 -0
- data/lib/playwright/channel_owners/artifact.rb +4 -0
- data/lib/playwright/channel_owners/browser_context.rb +77 -3
- data/lib/playwright/channel_owners/frame.rb +101 -35
- data/lib/playwright/channel_owners/page.rb +157 -56
- data/lib/playwright/channel_owners/worker.rb +23 -0
- data/lib/playwright/{download.rb → download_impl.rb} +5 -1
- data/lib/playwright/javascript/expression.rb +5 -4
- data/lib/playwright/locator_impl.rb +314 -0
- data/lib/playwright/route_handler_entry.rb +3 -2
- data/lib/playwright/timeout_settings.rb +4 -4
- data/lib/playwright/touchscreen_impl.rb +7 -0
- data/lib/playwright/tracing_impl.rb +9 -8
- data/lib/playwright/url_matcher.rb +12 -2
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/accessibility.rb +1 -1
- data/lib/playwright_api/android.rb +6 -6
- data/lib/playwright_api/android_device.rb +8 -7
- data/lib/playwright_api/browser.rb +16 -10
- data/lib/playwright_api/browser_context.rb +16 -11
- data/lib/playwright_api/browser_type.rb +8 -7
- data/lib/playwright_api/cdp_session.rb +6 -6
- data/lib/playwright_api/console_message.rb +6 -6
- data/lib/playwright_api/dialog.rb +6 -6
- data/lib/playwright_api/download.rb +70 -0
- data/lib/playwright_api/element_handle.rb +34 -20
- data/lib/playwright_api/frame.rb +94 -52
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +509 -0
- data/lib/playwright_api/page.rb +101 -57
- data/lib/playwright_api/playwright.rb +6 -6
- data/lib/playwright_api/request.rb +6 -6
- data/lib/playwright_api/response.rb +6 -6
- data/lib/playwright_api/route.rb +6 -11
- data/lib/playwright_api/selectors.rb +6 -6
- data/lib/playwright_api/touchscreen.rb +1 -1
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/worker.rb +16 -6
- metadata +14 -6
data/lib/playwright_api/page.rb
CHANGED
@@ -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,26 @@ 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(
|
233
|
-
|
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
|
+
sourcePosition: nil,
|
250
|
+
strict: nil,
|
251
|
+
targetPosition: nil,
|
252
|
+
timeout: nil,
|
253
|
+
trial: nil)
|
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)))
|
234
255
|
end
|
235
256
|
|
236
257
|
# This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media
|
@@ -282,8 +303,8 @@ module Playwright
|
|
282
303
|
# ```
|
283
304
|
#
|
284
305
|
# 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)))
|
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)))
|
287
308
|
end
|
288
309
|
|
289
310
|
# The method finds all elements matching the specified selector within the page and passes an array of matched elements as
|
@@ -486,16 +507,17 @@ module Playwright
|
|
486
507
|
value,
|
487
508
|
force: nil,
|
488
509
|
noWaitAfter: nil,
|
510
|
+
strict: nil,
|
489
511
|
timeout: nil)
|
490
|
-
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)))
|
491
513
|
end
|
492
514
|
|
493
515
|
# This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method
|
494
516
|
# waits until a matching element appears in the DOM.
|
495
517
|
#
|
496
518
|
# Shortcut for main frame's [`method: Frame.focus`].
|
497
|
-
def focus(selector, timeout: nil)
|
498
|
-
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)))
|
499
521
|
end
|
500
522
|
|
501
523
|
# Returns frame matching the specified criteria. Either `name` or `url` must be specified.
|
@@ -517,8 +539,8 @@ module Playwright
|
|
517
539
|
end
|
518
540
|
|
519
541
|
# Returns element attribute value.
|
520
|
-
def get_attribute(selector, name, timeout: nil)
|
521
|
-
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)))
|
522
544
|
end
|
523
545
|
|
524
546
|
# Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
|
@@ -578,29 +600,30 @@ module Playwright
|
|
578
600
|
force: nil,
|
579
601
|
modifiers: nil,
|
580
602
|
position: nil,
|
603
|
+
strict: nil,
|
581
604
|
timeout: nil,
|
582
605
|
trial: nil)
|
583
|
-
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)))
|
584
607
|
end
|
585
608
|
|
586
609
|
# Returns `element.innerHTML`.
|
587
|
-
def inner_html(selector, timeout: nil)
|
588
|
-
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)))
|
589
612
|
end
|
590
613
|
|
591
614
|
# Returns `element.innerText`.
|
592
|
-
def inner_text(selector, timeout: nil)
|
593
|
-
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)))
|
594
617
|
end
|
595
618
|
|
596
|
-
# Returns `input.value` for the selected `<input>` or `<textarea>` element. Throws for non-input elements.
|
597
|
-
def input_value(selector, timeout: nil)
|
598
|
-
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)))
|
599
622
|
end
|
600
623
|
|
601
624
|
# Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
602
|
-
def checked?(selector, timeout: nil)
|
603
|
-
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)))
|
604
627
|
end
|
605
628
|
|
606
629
|
# Indicates that the page has been closed.
|
@@ -609,30 +632,41 @@ module Playwright
|
|
609
632
|
end
|
610
633
|
|
611
634
|
# Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
|
612
|
-
def disabled?(selector, timeout: nil)
|
613
|
-
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)))
|
614
637
|
end
|
615
638
|
|
616
639
|
# Returns whether the element is [editable](./actionability.md#editable).
|
617
|
-
def editable?(selector, timeout: nil)
|
618
|
-
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)))
|
619
642
|
end
|
620
643
|
|
621
644
|
# Returns whether the element is [enabled](./actionability.md#enabled).
|
622
|
-
def enabled?(selector, timeout: nil)
|
623
|
-
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)))
|
624
647
|
end
|
625
648
|
|
626
649
|
# Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible). `selector` that does not
|
627
650
|
# match any elements is considered hidden.
|
628
|
-
def hidden?(selector, timeout: nil)
|
629
|
-
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)))
|
630
653
|
end
|
631
654
|
|
632
655
|
# Returns whether the element is [visible](./actionability.md#visible). `selector` that does not match any elements is
|
633
656
|
# considered not visible.
|
634
|
-
def visible?(selector, timeout: nil)
|
635
|
-
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)))
|
636
670
|
end
|
637
671
|
|
638
672
|
# The page's main frame. Page is guaranteed to have a main frame which persists during navigations.
|
@@ -654,7 +688,7 @@ module Playwright
|
|
654
688
|
# > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the
|
655
689
|
# [`method: BrowserType.launch`].
|
656
690
|
def pause
|
657
|
-
|
691
|
+
wrap_impl(@impl.pause)
|
658
692
|
end
|
659
693
|
|
660
694
|
# Returns the PDF buffer.
|
@@ -754,16 +788,17 @@ module Playwright
|
|
754
788
|
key,
|
755
789
|
delay: nil,
|
756
790
|
noWaitAfter: nil,
|
791
|
+
strict: nil,
|
757
792
|
timeout: nil)
|
758
|
-
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)))
|
759
794
|
end
|
760
795
|
|
761
796
|
# The method finds an element matching the specified selector within the page. If no elements match the selector, the
|
762
797
|
# return value resolves to `null`. To wait for an element on the page, use [`method: Page.waitForSelector`].
|
763
798
|
#
|
764
799
|
# Shortcut for main frame's [`method: Frame.querySelector`].
|
765
|
-
def query_selector(selector)
|
766
|
-
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)))
|
767
802
|
end
|
768
803
|
|
769
804
|
# The method finds all elements matching the specified selector within the page. If no elements match the selector, the
|
@@ -867,8 +902,9 @@ module Playwright
|
|
867
902
|
label: nil,
|
868
903
|
force: nil,
|
869
904
|
noWaitAfter: nil,
|
905
|
+
strict: nil,
|
870
906
|
timeout: nil)
|
871
|
-
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)))
|
872
908
|
end
|
873
909
|
|
874
910
|
def set_content(html, timeout: nil, waitUntil: nil)
|
@@ -913,8 +949,13 @@ module Playwright
|
|
913
949
|
#
|
914
950
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
915
951
|
# are resolved relative to the the current working directory. For empty array, clears the selected files.
|
916
|
-
def set_input_files(
|
917
|
-
|
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)))
|
918
959
|
end
|
919
960
|
|
920
961
|
# In the case of multiple pages in a single browser, each page can have its own viewport size. However,
|
@@ -953,14 +994,15 @@ module Playwright
|
|
953
994
|
modifiers: nil,
|
954
995
|
noWaitAfter: nil,
|
955
996
|
position: nil,
|
997
|
+
strict: nil,
|
956
998
|
timeout: nil,
|
957
999
|
trial: nil)
|
958
|
-
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)))
|
959
1001
|
end
|
960
1002
|
|
961
1003
|
# Returns `element.textContent`.
|
962
|
-
def text_content(selector, timeout: nil)
|
963
|
-
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)))
|
964
1006
|
end
|
965
1007
|
|
966
1008
|
# Returns the page's title. Shortcut for main frame's [`method: Frame.title`].
|
@@ -984,8 +1026,9 @@ module Playwright
|
|
984
1026
|
text,
|
985
1027
|
delay: nil,
|
986
1028
|
noWaitAfter: nil,
|
1029
|
+
strict: nil,
|
987
1030
|
timeout: nil)
|
988
|
-
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)))
|
989
1032
|
end
|
990
1033
|
|
991
1034
|
# This method unchecks an element matching `selector` by performing the following steps:
|
@@ -1008,9 +1051,10 @@ module Playwright
|
|
1008
1051
|
force: nil,
|
1009
1052
|
noWaitAfter: nil,
|
1010
1053
|
position: nil,
|
1054
|
+
strict: nil,
|
1011
1055
|
timeout: nil,
|
1012
1056
|
trial: nil)
|
1013
|
-
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)))
|
1014
1058
|
end
|
1015
1059
|
|
1016
1060
|
# Removes a route created with [`method: Page.route`]. When `handler` is not specified, removes all routes for the `url`.
|
@@ -1149,7 +1193,7 @@ module Playwright
|
|
1149
1193
|
wrap_impl(@impl.expect_popup(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
1150
1194
|
end
|
1151
1195
|
|
1152
|
-
# Waits for the matching request and returns it.
|
1196
|
+
# Waits for the matching request and returns it. See [waiting for event](./events.md#waiting-for-event) for more details
|
1153
1197
|
# about events.
|
1154
1198
|
#
|
1155
1199
|
# ```python sync
|
@@ -1216,8 +1260,8 @@ module Playwright
|
|
1216
1260
|
# with sync_playwright() as playwright:
|
1217
1261
|
# run(playwright)
|
1218
1262
|
# ```
|
1219
|
-
def wait_for_selector(selector, state: nil, timeout: nil)
|
1220
|
-
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)))
|
1221
1265
|
end
|
1222
1266
|
|
1223
1267
|
# Waits for the given `timeout` in milliseconds.
|
@@ -1232,7 +1276,7 @@ module Playwright
|
|
1232
1276
|
#
|
1233
1277
|
# Shortcut for main frame's [`method: Frame.waitForTimeout`].
|
1234
1278
|
def wait_for_timeout(timeout)
|
1235
|
-
|
1279
|
+
wrap_impl(@impl.wait_for_timeout(unwrap_impl(timeout)))
|
1236
1280
|
end
|
1237
1281
|
|
1238
1282
|
# Waits for the main frame to navigate to the given URL.
|
@@ -1257,8 +1301,8 @@ module Playwright
|
|
1257
1301
|
# Performs action and waits for a new `Worker`. If predicate is provided, it passes `Worker` value into the `predicate`
|
1258
1302
|
# function and waits for `predicate(worker)` to return a truthy value. Will throw an error if the page is closed before
|
1259
1303
|
# the worker event is fired.
|
1260
|
-
def expect_worker(predicate: nil, timeout: nil)
|
1261
|
-
|
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)))
|
1262
1306
|
end
|
1263
1307
|
|
1264
1308
|
# This method returns all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
|
@@ -1266,7 +1310,7 @@ module Playwright
|
|
1266
1310
|
#
|
1267
1311
|
# > NOTE: This does not contain ServiceWorkers
|
1268
1312
|
def workers
|
1269
|
-
|
1313
|
+
wrap_impl(@impl.workers)
|
1270
1314
|
end
|
1271
1315
|
|
1272
1316
|
# > NOTE: In most cases, you should use [`method: Page.waitForEvent`].
|
@@ -1308,12 +1352,6 @@ module Playwright
|
|
1308
1352
|
wrap_impl(@impl.guid)
|
1309
1353
|
end
|
1310
1354
|
|
1311
|
-
# -- inherited from EventEmitter --
|
1312
|
-
# @nodoc
|
1313
|
-
def off(event, callback)
|
1314
|
-
event_emitter_proxy.off(event, callback)
|
1315
|
-
end
|
1316
|
-
|
1317
1355
|
# -- inherited from EventEmitter --
|
1318
1356
|
# @nodoc
|
1319
1357
|
def once(event, callback)
|
@@ -1326,6 +1364,12 @@ module Playwright
|
|
1326
1364
|
event_emitter_proxy.on(event, callback)
|
1327
1365
|
end
|
1328
1366
|
|
1367
|
+
# -- inherited from EventEmitter --
|
1368
|
+
# @nodoc
|
1369
|
+
def off(event, callback)
|
1370
|
+
event_emitter_proxy.off(event, callback)
|
1371
|
+
end
|
1372
|
+
|
1329
1373
|
private def event_emitter_proxy
|
1330
1374
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
1331
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
|
data/lib/playwright_api/route.rb
CHANGED
@@ -51,22 +51,11 @@ module Playwright
|
|
51
51
|
wrap_impl(@impl.fulfill(body: unwrap_impl(body), contentType: unwrap_impl(contentType), headers: unwrap_impl(headers), path: unwrap_impl(path), status: unwrap_impl(status)))
|
52
52
|
end
|
53
53
|
|
54
|
-
# Continues route's request with optional overrides and intercepts response.
|
55
|
-
def intercept(headers: nil, method: nil, postData: nil, url: nil)
|
56
|
-
raise NotImplementedError.new('intercept is not implemented yet.')
|
57
|
-
end
|
58
|
-
|
59
54
|
# A request to be routed.
|
60
55
|
def request
|
61
56
|
wrap_impl(@impl.request)
|
62
57
|
end
|
63
58
|
|
64
|
-
# -- inherited from EventEmitter --
|
65
|
-
# @nodoc
|
66
|
-
def off(event, callback)
|
67
|
-
event_emitter_proxy.off(event, callback)
|
68
|
-
end
|
69
|
-
|
70
59
|
# -- inherited from EventEmitter --
|
71
60
|
# @nodoc
|
72
61
|
def once(event, callback)
|
@@ -79,6 +68,12 @@ module Playwright
|
|
79
68
|
event_emitter_proxy.on(event, callback)
|
80
69
|
end
|
81
70
|
|
71
|
+
# -- inherited from EventEmitter --
|
72
|
+
# @nodoc
|
73
|
+
def off(event, callback)
|
74
|
+
event_emitter_proxy.off(event, callback)
|
75
|
+
end
|
76
|
+
|
82
77
|
private def event_emitter_proxy
|
83
78
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
84
79
|
end
|