playwright-ruby-client 0.7.0 → 0.9.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.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/documentation/docs/api/browser.md +18 -2
- data/documentation/docs/api/browser_context.md +10 -0
- data/documentation/docs/api/browser_type.md +1 -0
- data/documentation/docs/api/cdp_session.md +41 -1
- data/documentation/docs/api/download.md +97 -0
- data/documentation/docs/api/element_handle.md +38 -4
- data/documentation/docs/api/experimental/android_device.md +1 -0
- data/documentation/docs/api/frame.md +78 -17
- data/documentation/docs/api/keyboard.md +11 -20
- data/documentation/docs/api/locator.md +650 -0
- data/documentation/docs/api/page.md +107 -19
- data/documentation/docs/api/response.md +16 -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/rails_integration.md +1 -1
- data/documentation/docs/article/guides/semi_automation.md +5 -1
- data/documentation/docs/include/api_coverage.md +70 -7
- data/lib/playwright.rb +36 -4
- data/lib/playwright/channel_owners/artifact.rb +4 -0
- data/lib/playwright/channel_owners/browser.rb +5 -0
- data/lib/playwright/channel_owners/browser_context.rb +37 -3
- data/lib/playwright/channel_owners/cdp_session.rb +19 -0
- data/lib/playwright/channel_owners/element_handle.rb +11 -4
- data/lib/playwright/channel_owners/frame.rb +103 -34
- data/lib/playwright/channel_owners/page.rb +140 -53
- data/lib/playwright/channel_owners/response.rb +9 -1
- data/lib/playwright/connection.rb +2 -4
- 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/transport.rb +0 -1
- data/lib/playwright/url_matcher.rb +12 -2
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright/web_socket_client.rb +164 -0
- data/lib/playwright/web_socket_transport.rb +104 -0
- data/lib/playwright_api/android.rb +6 -6
- data/lib/playwright_api/android_device.rb +10 -9
- data/lib/playwright_api/browser.rb +17 -11
- data/lib/playwright_api/browser_context.rb +14 -9
- data/lib/playwright_api/browser_type.rb +8 -7
- data/lib/playwright_api/cdp_session.rb +30 -8
- 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 +44 -24
- data/lib/playwright_api/frame.rb +100 -49
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +509 -0
- data/lib/playwright_api/page.rb +110 -57
- data/lib/playwright_api/playwright.rb +6 -6
- data/lib/playwright_api/request.rb +6 -6
- data/lib/playwright_api/response.rb +15 -10
- data/lib/playwright_api/route.rb +6 -6
- data/lib/playwright_api/selectors.rb +6 -6
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/worker.rb +6 -6
- metadata +15 -5
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,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(
|
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
|
+
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(
|
485
|
-
|
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
|
-
|
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(
|
906
|
-
|
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.
|
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
|
@@ -1158,8 +1211,8 @@ module Playwright
|
|
1158
1211
|
# Performs action and waits for a `Request` to finish loading. If predicate is provided, it passes `Request` value into
|
1159
1212
|
# the `predicate` function and waits for `predicate(request)` to return a truthy value. Will throw an error if the page is
|
1160
1213
|
# closed before the [`event: Page.requestFinished`] event is fired.
|
1161
|
-
def expect_request_finished(predicate: nil, timeout: nil)
|
1162
|
-
|
1214
|
+
def expect_request_finished(predicate: nil, timeout: nil, &block)
|
1215
|
+
wrap_impl(@impl.expect_request_finished(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
1163
1216
|
end
|
1164
1217
|
|
1165
1218
|
# Returns the matched response. See [waiting for event](./events.md#waiting-for-event) for more details about events.
|
@@ -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.
|
@@ -1272,6 +1325,11 @@ module Playwright
|
|
1272
1325
|
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
1273
1326
|
end
|
1274
1327
|
|
1328
|
+
# @nodoc
|
1329
|
+
def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
1330
|
+
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
1331
|
+
end
|
1332
|
+
|
1275
1333
|
# @nodoc
|
1276
1334
|
def stop_js_coverage
|
1277
1335
|
wrap_impl(@impl.stop_js_coverage)
|
@@ -1288,13 +1346,14 @@ module Playwright
|
|
1288
1346
|
end
|
1289
1347
|
|
1290
1348
|
# @nodoc
|
1291
|
-
def
|
1292
|
-
wrap_impl(@impl.
|
1349
|
+
def guid
|
1350
|
+
wrap_impl(@impl.guid)
|
1293
1351
|
end
|
1294
1352
|
|
1353
|
+
# -- inherited from EventEmitter --
|
1295
1354
|
# @nodoc
|
1296
|
-
def
|
1297
|
-
|
1355
|
+
def once(event, callback)
|
1356
|
+
event_emitter_proxy.once(event, callback)
|
1298
1357
|
end
|
1299
1358
|
|
1300
1359
|
# -- inherited from EventEmitter --
|
@@ -1309,12 +1368,6 @@ module Playwright
|
|
1309
1368
|
event_emitter_proxy.off(event, callback)
|
1310
1369
|
end
|
1311
1370
|
|
1312
|
-
# -- inherited from EventEmitter --
|
1313
|
-
# @nodoc
|
1314
|
-
def once(event, callback)
|
1315
|
-
event_emitter_proxy.once(event, callback)
|
1316
|
-
end
|
1317
|
-
|
1318
1371
|
private def event_emitter_proxy
|
1319
1372
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
1320
1373
|
end
|
@@ -93,20 +93,20 @@ module Playwright
|
|
93
93
|
|
94
94
|
# -- inherited from EventEmitter --
|
95
95
|
# @nodoc
|
96
|
-
def
|
97
|
-
event_emitter_proxy.
|
96
|
+
def once(event, callback)
|
97
|
+
event_emitter_proxy.once(event, callback)
|
98
98
|
end
|
99
99
|
|
100
100
|
# -- inherited from EventEmitter --
|
101
101
|
# @nodoc
|
102
|
-
def
|
103
|
-
event_emitter_proxy.
|
102
|
+
def on(event, callback)
|
103
|
+
event_emitter_proxy.on(event, callback)
|
104
104
|
end
|
105
105
|
|
106
106
|
# -- inherited from EventEmitter --
|
107
107
|
# @nodoc
|
108
|
-
def
|
109
|
-
event_emitter_proxy.
|
108
|
+
def off(event, callback)
|
109
|
+
event_emitter_proxy.off(event, callback)
|
110
110
|
end
|
111
111
|
|
112
112
|
private def event_emitter_proxy
|
@@ -130,20 +130,20 @@ module Playwright
|
|
130
130
|
|
131
131
|
# -- inherited from EventEmitter --
|
132
132
|
# @nodoc
|
133
|
-
def
|
134
|
-
event_emitter_proxy.
|
133
|
+
def once(event, callback)
|
134
|
+
event_emitter_proxy.once(event, callback)
|
135
135
|
end
|
136
136
|
|
137
137
|
# -- inherited from EventEmitter --
|
138
138
|
# @nodoc
|
139
|
-
def
|
140
|
-
event_emitter_proxy.
|
139
|
+
def on(event, callback)
|
140
|
+
event_emitter_proxy.on(event, callback)
|
141
141
|
end
|
142
142
|
|
143
143
|
# -- inherited from EventEmitter --
|
144
144
|
# @nodoc
|
145
|
-
def
|
146
|
-
event_emitter_proxy.
|
145
|
+
def off(event, callback)
|
146
|
+
event_emitter_proxy.off(event, callback)
|
147
147
|
end
|
148
148
|
|
149
149
|
private def event_emitter_proxy
|
@@ -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)
|
@@ -60,13 +70,14 @@ module Playwright
|
|
60
70
|
end
|
61
71
|
|
62
72
|
# @nodoc
|
63
|
-
def
|
64
|
-
wrap_impl(@impl.
|
73
|
+
def ok?
|
74
|
+
wrap_impl(@impl.ok?)
|
65
75
|
end
|
66
76
|
|
77
|
+
# -- inherited from EventEmitter --
|
67
78
|
# @nodoc
|
68
|
-
def
|
69
|
-
|
79
|
+
def once(event, callback)
|
80
|
+
event_emitter_proxy.once(event, callback)
|
70
81
|
end
|
71
82
|
|
72
83
|
# -- inherited from EventEmitter --
|
@@ -81,12 +92,6 @@ module Playwright
|
|
81
92
|
event_emitter_proxy.off(event, callback)
|
82
93
|
end
|
83
94
|
|
84
|
-
# -- inherited from EventEmitter --
|
85
|
-
# @nodoc
|
86
|
-
def once(event, callback)
|
87
|
-
event_emitter_proxy.once(event, callback)
|
88
|
-
end
|
89
|
-
|
90
95
|
private def event_emitter_proxy
|
91
96
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
92
97
|
end
|