playwright-ruby-client 0.0.6 → 0.0.7
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 +79 -2
- data/docs/api_coverage.md +354 -0
- data/lib/playwright.rb +2 -0
- data/lib/playwright/channel_owner.rb +3 -2
- data/lib/playwright/channel_owners/android.rb +10 -1
- data/lib/playwright/channel_owners/android_device.rb +93 -0
- data/lib/playwright/channel_owners/browser.rb +13 -13
- data/lib/playwright/channel_owners/element_handle.rb +232 -1
- data/lib/playwright/channel_owners/frame.rb +41 -3
- data/lib/playwright/channel_owners/js_handle.rb +51 -0
- data/lib/playwright/channel_owners/page.rb +48 -10
- data/lib/playwright/channel_owners/webkit_browser.rb +1 -1
- data/lib/playwright/connection.rb +9 -6
- data/lib/playwright/errors.rb +1 -1
- data/lib/playwright/input_files.rb +42 -0
- data/lib/playwright/input_types/keyboard.rb +1 -1
- data/lib/playwright/javascript/value_serializer.rb +11 -11
- data/lib/playwright/playwright_api.rb +8 -0
- data/lib/playwright/select_option_values.rb +32 -0
- data/lib/playwright/utils.rb +18 -0
- data/lib/playwright/version.rb +1 -1
- data/lib/playwright_api/android.rb +33 -0
- data/lib/playwright_api/android_device.rb +48 -0
- data/lib/playwright_api/binding_call.rb +3 -3
- data/lib/playwright_api/browser.rb +7 -6
- data/lib/playwright_api/browser_context.rb +6 -6
- data/lib/playwright_api/browser_type.rb +4 -4
- data/lib/playwright_api/chromium_browser_context.rb +3 -3
- data/lib/playwright_api/console_message.rb +3 -8
- data/lib/playwright_api/dialog.rb +2 -2
- data/lib/playwright_api/element_handle.rb +40 -39
- data/lib/playwright_api/frame.rb +23 -27
- data/lib/playwright_api/js_handle.rb +15 -9
- data/lib/playwright_api/keyboard.rb +6 -6
- data/lib/playwright_api/page.rb +35 -54
- data/lib/playwright_api/playwright.rb +7 -7
- data/lib/playwright_api/request.rb +3 -3
- data/lib/playwright_api/response.rb +3 -3
- data/lib/playwright_api/selectors.rb +3 -3
- data/playwright.gemspec +1 -0
- metadata +22 -2
@@ -0,0 +1,48 @@
|
|
1
|
+
module Playwright
|
2
|
+
# @nodoc
|
3
|
+
class AndroidDevice < PlaywrightApi
|
4
|
+
|
5
|
+
# @nodoc
|
6
|
+
def serial
|
7
|
+
wrap_impl(@impl.serial)
|
8
|
+
end
|
9
|
+
|
10
|
+
# @nodoc
|
11
|
+
def model
|
12
|
+
wrap_impl(@impl.model)
|
13
|
+
end
|
14
|
+
|
15
|
+
# @nodoc
|
16
|
+
def shell(command)
|
17
|
+
wrap_impl(@impl.shell(unwrap_impl(command)))
|
18
|
+
end
|
19
|
+
|
20
|
+
# @nodoc
|
21
|
+
def close
|
22
|
+
wrap_impl(@impl.close)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @nodoc
|
26
|
+
def launch_browser(pkg: nil, acceptDownloads: nil, bypassCSP: nil, colorScheme: nil, deviceScaleFactor: nil, extraHTTPHeaders: nil, geolocation: nil, hasTouch: nil, httpCredentials: nil, ignoreHTTPSErrors: nil, isMobile: nil, javaScriptEnabled: nil, locale: nil, logger: nil, offline: nil, permissions: nil, proxy: nil, recordHar: nil, recordVideo: nil, storageState: nil, timezoneId: nil, userAgent: nil, videoSize: nil, videosPath: nil, viewport: nil, &block)
|
27
|
+
wrap_impl(@impl.launch_browser(pkg: unwrap_impl(pkg), acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), logger: unwrap_impl(logger), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), recordHar: unwrap_impl(recordHar), recordVideo: unwrap_impl(recordVideo), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
28
|
+
end
|
29
|
+
|
30
|
+
# -- inherited from EventEmitter --
|
31
|
+
# @nodoc
|
32
|
+
def on(event, callback)
|
33
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
34
|
+
end
|
35
|
+
|
36
|
+
# -- inherited from EventEmitter --
|
37
|
+
# @nodoc
|
38
|
+
def off(event, callback)
|
39
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
40
|
+
end
|
41
|
+
|
42
|
+
# -- inherited from EventEmitter --
|
43
|
+
# @nodoc
|
44
|
+
def once(event, callback)
|
45
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -5,19 +5,19 @@ module Playwright
|
|
5
5
|
# -- inherited from EventEmitter --
|
6
6
|
# @nodoc
|
7
7
|
def on(event, callback)
|
8
|
-
wrap_impl(@impl.on(event, callback))
|
8
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
9
9
|
end
|
10
10
|
|
11
11
|
# -- inherited from EventEmitter --
|
12
12
|
# @nodoc
|
13
13
|
def off(event, callback)
|
14
|
-
wrap_impl(@impl.off(event, callback))
|
14
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
15
15
|
end
|
16
16
|
|
17
17
|
# -- inherited from EventEmitter --
|
18
18
|
# @nodoc
|
19
19
|
def once(event, callback)
|
20
|
-
wrap_impl(@impl.once(event, callback))
|
20
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -146,8 +146,9 @@ module Playwright
|
|
146
146
|
userAgent: nil,
|
147
147
|
videoSize: nil,
|
148
148
|
videosPath: nil,
|
149
|
-
viewport: nil
|
150
|
-
|
149
|
+
viewport: nil,
|
150
|
+
&block)
|
151
|
+
wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), logger: unwrap_impl(logger), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), recordHar: unwrap_impl(recordHar), recordVideo: unwrap_impl(recordVideo), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
151
152
|
end
|
152
153
|
|
153
154
|
# Creates a new page in a new browser context. Closing this page will close the context as well.
|
@@ -180,7 +181,7 @@ module Playwright
|
|
180
181
|
videoSize: nil,
|
181
182
|
videosPath: nil,
|
182
183
|
viewport: nil)
|
183
|
-
wrap_impl(@impl.new_page(acceptDownloads: acceptDownloads, bypassCSP: bypassCSP, colorScheme: colorScheme, deviceScaleFactor: deviceScaleFactor, extraHTTPHeaders: extraHTTPHeaders, geolocation: geolocation, hasTouch: hasTouch, httpCredentials: httpCredentials, ignoreHTTPSErrors: ignoreHTTPSErrors, isMobile: isMobile, javaScriptEnabled: javaScriptEnabled, locale: locale, logger: logger, offline: offline, permissions: permissions, proxy: proxy, recordHar: recordHar, recordVideo: recordVideo, storageState: storageState, timezoneId: timezoneId, userAgent: userAgent, videoSize: videoSize, videosPath: videosPath, viewport: viewport))
|
184
|
+
wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), logger: unwrap_impl(logger), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), recordHar: unwrap_impl(recordHar), recordVideo: unwrap_impl(recordVideo), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport)))
|
184
185
|
end
|
185
186
|
|
186
187
|
# Returns the browser version.
|
@@ -196,19 +197,19 @@ module Playwright
|
|
196
197
|
# -- inherited from EventEmitter --
|
197
198
|
# @nodoc
|
198
199
|
def on(event, callback)
|
199
|
-
wrap_impl(@impl.on(event, callback))
|
200
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
200
201
|
end
|
201
202
|
|
202
203
|
# -- inherited from EventEmitter --
|
203
204
|
# @nodoc
|
204
205
|
def off(event, callback)
|
205
|
-
wrap_impl(@impl.off(event, callback))
|
206
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
206
207
|
end
|
207
208
|
|
208
209
|
# -- inherited from EventEmitter --
|
209
210
|
# @nodoc
|
210
211
|
def once(event, callback)
|
211
|
-
wrap_impl(@impl.once(event, callback))
|
212
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
212
213
|
end
|
213
214
|
end
|
214
215
|
end
|
@@ -573,7 +573,7 @@ module Playwright
|
|
573
573
|
|
574
574
|
# @nodoc
|
575
575
|
def owner_page=(req)
|
576
|
-
wrap_impl(@impl.owner_page=(req))
|
576
|
+
wrap_impl(@impl.owner_page=(unwrap_impl(req)))
|
577
577
|
end
|
578
578
|
|
579
579
|
# @nodoc
|
@@ -583,30 +583,30 @@ module Playwright
|
|
583
583
|
|
584
584
|
# @nodoc
|
585
585
|
def browser=(req)
|
586
|
-
wrap_impl(@impl.browser=(req))
|
586
|
+
wrap_impl(@impl.browser=(unwrap_impl(req)))
|
587
587
|
end
|
588
588
|
|
589
589
|
# @nodoc
|
590
590
|
def options=(req)
|
591
|
-
wrap_impl(@impl.options=(req))
|
591
|
+
wrap_impl(@impl.options=(unwrap_impl(req)))
|
592
592
|
end
|
593
593
|
|
594
594
|
# -- inherited from EventEmitter --
|
595
595
|
# @nodoc
|
596
596
|
def on(event, callback)
|
597
|
-
wrap_impl(@impl.on(event, callback))
|
597
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
598
598
|
end
|
599
599
|
|
600
600
|
# -- inherited from EventEmitter --
|
601
601
|
# @nodoc
|
602
602
|
def off(event, callback)
|
603
|
-
wrap_impl(@impl.off(event, callback))
|
603
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
604
604
|
end
|
605
605
|
|
606
606
|
# -- inherited from EventEmitter --
|
607
607
|
# @nodoc
|
608
608
|
def once(event, callback)
|
609
|
-
wrap_impl(@impl.once(event, callback))
|
609
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
610
610
|
end
|
611
611
|
end
|
612
612
|
end
|
@@ -114,7 +114,7 @@ module Playwright
|
|
114
114
|
slowMo: nil,
|
115
115
|
timeout: nil,
|
116
116
|
&block)
|
117
|
-
wrap_impl(@impl.launch(args: args, chromiumSandbox: chromiumSandbox, devtools: devtools, downloadsPath: downloadsPath, env: env, executablePath: executablePath, firefoxUserPrefs: firefoxUserPrefs, handleSIGHUP: handleSIGHUP, handleSIGINT: handleSIGINT, handleSIGTERM: handleSIGTERM, headless: headless, ignoreDefaultArgs: ignoreDefaultArgs, logger: logger, proxy: proxy, slowMo: slowMo, timeout: timeout, &wrap_block_call(block)))
|
117
|
+
wrap_impl(@impl.launch(args: unwrap_impl(args), chromiumSandbox: unwrap_impl(chromiumSandbox), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), firefoxUserPrefs: unwrap_impl(firefoxUserPrefs), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), headless: unwrap_impl(headless), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), logger: unwrap_impl(logger), proxy: unwrap_impl(proxy), slowMo: unwrap_impl(slowMo), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
118
118
|
end
|
119
119
|
|
120
120
|
# Returns the persistent browser context instance.
|
@@ -208,19 +208,19 @@ module Playwright
|
|
208
208
|
# -- inherited from EventEmitter --
|
209
209
|
# @nodoc
|
210
210
|
def on(event, callback)
|
211
|
-
wrap_impl(@impl.on(event, callback))
|
211
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
212
212
|
end
|
213
213
|
|
214
214
|
# -- inherited from EventEmitter --
|
215
215
|
# @nodoc
|
216
216
|
def off(event, callback)
|
217
|
-
wrap_impl(@impl.off(event, callback))
|
217
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
218
218
|
end
|
219
219
|
|
220
220
|
# -- inherited from EventEmitter --
|
221
221
|
# @nodoc
|
222
222
|
def once(event, callback)
|
223
|
-
wrap_impl(@impl.once(event, callback))
|
223
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
224
224
|
end
|
225
225
|
end
|
226
226
|
end
|
@@ -39,19 +39,19 @@ module Playwright
|
|
39
39
|
# -- inherited from EventEmitter --
|
40
40
|
# @nodoc
|
41
41
|
def on(event, callback)
|
42
|
-
wrap_impl(@impl.on(event, callback))
|
42
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
43
43
|
end
|
44
44
|
|
45
45
|
# -- inherited from EventEmitter --
|
46
46
|
# @nodoc
|
47
47
|
def off(event, callback)
|
48
|
-
wrap_impl(@impl.off(event, callback))
|
48
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
49
49
|
end
|
50
50
|
|
51
51
|
# -- inherited from EventEmitter --
|
52
52
|
# @nodoc
|
53
53
|
def once(event, callback)
|
54
|
-
wrap_impl(@impl.once(event, callback))
|
54
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -17,11 +17,6 @@ module Playwright
|
|
17
17
|
# One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,
|
18
18
|
# `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,
|
19
19
|
# `'count'`, `'timeEnd'`.
|
20
|
-
def type_text
|
21
|
-
raise NotImplementedError.new('type_text is not implemented yet.')
|
22
|
-
end
|
23
|
-
|
24
|
-
# @nodoc
|
25
20
|
def type
|
26
21
|
wrap_impl(@impl.type)
|
27
22
|
end
|
@@ -29,19 +24,19 @@ module Playwright
|
|
29
24
|
# -- inherited from EventEmitter --
|
30
25
|
# @nodoc
|
31
26
|
def on(event, callback)
|
32
|
-
wrap_impl(@impl.on(event, callback))
|
27
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
33
28
|
end
|
34
29
|
|
35
30
|
# -- inherited from EventEmitter --
|
36
31
|
# @nodoc
|
37
32
|
def off(event, callback)
|
38
|
-
wrap_impl(@impl.off(event, callback))
|
33
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
39
34
|
end
|
40
35
|
|
41
36
|
# -- inherited from EventEmitter --
|
42
37
|
# @nodoc
|
43
38
|
def once(event, callback)
|
44
|
-
wrap_impl(@impl.once(event, callback))
|
39
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
45
40
|
end
|
46
41
|
end
|
47
42
|
end
|
@@ -83,8 +83,8 @@ module Playwright
|
|
83
83
|
end
|
84
84
|
|
85
85
|
# Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`.
|
86
|
-
def
|
87
|
-
raise NotImplementedError.new('
|
86
|
+
def type
|
87
|
+
raise NotImplementedError.new('type is not implemented yet.')
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -64,14 +64,14 @@ module Playwright
|
|
64
64
|
# [Working with selectors](./selectors.md#working-with-selectors) for more details. If no elements match the selector,
|
65
65
|
# returns `null`.
|
66
66
|
def query_selector(selector)
|
67
|
-
wrap_impl(@impl.query_selector(selector))
|
67
|
+
wrap_impl(@impl.query_selector(unwrap_impl(selector)))
|
68
68
|
end
|
69
69
|
|
70
70
|
# The method finds all elements matching the specified selector in the `ElementHandle`s subtree. See
|
71
71
|
# [Working with selectors](./selectors.md#working-with-selectors) for more details. If no elements match the selector,
|
72
72
|
# returns empty array.
|
73
73
|
def query_selector_all(selector)
|
74
|
-
wrap_impl(@impl.query_selector_all(selector))
|
74
|
+
wrap_impl(@impl.query_selector_all(unwrap_impl(selector)))
|
75
75
|
end
|
76
76
|
|
77
77
|
# Returns the return value of `pageFunction`
|
@@ -103,7 +103,7 @@ module Playwright
|
|
103
103
|
# assert tweet_handle.eval_on_selector(".retweets", "node => node.innerText") = "10"
|
104
104
|
# ```
|
105
105
|
def eval_on_selector(selector, pageFunction, arg: nil)
|
106
|
-
wrap_impl(@impl.eval_on_selector(selector, pageFunction, arg: arg))
|
106
|
+
wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(pageFunction), arg: unwrap_impl(arg)))
|
107
107
|
end
|
108
108
|
|
109
109
|
# Returns the return value of `pageFunction`
|
@@ -140,7 +140,7 @@ module Playwright
|
|
140
140
|
# assert feed_handle.eval_on_selector_all(".tweet", "nodes => nodes.map(n => n.innerText)") == ["hello!", "hi!"]
|
141
141
|
# ```
|
142
142
|
def eval_on_selector_all(selector, pageFunction, arg: nil)
|
143
|
-
wrap_impl(@impl.eval_on_selector_all(selector, pageFunction, arg: arg))
|
143
|
+
wrap_impl(@impl.eval_on_selector_all(unwrap_impl(selector), unwrap_impl(pageFunction), arg: unwrap_impl(arg)))
|
144
144
|
end
|
145
145
|
|
146
146
|
# This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is
|
@@ -172,7 +172,7 @@ module Playwright
|
|
172
172
|
# page.mouse.click(box["x"] + box["width"] / 2, box["y"] + box["height"] / 2)
|
173
173
|
# ```
|
174
174
|
def bounding_box
|
175
|
-
|
175
|
+
wrap_impl(@impl.bounding_box)
|
176
176
|
end
|
177
177
|
|
178
178
|
# This method checks the element by performing the following steps:
|
@@ -189,7 +189,7 @@ module Playwright
|
|
189
189
|
# When all steps combined have not finished during the specified `timeout`, this method rejects with a `TimeoutError`.
|
190
190
|
# Passing zero timeout disables this.
|
191
191
|
def check(force: nil, noWaitAfter: nil, timeout: nil)
|
192
|
-
|
192
|
+
wrap_impl(@impl.check(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
193
193
|
end
|
194
194
|
|
195
195
|
# This method clicks the element by performing the following steps:
|
@@ -211,12 +211,12 @@ module Playwright
|
|
211
211
|
noWaitAfter: nil,
|
212
212
|
position: nil,
|
213
213
|
timeout: nil)
|
214
|
-
wrap_impl(@impl.click(button: button, clickCount: clickCount, delay: delay, force: force, modifiers: modifiers, noWaitAfter: noWaitAfter, position: position, timeout: timeout))
|
214
|
+
wrap_impl(@impl.click(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)))
|
215
215
|
end
|
216
216
|
|
217
217
|
# Returns the content frame for element handles referencing iframe nodes, or `null` otherwise
|
218
218
|
def content_frame
|
219
|
-
|
219
|
+
wrap_impl(@impl.content_frame)
|
220
220
|
end
|
221
221
|
|
222
222
|
# This method double clicks the element by performing the following steps:
|
@@ -240,7 +240,7 @@ module Playwright
|
|
240
240
|
noWaitAfter: nil,
|
241
241
|
position: nil,
|
242
242
|
timeout: nil)
|
243
|
-
|
243
|
+
wrap_impl(@impl.dblclick(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)))
|
244
244
|
end
|
245
245
|
|
246
246
|
# The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the elment, `click`
|
@@ -293,25 +293,26 @@ module Playwright
|
|
293
293
|
# element_handle.dispatch_event("#source", "dragstart", {"dataTransfer": data_transfer})
|
294
294
|
# ```
|
295
295
|
def dispatch_event(type, eventInit: nil)
|
296
|
-
|
296
|
+
wrap_impl(@impl.dispatch_event(unwrap_impl(type), eventInit: unwrap_impl(eventInit)))
|
297
297
|
end
|
298
298
|
|
299
299
|
# This method waits for [actionability](./actionability.md) checks, focuses the element, fills it and triggers an `input`
|
300
300
|
# event after filling. If the element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws
|
301
301
|
# an error. Note that you can pass an empty string to clear the input field.
|
302
302
|
def fill(value, noWaitAfter: nil, timeout: nil)
|
303
|
-
|
303
|
+
wrap_impl(@impl.fill(unwrap_impl(value), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
304
304
|
end
|
305
305
|
|
306
306
|
# Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
|
307
307
|
def focus
|
308
|
-
|
308
|
+
wrap_impl(@impl.focus)
|
309
309
|
end
|
310
310
|
|
311
311
|
# Returns element attribute value.
|
312
312
|
def get_attribute(name)
|
313
|
-
|
313
|
+
wrap_impl(@impl.get_attribute(unwrap_impl(name)))
|
314
314
|
end
|
315
|
+
alias_method :[], :get_attribute
|
315
316
|
|
316
317
|
# This method hovers over the element by performing the following steps:
|
317
318
|
# 1. Wait for [actionability](./actionability.md) checks on the element, unless `force` option is set.
|
@@ -324,52 +325,52 @@ module Playwright
|
|
324
325
|
# When all steps combined have not finished during the specified `timeout`, this method rejects with a `TimeoutError`.
|
325
326
|
# Passing zero timeout disables this.
|
326
327
|
def hover(force: nil, modifiers: nil, position: nil, timeout: nil)
|
327
|
-
|
328
|
+
wrap_impl(@impl.hover(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), position: unwrap_impl(position), timeout: unwrap_impl(timeout)))
|
328
329
|
end
|
329
330
|
|
330
331
|
# Returns the `element.innerHTML`.
|
331
332
|
def inner_html
|
332
|
-
|
333
|
+
wrap_impl(@impl.inner_html)
|
333
334
|
end
|
334
335
|
|
335
336
|
# Returns the `element.innerText`.
|
336
337
|
def inner_text
|
337
|
-
|
338
|
+
wrap_impl(@impl.inner_text)
|
338
339
|
end
|
339
340
|
|
340
341
|
# Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
341
342
|
def checked?
|
342
|
-
|
343
|
+
wrap_impl(@impl.checked?)
|
343
344
|
end
|
344
345
|
|
345
346
|
# Returns whether the element is disabled, the opposite of [enabled](./actionability.md#enabled).
|
346
347
|
def disabled?
|
347
|
-
|
348
|
+
wrap_impl(@impl.disabled?)
|
348
349
|
end
|
349
350
|
|
350
351
|
# Returns whether the element is [editable](./actionability.md#editable).
|
351
352
|
def editable?
|
352
|
-
|
353
|
+
wrap_impl(@impl.editable?)
|
353
354
|
end
|
354
355
|
|
355
356
|
# Returns whether the element is [enabled](./actionability.md#enabled).
|
356
357
|
def enabled?
|
357
|
-
|
358
|
+
wrap_impl(@impl.enabled?)
|
358
359
|
end
|
359
360
|
|
360
361
|
# Returns whether the element is hidden, the opposite of [visible](./actionability.md#visible).
|
361
362
|
def hidden?
|
362
|
-
|
363
|
+
wrap_impl(@impl.hidden?)
|
363
364
|
end
|
364
365
|
|
365
366
|
# Returns whether the element is [visible](./actionability.md#visible).
|
366
367
|
def visible?
|
367
|
-
|
368
|
+
wrap_impl(@impl.visible?)
|
368
369
|
end
|
369
370
|
|
370
371
|
# Returns the frame containing the given element.
|
371
372
|
def owner_frame
|
372
|
-
|
373
|
+
wrap_impl(@impl.owner_frame)
|
373
374
|
end
|
374
375
|
|
375
376
|
# Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].
|
@@ -391,7 +392,7 @@ module Playwright
|
|
391
392
|
# Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When speficied with the
|
392
393
|
# modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
393
394
|
def press(key, delay: nil, noWaitAfter: nil, timeout: nil)
|
394
|
-
wrap_impl(@impl.press(key, delay: delay, noWaitAfter: noWaitAfter, timeout: timeout))
|
395
|
+
wrap_impl(@impl.press(unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
395
396
|
end
|
396
397
|
|
397
398
|
# Returns the buffer with the captured screenshot.
|
@@ -404,7 +405,7 @@ module Playwright
|
|
404
405
|
quality: nil,
|
405
406
|
timeout: nil,
|
406
407
|
type: nil)
|
407
|
-
|
408
|
+
wrap_impl(@impl.screenshot(omitBackground: unwrap_impl(omitBackground), path: unwrap_impl(path), quality: unwrap_impl(quality), timeout: unwrap_impl(timeout), type: unwrap_impl(type)))
|
408
409
|
end
|
409
410
|
|
410
411
|
# This method waits for [actionability](./actionability.md) checks, then tries to scroll element into view, unless it is
|
@@ -414,7 +415,7 @@ module Playwright
|
|
414
415
|
# Throws when `elementHandle` does not point to an element
|
415
416
|
# [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.
|
416
417
|
def scroll_into_view_if_needed(timeout: nil)
|
417
|
-
|
418
|
+
wrap_impl(@impl.scroll_into_view_if_needed(timeout: unwrap_impl(timeout)))
|
418
419
|
end
|
419
420
|
|
420
421
|
# Returns the array of option values that have been successfully selected.
|
@@ -466,13 +467,13 @@ module Playwright
|
|
466
467
|
# handle.select_option(value="blue", { index: 2 }, "red")
|
467
468
|
# ```
|
468
469
|
def select_option(values, noWaitAfter: nil, timeout: nil)
|
469
|
-
|
470
|
+
wrap_impl(@impl.select_option(unwrap_impl(values), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
470
471
|
end
|
471
472
|
|
472
473
|
# This method waits for [actionability](./actionability.md) checks, then focuses the element and selects all its text
|
473
474
|
# content.
|
474
475
|
def select_text(timeout: nil)
|
475
|
-
|
476
|
+
wrap_impl(@impl.select_text(timeout: unwrap_impl(timeout)))
|
476
477
|
end
|
477
478
|
|
478
479
|
# This method expects `elementHandle` to point to an
|
@@ -481,7 +482,7 @@ module Playwright
|
|
481
482
|
# Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
482
483
|
# are resolved relative to the the current working directory. For empty array, clears the selected files.
|
483
484
|
def set_input_files(files, noWaitAfter: nil, timeout: nil)
|
484
|
-
|
485
|
+
wrap_impl(@impl.set_input_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
485
486
|
end
|
486
487
|
alias_method :input_files=, :set_input_files
|
487
488
|
|
@@ -503,12 +504,12 @@ module Playwright
|
|
503
504
|
noWaitAfter: nil,
|
504
505
|
position: nil,
|
505
506
|
timeout: nil)
|
506
|
-
|
507
|
+
wrap_impl(@impl.tap_point(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout)))
|
507
508
|
end
|
508
509
|
|
509
510
|
# Returns the `node.textContent`.
|
510
511
|
def text_content
|
511
|
-
|
512
|
+
wrap_impl(@impl.text_content)
|
512
513
|
end
|
513
514
|
|
514
515
|
# Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
|
@@ -551,8 +552,8 @@ module Playwright
|
|
551
552
|
# element_handle.type("some text")
|
552
553
|
# element_handle.press("Enter")
|
553
554
|
# ```
|
554
|
-
def
|
555
|
-
wrap_impl(@impl.
|
555
|
+
def type(text, delay: nil, noWaitAfter: nil, timeout: nil)
|
556
|
+
wrap_impl(@impl.type(unwrap_impl(text), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
556
557
|
end
|
557
558
|
|
558
559
|
# This method checks the element by performing the following steps:
|
@@ -569,7 +570,7 @@ module Playwright
|
|
569
570
|
# When all steps combined have not finished during the specified `timeout`, this method rejects with a `TimeoutError`.
|
570
571
|
# Passing zero timeout disables this.
|
571
572
|
def uncheck(force: nil, noWaitAfter: nil, timeout: nil)
|
572
|
-
|
573
|
+
wrap_impl(@impl.uncheck(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout)))
|
573
574
|
end
|
574
575
|
|
575
576
|
# Returns when the element satisfies the `state`.
|
@@ -587,7 +588,7 @@ module Playwright
|
|
587
588
|
#
|
588
589
|
# If the element does not satisfy the condition for the `timeout` milliseconds, this method will throw.
|
589
590
|
def wait_for_element_state(state, timeout: nil)
|
590
|
-
|
591
|
+
wrap_impl(@impl.wait_for_element_state(unwrap_impl(state), timeout: unwrap_impl(timeout)))
|
591
592
|
end
|
592
593
|
|
593
594
|
# Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
|
@@ -622,25 +623,25 @@ module Playwright
|
|
622
623
|
#
|
623
624
|
# > NOTE: This method does not work across navigations, use [`method: Page.waitForSelector`] instead.
|
624
625
|
def wait_for_selector(selector, state: nil, timeout: nil)
|
625
|
-
|
626
|
+
wrap_impl(@impl.wait_for_selector(unwrap_impl(selector), state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
|
626
627
|
end
|
627
628
|
|
628
629
|
# -- inherited from EventEmitter --
|
629
630
|
# @nodoc
|
630
631
|
def on(event, callback)
|
631
|
-
wrap_impl(@impl.on(event, callback))
|
632
|
+
wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
|
632
633
|
end
|
633
634
|
|
634
635
|
# -- inherited from EventEmitter --
|
635
636
|
# @nodoc
|
636
637
|
def off(event, callback)
|
637
|
-
wrap_impl(@impl.off(event, callback))
|
638
|
+
wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
|
638
639
|
end
|
639
640
|
|
640
641
|
# -- inherited from EventEmitter --
|
641
642
|
# @nodoc
|
642
643
|
def once(event, callback)
|
643
|
-
wrap_impl(@impl.once(event, callback))
|
644
|
+
wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
|
644
645
|
end
|
645
646
|
end
|
646
647
|
end
|