playwright-ruby-client 1.25.0 → 1.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/docs/api/api_request_context.md +93 -0
- data/documentation/docs/api/browser_context.md +3 -3
- data/documentation/docs/api/browser_type.md +8 -0
- data/documentation/docs/api/download.md +1 -1
- data/documentation/docs/api/element_handle.md +1 -1
- data/documentation/docs/api/file_chooser.md +1 -1
- data/documentation/docs/api/frame.md +103 -4
- data/documentation/docs/api/frame_locator.md +105 -5
- data/documentation/docs/api/locator.md +121 -6
- data/documentation/docs/api/page.md +119 -10
- data/documentation/docs/api/tracing.md +1 -1
- data/documentation/docs/article/guides/rails_integration_with_null_driver.md +59 -0
- data/documentation/docs/include/api_coverage.md +29 -0
- data/documentation/src/components/HomepageFeatures.js +1 -1
- data/lib/playwright/channel_owners/api_request_context.rb +23 -120
- data/lib/playwright/channel_owners/browser_context.rb +4 -5
- data/lib/playwright/channel_owners/dialog.rb +1 -1
- data/lib/playwright/channel_owners/frame.rb +4 -0
- data/lib/playwright/channel_owners/page.rb +7 -6
- data/lib/playwright/channel_owners/selectors.rb +4 -0
- data/lib/playwright/frame_locator_impl.rb +6 -2
- data/lib/playwright/locator_impl.rb +7 -31
- data/lib/playwright/locator_utils.rb +142 -0
- data/lib/playwright/route_handler.rb +2 -2
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/api_request_context.rb +92 -7
- data/lib/playwright_api/browser_context.rb +3 -3
- data/lib/playwright_api/browser_type.rb +6 -0
- data/lib/playwright_api/download.rb +1 -1
- data/lib/playwright_api/element_handle.rb +1 -1
- data/lib/playwright_api/file_chooser.rb +1 -1
- data/lib/playwright_api/frame.rb +78 -4
- data/lib/playwright_api/frame_locator.rb +79 -4
- data/lib/playwright_api/locator.rb +94 -5
- data/lib/playwright_api/page.rb +93 -10
- data/lib/playwright_api/request.rb +4 -4
- data/lib/playwright_api/response.rb +4 -4
- data/lib/playwright_api/selectors.rb +11 -0
- data/lib/playwright_api/tracing.rb +1 -1
- data/lib/playwright_api/worker.rb +4 -4
- metadata +4 -3
@@ -11,14 +11,14 @@ module Playwright
|
|
11
11
|
# **Strictness**
|
12
12
|
#
|
13
13
|
# Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches
|
14
|
-
# given selector.
|
14
|
+
# a given selector.
|
15
15
|
#
|
16
16
|
# ```python sync
|
17
17
|
# # Throws if there are several frames in DOM:
|
18
|
-
# page.frame_locator('.result-frame').
|
18
|
+
# page.frame_locator('.result-frame').get_by_role('button').click()
|
19
19
|
#
|
20
20
|
# # Works because we explicitly tell locator to pick the first frame:
|
21
|
-
# page.frame_locator('.result-frame').first.
|
21
|
+
# page.frame_locator('.result-frame').first.get_by_role('button').click()
|
22
22
|
# ```
|
23
23
|
#
|
24
24
|
# **Converting Locator to FrameLocator**
|
@@ -42,12 +42,87 @@ module Playwright
|
|
42
42
|
wrap_impl(@impl.frame_locator(unwrap_impl(selector)))
|
43
43
|
end
|
44
44
|
|
45
|
+
# Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
46
|
+
#
|
47
|
+
# ```html
|
48
|
+
# <img alt='Castle'>
|
49
|
+
# ```
|
50
|
+
def get_by_alt_text(text, exact: nil)
|
51
|
+
wrap_impl(@impl.get_by_alt_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
52
|
+
end
|
53
|
+
|
54
|
+
# Allows locating input elements by the text of the associated label. For example, this method will find the input by
|
55
|
+
# label text Password in the following DOM:
|
56
|
+
#
|
57
|
+
# ```html
|
58
|
+
# <label for="password-input">Password:</label>
|
59
|
+
# <input id="password-input">
|
60
|
+
# ```
|
61
|
+
def get_by_label(text, exact: nil)
|
62
|
+
wrap_impl(@impl.get_by_label(unwrap_impl(text), exact: unwrap_impl(exact)))
|
63
|
+
end
|
64
|
+
|
65
|
+
# Allows locating input elements by the placeholder text. For example, this method will find the input by placeholder
|
66
|
+
# "Country":
|
67
|
+
#
|
68
|
+
# ```html
|
69
|
+
# <input placeholder="Country">
|
70
|
+
# ```
|
71
|
+
def get_by_placeholder(text, exact: nil)
|
72
|
+
wrap_impl(@impl.get_by_placeholder(unwrap_impl(text), exact: unwrap_impl(exact)))
|
73
|
+
end
|
74
|
+
|
75
|
+
# Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),
|
76
|
+
# [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and
|
77
|
+
# [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). Note that role selector **does not replace**
|
78
|
+
# accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
|
79
|
+
#
|
80
|
+
# Note that many html elements have an implicitly
|
81
|
+
# [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
|
82
|
+
# can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
|
83
|
+
# recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
|
84
|
+
def get_by_role(
|
85
|
+
role,
|
86
|
+
checked: nil,
|
87
|
+
disabled: nil,
|
88
|
+
expanded: nil,
|
89
|
+
includeHidden: nil,
|
90
|
+
level: nil,
|
91
|
+
name: nil,
|
92
|
+
pressed: nil,
|
93
|
+
selected: nil)
|
94
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
95
|
+
end
|
96
|
+
|
97
|
+
# Locate element by the test id. By default, the `data-testid` attribute is used as a test id. Use
|
98
|
+
# [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.
|
99
|
+
def get_by_test_id(testId)
|
100
|
+
wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
|
101
|
+
end
|
102
|
+
|
103
|
+
# Allows locating elements that contain given text.
|
104
|
+
def get_by_text(text, exact: nil)
|
105
|
+
wrap_impl(@impl.get_by_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
106
|
+
end
|
107
|
+
|
108
|
+
# Allows locating elements by their title. For example, this method will find the button by its title "Submit":
|
109
|
+
#
|
110
|
+
# ```html
|
111
|
+
# <button title='Place the order'>Order Now</button>
|
112
|
+
# ```
|
113
|
+
def get_by_title(text, exact: nil)
|
114
|
+
wrap_impl(@impl.get_by_title(unwrap_impl(text), exact: unwrap_impl(exact)))
|
115
|
+
end
|
116
|
+
|
45
117
|
# Returns locator to the last matching frame.
|
46
118
|
def last
|
47
119
|
wrap_impl(@impl.last)
|
48
120
|
end
|
49
121
|
|
50
|
-
# The method finds an element matching the specified selector in the
|
122
|
+
# The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options,
|
123
|
+
# similar to [`method: Locator.filter`] method.
|
124
|
+
#
|
125
|
+
# [Learn more about locators](../locators.md).
|
51
126
|
def locator(selector, has: nil, hasText: nil)
|
52
127
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
53
128
|
end
|
@@ -142,6 +142,21 @@ module Playwright
|
|
142
142
|
wrap_impl(@impl.dispatch_event(unwrap_impl(type), eventInit: unwrap_impl(eventInit), timeout: unwrap_impl(timeout)))
|
143
143
|
end
|
144
144
|
|
145
|
+
# This method drags the locator to another target locator or target position. It will first move to the source element,
|
146
|
+
# perform a `mousedown`, then move to the target element or position and perform a `mouseup`.
|
147
|
+
#
|
148
|
+
# ```python sync
|
149
|
+
# source = page.locator("#source")
|
150
|
+
# target = page.locator("#target")
|
151
|
+
#
|
152
|
+
# source.drag_to(target)
|
153
|
+
# # or specify exact positions relative to the top-left corners of the elements:
|
154
|
+
# source.drag_to(
|
155
|
+
# target,
|
156
|
+
# source_position={"x": 34, "y": 7},
|
157
|
+
# target_position={"x": 10, "y": 20}
|
158
|
+
# )
|
159
|
+
# ```
|
145
160
|
def drag_to(
|
146
161
|
target,
|
147
162
|
force: nil,
|
@@ -232,7 +247,7 @@ module Playwright
|
|
232
247
|
# # ...
|
233
248
|
# row_locator
|
234
249
|
# .filter(has_text="text in column 1")
|
235
|
-
# .filter(has=page.
|
250
|
+
# .filter(has=page.get_by_role("button", name="column 2 button"))
|
236
251
|
# .screenshot()
|
237
252
|
# ```
|
238
253
|
def filter(has: nil, hasText: nil)
|
@@ -253,7 +268,7 @@ module Playwright
|
|
253
268
|
# that iframe:
|
254
269
|
#
|
255
270
|
# ```python sync
|
256
|
-
# locator = page.frame_locator("iframe").
|
271
|
+
# locator = page.frame_locator("iframe").get_by_text("Submit")
|
257
272
|
# locator.click()
|
258
273
|
# ```
|
259
274
|
def frame_locator(selector)
|
@@ -266,6 +281,78 @@ module Playwright
|
|
266
281
|
end
|
267
282
|
alias_method :[], :get_attribute
|
268
283
|
|
284
|
+
# Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
285
|
+
#
|
286
|
+
# ```html
|
287
|
+
# <img alt='Castle'>
|
288
|
+
# ```
|
289
|
+
def get_by_alt_text(text, exact: nil)
|
290
|
+
wrap_impl(@impl.get_by_alt_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
291
|
+
end
|
292
|
+
|
293
|
+
# Allows locating input elements by the text of the associated label. For example, this method will find the input by
|
294
|
+
# label text Password in the following DOM:
|
295
|
+
#
|
296
|
+
# ```html
|
297
|
+
# <label for="password-input">Password:</label>
|
298
|
+
# <input id="password-input">
|
299
|
+
# ```
|
300
|
+
def get_by_label(text, exact: nil)
|
301
|
+
wrap_impl(@impl.get_by_label(unwrap_impl(text), exact: unwrap_impl(exact)))
|
302
|
+
end
|
303
|
+
|
304
|
+
# Allows locating input elements by the placeholder text. For example, this method will find the input by placeholder
|
305
|
+
# "Country":
|
306
|
+
#
|
307
|
+
# ```html
|
308
|
+
# <input placeholder="Country">
|
309
|
+
# ```
|
310
|
+
def get_by_placeholder(text, exact: nil)
|
311
|
+
wrap_impl(@impl.get_by_placeholder(unwrap_impl(text), exact: unwrap_impl(exact)))
|
312
|
+
end
|
313
|
+
|
314
|
+
# Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),
|
315
|
+
# [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and
|
316
|
+
# [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). Note that role selector **does not replace**
|
317
|
+
# accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
|
318
|
+
#
|
319
|
+
# Note that many html elements have an implicitly
|
320
|
+
# [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
|
321
|
+
# can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
|
322
|
+
# recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
|
323
|
+
def get_by_role(
|
324
|
+
role,
|
325
|
+
checked: nil,
|
326
|
+
disabled: nil,
|
327
|
+
expanded: nil,
|
328
|
+
includeHidden: nil,
|
329
|
+
level: nil,
|
330
|
+
name: nil,
|
331
|
+
pressed: nil,
|
332
|
+
selected: nil)
|
333
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
334
|
+
end
|
335
|
+
|
336
|
+
# Locate element by the test id. By default, the `data-testid` attribute is used as a test id. Use
|
337
|
+
# [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.
|
338
|
+
def get_by_test_id(testId)
|
339
|
+
wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
|
340
|
+
end
|
341
|
+
|
342
|
+
# Allows locating elements that contain given text.
|
343
|
+
def get_by_text(text, exact: nil)
|
344
|
+
wrap_impl(@impl.get_by_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
345
|
+
end
|
346
|
+
|
347
|
+
# Allows locating elements by their title. For example, this method will find the button by its title "Submit":
|
348
|
+
#
|
349
|
+
# ```html
|
350
|
+
# <button title='Place the order'>Order Now</button>
|
351
|
+
# ```
|
352
|
+
def get_by_title(text, exact: nil)
|
353
|
+
wrap_impl(@impl.get_by_title(unwrap_impl(text), exact: unwrap_impl(exact)))
|
354
|
+
end
|
355
|
+
|
269
356
|
# Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses
|
270
357
|
# [`method: Locator.highlight`].
|
271
358
|
def highlight
|
@@ -344,8 +431,10 @@ module Playwright
|
|
344
431
|
wrap_impl(@impl.last)
|
345
432
|
end
|
346
433
|
|
347
|
-
# The method finds an element matching the specified selector in the
|
434
|
+
# The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options,
|
348
435
|
# similar to [`method: Locator.filter`] method.
|
436
|
+
#
|
437
|
+
# [Learn more about locators](../locators.md).
|
349
438
|
def locator(selector, has: nil, hasText: nil)
|
350
439
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
351
440
|
end
|
@@ -524,8 +613,8 @@ module Playwright
|
|
524
613
|
# An example of typing into a text field and then submitting the form:
|
525
614
|
#
|
526
615
|
# ```python sync
|
527
|
-
# element = page.
|
528
|
-
# element.type("
|
616
|
+
# element = page.get_by_label("Password")
|
617
|
+
# element.type("my password")
|
529
618
|
# element.press("Enter")
|
530
619
|
# ```
|
531
620
|
def type(text, delay: nil, noWaitAfter: nil, timeout: nil)
|
data/lib/playwright_api/page.rb
CHANGED
@@ -250,6 +250,19 @@ module Playwright
|
|
250
250
|
wrap_impl(@impl.dispatch_event(unwrap_impl(selector), unwrap_impl(type), eventInit: unwrap_impl(eventInit), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
251
251
|
end
|
252
252
|
|
253
|
+
# This method drags the source element to the target element. It will first move to the source element, perform a
|
254
|
+
# `mousedown`, then move to the target element and perform a `mouseup`.
|
255
|
+
#
|
256
|
+
# ```python sync
|
257
|
+
# page.drag_and_drop("#source", "#target")
|
258
|
+
# # or specify exact positions relative to the top-left corners of the elements:
|
259
|
+
# page.drag_and_drop(
|
260
|
+
# "#source",
|
261
|
+
# "#target",
|
262
|
+
# source_position={"x": 34, "y": 7},
|
263
|
+
# target_position={"x": 10, "y": 20}
|
264
|
+
# )
|
265
|
+
# ```
|
253
266
|
def drag_and_drop(
|
254
267
|
source,
|
255
268
|
target,
|
@@ -553,7 +566,7 @@ module Playwright
|
|
553
566
|
# id="my-frame">`:
|
554
567
|
#
|
555
568
|
# ```python sync
|
556
|
-
# locator = page.frame_locator("#my-iframe").
|
569
|
+
# locator = page.frame_locator("#my-iframe").get_by_text("Submit")
|
557
570
|
# locator.click()
|
558
571
|
# ```
|
559
572
|
def frame_locator(selector)
|
@@ -570,6 +583,78 @@ module Playwright
|
|
570
583
|
wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
571
584
|
end
|
572
585
|
|
586
|
+
# Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
587
|
+
#
|
588
|
+
# ```html
|
589
|
+
# <img alt='Castle'>
|
590
|
+
# ```
|
591
|
+
def get_by_alt_text(text, exact: nil)
|
592
|
+
wrap_impl(@impl.get_by_alt_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
593
|
+
end
|
594
|
+
|
595
|
+
# Allows locating input elements by the text of the associated label. For example, this method will find the input by
|
596
|
+
# label text Password in the following DOM:
|
597
|
+
#
|
598
|
+
# ```html
|
599
|
+
# <label for="password-input">Password:</label>
|
600
|
+
# <input id="password-input">
|
601
|
+
# ```
|
602
|
+
def get_by_label(text, exact: nil)
|
603
|
+
wrap_impl(@impl.get_by_label(unwrap_impl(text), exact: unwrap_impl(exact)))
|
604
|
+
end
|
605
|
+
|
606
|
+
# Allows locating input elements by the placeholder text. For example, this method will find the input by placeholder
|
607
|
+
# "Country":
|
608
|
+
#
|
609
|
+
# ```html
|
610
|
+
# <input placeholder="Country">
|
611
|
+
# ```
|
612
|
+
def get_by_placeholder(text, exact: nil)
|
613
|
+
wrap_impl(@impl.get_by_placeholder(unwrap_impl(text), exact: unwrap_impl(exact)))
|
614
|
+
end
|
615
|
+
|
616
|
+
# Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),
|
617
|
+
# [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and
|
618
|
+
# [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). Note that role selector **does not replace**
|
619
|
+
# accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
|
620
|
+
#
|
621
|
+
# Note that many html elements have an implicitly
|
622
|
+
# [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
|
623
|
+
# can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
|
624
|
+
# recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
|
625
|
+
def get_by_role(
|
626
|
+
role,
|
627
|
+
checked: nil,
|
628
|
+
disabled: nil,
|
629
|
+
expanded: nil,
|
630
|
+
includeHidden: nil,
|
631
|
+
level: nil,
|
632
|
+
name: nil,
|
633
|
+
pressed: nil,
|
634
|
+
selected: nil)
|
635
|
+
wrap_impl(@impl.get_by_role(unwrap_impl(role), checked: unwrap_impl(checked), disabled: unwrap_impl(disabled), expanded: unwrap_impl(expanded), includeHidden: unwrap_impl(includeHidden), level: unwrap_impl(level), name: unwrap_impl(name), pressed: unwrap_impl(pressed), selected: unwrap_impl(selected)))
|
636
|
+
end
|
637
|
+
|
638
|
+
# Locate element by the test id. By default, the `data-testid` attribute is used as a test id. Use
|
639
|
+
# [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.
|
640
|
+
def get_by_test_id(testId)
|
641
|
+
wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
|
642
|
+
end
|
643
|
+
|
644
|
+
# Allows locating elements that contain given text.
|
645
|
+
def get_by_text(text, exact: nil)
|
646
|
+
wrap_impl(@impl.get_by_text(unwrap_impl(text), exact: unwrap_impl(exact)))
|
647
|
+
end
|
648
|
+
|
649
|
+
# Allows locating elements by their title. For example, this method will find the button by its title "Submit":
|
650
|
+
#
|
651
|
+
# ```html
|
652
|
+
# <button title='Place the order'>Order Now</button>
|
653
|
+
# ```
|
654
|
+
def get_by_title(text, exact: nil)
|
655
|
+
wrap_impl(@impl.get_by_title(unwrap_impl(text), exact: unwrap_impl(exact)))
|
656
|
+
end
|
657
|
+
|
573
658
|
# Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
|
574
659
|
# last redirect. If can not go back, returns `null`.
|
575
660
|
#
|
@@ -688,13 +773,11 @@ module Playwright
|
|
688
773
|
wrap_impl(@impl.visible?(unwrap_impl(selector), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
689
774
|
end
|
690
775
|
|
691
|
-
# The method returns an element locator that can be used to perform actions on
|
692
|
-
# element immediately before performing an action, so a series of actions on the same locator can in fact be performed
|
693
|
-
# different DOM elements. That would happen if the DOM structure between those actions has changed.
|
776
|
+
# The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to
|
777
|
+
# the element immediately before performing an action, so a series of actions on the same locator can in fact be performed
|
778
|
+
# on different DOM elements. That would happen if the DOM structure between those actions has changed.
|
694
779
|
#
|
695
780
|
# [Learn more about locators](../locators.md).
|
696
|
-
#
|
697
|
-
# Shortcut for main frame's [`method: Frame.locator`].
|
698
781
|
def locator(selector, has: nil, hasText: nil)
|
699
782
|
wrap_impl(@impl.locator(unwrap_impl(selector), has: unwrap_impl(has), hasText: unwrap_impl(hasText)))
|
700
783
|
end
|
@@ -1177,7 +1260,7 @@ module Playwright
|
|
1177
1260
|
#
|
1178
1261
|
# ```python sync
|
1179
1262
|
# with page.expect_event("framenavigated") as event_info:
|
1180
|
-
# page.
|
1263
|
+
# page.get_by_role("button")
|
1181
1264
|
# frame = event_info.value
|
1182
1265
|
# ```
|
1183
1266
|
def expect_event(event, predicate: nil, timeout: nil, &block)
|
@@ -1228,13 +1311,13 @@ module Playwright
|
|
1228
1311
|
# when this method is called. If current document has already reached the required state, resolves immediately.
|
1229
1312
|
#
|
1230
1313
|
# ```python sync
|
1231
|
-
# page.
|
1314
|
+
# page.get_by_role("button").click() # click triggers navigation.
|
1232
1315
|
# page.wait_for_load_state() # the promise resolves after "load" event.
|
1233
1316
|
# ```
|
1234
1317
|
#
|
1235
1318
|
# ```python sync
|
1236
1319
|
# with page.expect_popup() as page_info:
|
1237
|
-
# page.
|
1320
|
+
# page.get_by_role("button").click() # click triggers a popup.
|
1238
1321
|
# popup = page_info.value
|
1239
1322
|
# # Following resolves after "domcontentloaded" event.
|
1240
1323
|
# popup.wait_for_load_state("domcontentloaded")
|
@@ -1321,7 +1404,7 @@ module Playwright
|
|
1321
1404
|
# `detached`.
|
1322
1405
|
#
|
1323
1406
|
# > NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
|
1324
|
-
# web-first assertions
|
1407
|
+
# web-first assertions makes the code wait-for-selector-free.
|
1325
1408
|
#
|
1326
1409
|
# Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
|
1327
1410
|
# the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
|
@@ -152,13 +152,13 @@ module Playwright
|
|
152
152
|
end
|
153
153
|
|
154
154
|
# @nodoc
|
155
|
-
def
|
156
|
-
wrap_impl(@impl.
|
155
|
+
def header_values(name)
|
156
|
+
wrap_impl(@impl.header_values(unwrap_impl(name)))
|
157
157
|
end
|
158
158
|
|
159
159
|
# @nodoc
|
160
|
-
def
|
161
|
-
wrap_impl(@impl.
|
160
|
+
def apply_fallback_overrides(overrides)
|
161
|
+
wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
|
162
162
|
end
|
163
163
|
|
164
164
|
# -- inherited from EventEmitter --
|
@@ -101,13 +101,13 @@ module Playwright
|
|
101
101
|
end
|
102
102
|
|
103
103
|
# @nodoc
|
104
|
-
def
|
105
|
-
wrap_impl(@impl.
|
104
|
+
def ok?
|
105
|
+
wrap_impl(@impl.ok?)
|
106
106
|
end
|
107
107
|
|
108
108
|
# @nodoc
|
109
|
-
def
|
110
|
-
wrap_impl(@impl.
|
109
|
+
def from_service_worker?
|
110
|
+
wrap_impl(@impl.from_service_worker?)
|
111
111
|
end
|
112
112
|
|
113
113
|
# -- inherited from EventEmitter --
|
@@ -43,6 +43,17 @@ module Playwright
|
|
43
43
|
wrap_impl(@impl.register(unwrap_impl(name), contentScript: unwrap_impl(contentScript), path: unwrap_impl(path), script: unwrap_impl(script)))
|
44
44
|
end
|
45
45
|
|
46
|
+
# Defines custom attribute name to be used in [`method: Page.getByTestId`]. `data-testid` is used by default.
|
47
|
+
def set_test_id_attribute(attributeName)
|
48
|
+
raise NotImplementedError.new('set_test_id_attribute is not implemented yet.')
|
49
|
+
end
|
50
|
+
alias_method :test_id_attribute=, :set_test_id_attribute
|
51
|
+
|
52
|
+
# @nodoc
|
53
|
+
def text_id_attribute=(attribute_name)
|
54
|
+
wrap_impl(@impl.text_id_attribute=(unwrap_impl(attribute_name)))
|
55
|
+
end
|
56
|
+
|
46
57
|
# -- inherited from EventEmitter --
|
47
58
|
# @nodoc
|
48
59
|
def off(event, callback)
|
@@ -41,7 +41,7 @@ module Playwright
|
|
41
41
|
# page.goto("https://playwright.dev")
|
42
42
|
#
|
43
43
|
# context.tracing.start_chunk()
|
44
|
-
# page.
|
44
|
+
# page.get_by_text("Get Started").click()
|
45
45
|
# # Everything between start_chunk and stop_chunk will be recorded in the trace.
|
46
46
|
# context.tracing.stop_chunk(path = "trace1.zip")
|
47
47
|
#
|
@@ -44,13 +44,13 @@ module Playwright
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# @nodoc
|
47
|
-
def
|
48
|
-
wrap_impl(@impl.
|
47
|
+
def context=(req)
|
48
|
+
wrap_impl(@impl.context=(unwrap_impl(req)))
|
49
49
|
end
|
50
50
|
|
51
51
|
# @nodoc
|
52
|
-
def
|
53
|
-
wrap_impl(@impl.
|
52
|
+
def page=(req)
|
53
|
+
wrap_impl(@impl.page=(unwrap_impl(req)))
|
54
54
|
end
|
55
55
|
|
56
56
|
# -- inherited from EventEmitter --
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playwright-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -327,6 +327,7 @@ files:
|
|
327
327
|
- lib/playwright/javascript/visitor_info.rb
|
328
328
|
- lib/playwright/keyboard_impl.rb
|
329
329
|
- lib/playwright/locator_impl.rb
|
330
|
+
- lib/playwright/locator_utils.rb
|
330
331
|
- lib/playwright/mouse_impl.rb
|
331
332
|
- lib/playwright/playwright_api.rb
|
332
333
|
- lib/playwright/raw_headers.rb
|
@@ -399,5 +400,5 @@ requirements: []
|
|
399
400
|
rubygems_version: 3.3.7
|
400
401
|
signing_key:
|
401
402
|
specification_version: 4
|
402
|
-
summary: The Ruby binding of playwright driver 1.
|
403
|
+
summary: The Ruby binding of playwright driver 1.27.0
|
403
404
|
test_files: []
|