playwright-ruby-client 1.14.beta1 → 1.15.beta1
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/accessibility.md +16 -17
- data/documentation/docs/api/browser.md +2 -0
- data/documentation/docs/api/browser_type.md +1 -0
- data/documentation/docs/api/element_handle.md +4 -5
- data/documentation/docs/api/experimental/android.md +15 -2
- data/documentation/docs/api/experimental/android_device.md +1 -0
- data/documentation/docs/api/frame.md +62 -106
- data/documentation/docs/api/locator.md +41 -41
- data/documentation/docs/api/mouse.md +3 -4
- data/documentation/docs/api/page.md +6 -6
- data/documentation/docs/api/request.md +15 -19
- data/documentation/docs/api/selectors.md +29 -3
- data/documentation/docs/api/tracing.md +13 -12
- data/documentation/docs/api/worker.md +12 -11
- data/documentation/docs/article/guides/inspector.md +1 -1
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +1 -1
- data/documentation/docs/article/guides/semi_automation.md +1 -1
- data/documentation/docs/article/guides/use_storage_state.md +78 -0
- data/lib/playwright.rb +44 -4
- data/lib/playwright/channel_owners/browser_type.rb +0 -1
- data/lib/playwright/channel_owners/frame.rb +5 -0
- data/lib/playwright/channel_owners/page.rb +4 -0
- data/lib/playwright/channel_owners/playwright.rb +9 -0
- data/lib/playwright/channel_owners/request.rb +8 -8
- data/lib/playwright/connection.rb +3 -8
- data/lib/playwright/locator_impl.rb +3 -3
- data/lib/playwright/tracing_impl.rb +9 -8
- data/lib/playwright/utils.rb +0 -1
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/android.rb +21 -8
- data/lib/playwright_api/android_device.rb +8 -7
- data/lib/playwright_api/browser.rb +10 -8
- data/lib/playwright_api/browser_context.rb +6 -6
- 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/element_handle.rb +7 -7
- data/lib/playwright_api/frame.rb +14 -14
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +16 -3
- data/lib/playwright_api/page.rb +13 -13
- 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 -6
- data/lib/playwright_api/selectors.rb +38 -7
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/worker.rb +6 -6
- metadata +4 -3
data/lib/playwright.rb
CHANGED
@@ -35,16 +35,18 @@ Dir[File.join(__dir__, 'playwright_api', '*.rb')].each { |f| require f }
|
|
35
35
|
|
36
36
|
module Playwright
|
37
37
|
class Execution
|
38
|
-
def initialize(connection, playwright)
|
38
|
+
def initialize(connection, playwright, browser = nil)
|
39
39
|
@connection = connection
|
40
40
|
@playwright = playwright
|
41
|
+
@browser = browser
|
41
42
|
end
|
42
43
|
|
43
44
|
def stop
|
45
|
+
@browser&.close
|
44
46
|
@connection.stop
|
45
47
|
end
|
46
48
|
|
47
|
-
attr_reader :playwright
|
49
|
+
attr_reader :playwright, :browser
|
48
50
|
end
|
49
51
|
|
50
52
|
# Recommended to call this method with block.
|
@@ -64,7 +66,7 @@ module Playwright
|
|
64
66
|
|
65
67
|
execution =
|
66
68
|
begin
|
67
|
-
playwright = connection.
|
69
|
+
playwright = connection.initialize_playwright
|
68
70
|
Execution.new(connection, PlaywrightApi.wrap(playwright))
|
69
71
|
rescue
|
70
72
|
connection.stop
|
@@ -100,7 +102,7 @@ module Playwright
|
|
100
102
|
|
101
103
|
execution =
|
102
104
|
begin
|
103
|
-
playwright = connection.
|
105
|
+
playwright = connection.initialize_playwright
|
104
106
|
Execution.new(connection, PlaywrightApi.wrap(playwright))
|
105
107
|
rescue
|
106
108
|
connection.stop
|
@@ -117,4 +119,42 @@ module Playwright
|
|
117
119
|
execution
|
118
120
|
end
|
119
121
|
end
|
122
|
+
|
123
|
+
# Connects to Playwright server, launched by `npx playwright launch-server chromium` or `playwright.chromium.launchServer()`
|
124
|
+
#
|
125
|
+
# Playwright.connect_to_browser_server('ws://....') do |browser|
|
126
|
+
# page = browser.new_page
|
127
|
+
# ...
|
128
|
+
# end
|
129
|
+
#
|
130
|
+
# @experimental
|
131
|
+
module_function def connect_to_browser_server(ws_endpoint, &block)
|
132
|
+
require 'playwright/web_socket_client'
|
133
|
+
require 'playwright/web_socket_transport'
|
134
|
+
|
135
|
+
transport = WebSocketTransport.new(ws_endpoint: ws_endpoint)
|
136
|
+
connection = Connection.new(transport)
|
137
|
+
connection.async_run
|
138
|
+
|
139
|
+
execution =
|
140
|
+
begin
|
141
|
+
playwright = connection.initialize_playwright
|
142
|
+
browser = playwright.send(:pre_launched_browser)
|
143
|
+
browser.send(:update_as_remote)
|
144
|
+
Execution.new(connection, PlaywrightApi.wrap(playwright), PlaywrightApi.wrap(browser))
|
145
|
+
rescue
|
146
|
+
connection.stop
|
147
|
+
raise
|
148
|
+
end
|
149
|
+
|
150
|
+
if block
|
151
|
+
begin
|
152
|
+
block.call(execution.browser)
|
153
|
+
ensure
|
154
|
+
execution.stop
|
155
|
+
end
|
156
|
+
else
|
157
|
+
execution
|
158
|
+
end
|
159
|
+
end
|
120
160
|
end
|
@@ -309,15 +309,20 @@ module Playwright
|
|
309
309
|
target,
|
310
310
|
force: nil,
|
311
311
|
noWaitAfter: nil,
|
312
|
+
sourcePosition: nil,
|
312
313
|
strict: nil,
|
314
|
+
targetPosition: nil,
|
313
315
|
timeout: nil,
|
314
316
|
trial: nil)
|
317
|
+
|
315
318
|
params = {
|
316
319
|
source: source,
|
317
320
|
target: target,
|
318
321
|
force: force,
|
319
322
|
noWaitAfter: noWaitAfter,
|
323
|
+
sourcePosition: sourcePosition,
|
320
324
|
strict: strict,
|
325
|
+
targetPosition: targetPosition,
|
321
326
|
timeout: timeout,
|
322
327
|
trial: trial,
|
323
328
|
}.compact
|
@@ -475,7 +475,9 @@ module Playwright
|
|
475
475
|
target,
|
476
476
|
force: nil,
|
477
477
|
noWaitAfter: nil,
|
478
|
+
sourcePosition: nil,
|
478
479
|
strict: nil,
|
480
|
+
targetPosition: nil,
|
479
481
|
timeout: nil,
|
480
482
|
trial: nil)
|
481
483
|
|
@@ -484,7 +486,9 @@ module Playwright
|
|
484
486
|
target,
|
485
487
|
force: force,
|
486
488
|
noWaitAfter: noWaitAfter,
|
489
|
+
sourcePosition: sourcePosition,
|
487
490
|
strict: strict,
|
491
|
+
targetPosition: targetPosition,
|
488
492
|
timeout: timeout,
|
489
493
|
trial: trial)
|
490
494
|
end
|
@@ -30,6 +30,15 @@ module Playwright
|
|
30
30
|
end.to_h
|
31
31
|
end
|
32
32
|
|
33
|
+
# used only from Playwright#connect_to_browser_server
|
34
|
+
private def pre_launched_browser
|
35
|
+
unless @initializer['preLaunchedBrowser']
|
36
|
+
raise 'Malformed endpoint. Did you use launchServer method?'
|
37
|
+
end
|
38
|
+
|
39
|
+
::Playwright::ChannelOwners::Browser.from(@initializer['preLaunchedBrowser'])
|
40
|
+
end
|
41
|
+
|
33
42
|
private def parse_device_descriptor(descriptor)
|
34
43
|
# This return value can be passed into Browser#new_context as it is.
|
35
44
|
# ex:
|
@@ -100,14 +100,14 @@ module Playwright
|
|
100
100
|
request_start:,
|
101
101
|
response_start:)
|
102
102
|
|
103
|
-
@timing[
|
104
|
-
@timing[
|
105
|
-
@timing[
|
106
|
-
@timing[
|
107
|
-
@timing[
|
108
|
-
@timing[
|
109
|
-
@timing[
|
110
|
-
@timing[
|
103
|
+
@timing[:startTime] = start_time
|
104
|
+
@timing[:domainLookupStart] = domain_lookup_start
|
105
|
+
@timing[:domainLookupEnd] = domain_lookup_end
|
106
|
+
@timing[:connectStart] = connect_start
|
107
|
+
@timing[:secureConnectionStart] = secure_connection_start
|
108
|
+
@timing[:connectEnd] = connect_end
|
109
|
+
@timing[:requestStart] = request_start
|
110
|
+
@timing[:responseStart] = response_start
|
111
111
|
end
|
112
112
|
|
113
113
|
private def update_headers(headers)
|
@@ -31,14 +31,9 @@ module Playwright
|
|
31
31
|
@transport.stop
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
callback = Concurrent::Promises.resolvable_future
|
40
|
-
@waiting_for_object[guid] = callback
|
41
|
-
callback.value!
|
34
|
+
def initialize_playwright
|
35
|
+
result = send_message_to_server('', 'initialize', { sdkLanguage: 'ruby' })
|
36
|
+
ChannelOwners::Playwright.from(result['playwright'])
|
42
37
|
end
|
43
38
|
|
44
39
|
def async_send_message_to_server(guid, method, params)
|
@@ -142,7 +142,7 @@ module Playwright
|
|
142
142
|
LocatorImpl.new(
|
143
143
|
frame: @frame,
|
144
144
|
timeout_settings: @timeout_settings,
|
145
|
-
selector: "#{@selector} >>
|
145
|
+
selector: "#{@selector} >> nth=0",
|
146
146
|
)
|
147
147
|
end
|
148
148
|
|
@@ -150,7 +150,7 @@ module Playwright
|
|
150
150
|
LocatorImpl.new(
|
151
151
|
frame: @frame,
|
152
152
|
timeout_settings: @timeout_settings,
|
153
|
-
selector: "#{@selector} >>
|
153
|
+
selector: "#{@selector} >> nth=-1",
|
154
154
|
)
|
155
155
|
end
|
156
156
|
|
@@ -158,7 +158,7 @@ module Playwright
|
|
158
158
|
LocatorImpl.new(
|
159
159
|
frame: @frame,
|
160
160
|
timeout_settings: @timeout_settings,
|
161
|
-
selector: "#{@selector} >>
|
161
|
+
selector: "#{@selector} >> nth=#{index}",
|
162
162
|
)
|
163
163
|
end
|
164
164
|
|
@@ -16,16 +16,17 @@ module Playwright
|
|
16
16
|
|
17
17
|
# Stop tracing.
|
18
18
|
def stop(path: nil)
|
19
|
+
export(path: path) if path
|
19
20
|
@channel.send_message_to_server('tracingStop')
|
21
|
+
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
23
|
+
private def export(path:)
|
24
|
+
resp = @channel.send_message_to_server('tracingExport')
|
25
|
+
artifact = ChannelOwners::Artifact.from(resp)
|
26
|
+
# if self._context._browser:
|
27
|
+
# artifact._is_remote = self._context._browser._is_remote
|
28
|
+
artifact.save_as(path)
|
29
|
+
artifact.delete
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
data/lib/playwright/utils.rb
CHANGED
@@ -3,7 +3,6 @@ module Playwright
|
|
3
3
|
module PrepareBrowserContextOptions
|
4
4
|
# @see https://github.com/microsoft/playwright/blob/5a2cfdbd47ed3c3deff77bb73e5fac34241f649d/src/client/browserContext.ts#L265
|
5
5
|
private def prepare_browser_context_options(params)
|
6
|
-
params[:sdkLanguage] = 'ruby'
|
7
6
|
if params[:noViewport] == 0
|
8
7
|
params.delete(:noViewport)
|
9
8
|
params[:noDefaultViewport] = true
|
data/lib/playwright/version.rb
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
module Playwright
|
2
|
-
# Playwright has **experimental** support for Android automation.
|
3
|
-
#
|
2
|
+
# Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
|
3
|
+
#
|
4
|
+
# *Requirements*
|
5
|
+
# - Android device or AVD Emulator.
|
6
|
+
# - [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.
|
7
|
+
# Typically running `adb devices` is all you need to do.
|
8
|
+
# - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
|
9
|
+
# - "Enable command line on non-rooted devices" enabled in `chrome://flags`.
|
10
|
+
#
|
11
|
+
# *Known limitations*
|
12
|
+
# - Raw USB operation is not yet supported, so you need ADB.
|
13
|
+
# - Device needs to be awake to produce screenshots. Enabling "Stay awake" developer mode will help.
|
14
|
+
# - We didn't run all the tests against the device, so not everything works.
|
15
|
+
#
|
16
|
+
# *How to run*
|
4
17
|
#
|
5
18
|
# An example of the Android automation script would be:
|
6
19
|
#
|
@@ -23,12 +36,6 @@ module Playwright
|
|
23
36
|
end
|
24
37
|
alias_method :default_timeout=, :set_default_timeout
|
25
38
|
|
26
|
-
# -- inherited from EventEmitter --
|
27
|
-
# @nodoc
|
28
|
-
def once(event, callback)
|
29
|
-
event_emitter_proxy.once(event, callback)
|
30
|
-
end
|
31
|
-
|
32
39
|
# -- inherited from EventEmitter --
|
33
40
|
# @nodoc
|
34
41
|
def on(event, callback)
|
@@ -41,6 +48,12 @@ module Playwright
|
|
41
48
|
event_emitter_proxy.off(event, callback)
|
42
49
|
end
|
43
50
|
|
51
|
+
# -- inherited from EventEmitter --
|
52
|
+
# @nodoc
|
53
|
+
def once(event, callback)
|
54
|
+
event_emitter_proxy.once(event, callback)
|
55
|
+
end
|
56
|
+
|
44
57
|
private def event_emitter_proxy
|
45
58
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
46
59
|
end
|
@@ -62,11 +62,12 @@ module Playwright
|
|
62
62
|
record_video_size: nil,
|
63
63
|
reducedMotion: nil,
|
64
64
|
screen: nil,
|
65
|
+
strictSelectors: nil,
|
65
66
|
timezoneId: nil,
|
66
67
|
userAgent: nil,
|
67
68
|
viewport: nil,
|
68
69
|
&block)
|
69
|
-
wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), command: unwrap_impl(command), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
70
|
+
wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), command: unwrap_impl(command), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
70
71
|
end
|
71
72
|
|
72
73
|
# Performs a long tap on the widget defined by `selector`.
|
@@ -172,12 +173,6 @@ module Playwright
|
|
172
173
|
wrap_impl(@impl.tree)
|
173
174
|
end
|
174
175
|
|
175
|
-
# -- inherited from EventEmitter --
|
176
|
-
# @nodoc
|
177
|
-
def once(event, callback)
|
178
|
-
event_emitter_proxy.once(event, callback)
|
179
|
-
end
|
180
|
-
|
181
176
|
# -- inherited from EventEmitter --
|
182
177
|
# @nodoc
|
183
178
|
def on(event, callback)
|
@@ -190,6 +185,12 @@ module Playwright
|
|
190
185
|
event_emitter_proxy.off(event, callback)
|
191
186
|
end
|
192
187
|
|
188
|
+
# -- inherited from EventEmitter --
|
189
|
+
# @nodoc
|
190
|
+
def once(event, callback)
|
191
|
+
event_emitter_proxy.once(event, callback)
|
192
|
+
end
|
193
|
+
|
193
194
|
private def event_emitter_proxy
|
194
195
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
195
196
|
end
|
@@ -88,11 +88,12 @@ module Playwright
|
|
88
88
|
reducedMotion: nil,
|
89
89
|
screen: nil,
|
90
90
|
storageState: nil,
|
91
|
+
strictSelectors: nil,
|
91
92
|
timezoneId: nil,
|
92
93
|
userAgent: nil,
|
93
94
|
viewport: nil,
|
94
95
|
&block)
|
95
|
-
wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
96
|
+
wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
96
97
|
end
|
97
98
|
|
98
99
|
# Creates a new page in a new browser context. Closing this page will close the context as well.
|
@@ -125,11 +126,12 @@ module Playwright
|
|
125
126
|
reducedMotion: nil,
|
126
127
|
screen: nil,
|
127
128
|
storageState: nil,
|
129
|
+
strictSelectors: nil,
|
128
130
|
timezoneId: nil,
|
129
131
|
userAgent: nil,
|
130
132
|
viewport: nil,
|
131
133
|
&block)
|
132
|
-
wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
134
|
+
wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), baseURL: unwrap_impl(baseURL), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
133
135
|
end
|
134
136
|
|
135
137
|
# > NOTE: This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
|
@@ -162,12 +164,6 @@ module Playwright
|
|
162
164
|
wrap_impl(@impl.version)
|
163
165
|
end
|
164
166
|
|
165
|
-
# -- inherited from EventEmitter --
|
166
|
-
# @nodoc
|
167
|
-
def once(event, callback)
|
168
|
-
event_emitter_proxy.once(event, callback)
|
169
|
-
end
|
170
|
-
|
171
167
|
# -- inherited from EventEmitter --
|
172
168
|
# @nodoc
|
173
169
|
def on(event, callback)
|
@@ -180,6 +176,12 @@ module Playwright
|
|
180
176
|
event_emitter_proxy.off(event, callback)
|
181
177
|
end
|
182
178
|
|
179
|
+
# -- inherited from EventEmitter --
|
180
|
+
# @nodoc
|
181
|
+
def once(event, callback)
|
182
|
+
event_emitter_proxy.once(event, callback)
|
183
|
+
end
|
184
|
+
|
183
185
|
private def event_emitter_proxy
|
184
186
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
185
187
|
end
|
@@ -387,12 +387,6 @@ module Playwright
|
|
387
387
|
wrap_impl(@impl.options=(unwrap_impl(req)))
|
388
388
|
end
|
389
389
|
|
390
|
-
# -- inherited from EventEmitter --
|
391
|
-
# @nodoc
|
392
|
-
def once(event, callback)
|
393
|
-
event_emitter_proxy.once(event, callback)
|
394
|
-
end
|
395
|
-
|
396
390
|
# -- inherited from EventEmitter --
|
397
391
|
# @nodoc
|
398
392
|
def on(event, callback)
|
@@ -405,6 +399,12 @@ module Playwright
|
|
405
399
|
event_emitter_proxy.off(event, callback)
|
406
400
|
end
|
407
401
|
|
402
|
+
# -- inherited from EventEmitter --
|
403
|
+
# @nodoc
|
404
|
+
def once(event, callback)
|
405
|
+
event_emitter_proxy.once(event, callback)
|
406
|
+
end
|
407
|
+
|
408
408
|
private def event_emitter_proxy
|
409
409
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
410
410
|
end
|
@@ -130,13 +130,14 @@ module Playwright
|
|
130
130
|
reducedMotion: nil,
|
131
131
|
screen: nil,
|
132
132
|
slowMo: nil,
|
133
|
+
strictSelectors: nil,
|
133
134
|
timeout: nil,
|
134
135
|
timezoneId: nil,
|
135
136
|
tracesDir: nil,
|
136
137
|
userAgent: nil,
|
137
138
|
viewport: nil,
|
138
139
|
&block)
|
139
|
-
wrap_impl(@impl.launch_persistent_context(unwrap_impl(userDataDir), acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), channel: unwrap_impl(channel), chromiumSandbox: unwrap_impl(chromiumSandbox), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), hasTouch: unwrap_impl(hasTouch), headless: unwrap_impl(headless), httpCredentials: unwrap_impl(httpCredentials), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), slowMo: unwrap_impl(slowMo), timeout: unwrap_impl(timeout), timezoneId: unwrap_impl(timezoneId), tracesDir: unwrap_impl(tracesDir), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
140
|
+
wrap_impl(@impl.launch_persistent_context(unwrap_impl(userDataDir), acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), channel: unwrap_impl(channel), chromiumSandbox: unwrap_impl(chromiumSandbox), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), hasTouch: unwrap_impl(hasTouch), headless: unwrap_impl(headless), httpCredentials: unwrap_impl(httpCredentials), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), slowMo: unwrap_impl(slowMo), strictSelectors: unwrap_impl(strictSelectors), timeout: unwrap_impl(timeout), timezoneId: unwrap_impl(timezoneId), tracesDir: unwrap_impl(tracesDir), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
|
140
141
|
end
|
141
142
|
|
142
143
|
# Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`.
|
@@ -144,12 +145,6 @@ module Playwright
|
|
144
145
|
wrap_impl(@impl.name)
|
145
146
|
end
|
146
147
|
|
147
|
-
# -- inherited from EventEmitter --
|
148
|
-
# @nodoc
|
149
|
-
def once(event, callback)
|
150
|
-
event_emitter_proxy.once(event, callback)
|
151
|
-
end
|
152
|
-
|
153
148
|
# -- inherited from EventEmitter --
|
154
149
|
# @nodoc
|
155
150
|
def on(event, callback)
|
@@ -162,6 +157,12 @@ module Playwright
|
|
162
157
|
event_emitter_proxy.off(event, callback)
|
163
158
|
end
|
164
159
|
|
160
|
+
# -- inherited from EventEmitter --
|
161
|
+
# @nodoc
|
162
|
+
def once(event, callback)
|
163
|
+
event_emitter_proxy.once(event, callback)
|
164
|
+
end
|
165
|
+
|
165
166
|
private def event_emitter_proxy
|
166
167
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
167
168
|
end
|