selenium-webdriver 4.45.0 → 4.46.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/CHANGES +7 -0
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +465 -0
- data/lib/selenium/webdriver/bidi/protocol/browser.rb +222 -0
- data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +694 -0
- data/lib/selenium/webdriver/bidi/protocol/domain.rb +40 -0
- data/lib/selenium/webdriver/bidi/protocol/emulation.rb +334 -0
- data/lib/selenium/webdriver/bidi/protocol/input.rb +281 -0
- data/lib/selenium/webdriver/bidi/protocol/log.rb +104 -0
- data/lib/selenium/webdriver/bidi/protocol/network.rb +637 -0
- data/lib/selenium/webdriver/bidi/protocol/permissions.rb +73 -0
- data/lib/selenium/webdriver/bidi/protocol/script.rb +874 -0
- data/lib/selenium/webdriver/bidi/protocol/session.rb +241 -0
- data/lib/selenium/webdriver/bidi/protocol/speculation.rb +56 -0
- data/lib/selenium/webdriver/bidi/protocol/storage.rb +157 -0
- data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +83 -0
- data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +93 -0
- data/lib/selenium/webdriver/bidi/protocol.rb +39 -0
- data/lib/selenium/webdriver/bidi/serialization/record.rb +226 -0
- data/lib/selenium/webdriver/bidi/serialization/union.rb +114 -0
- data/lib/selenium/webdriver/bidi/serialization.rb +78 -0
- data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +936 -0
- data/lib/selenium/webdriver/bidi/support/check_generated.rb +55 -0
- data/lib/selenium/webdriver/bidi/transport.rb +52 -0
- data/lib/selenium/webdriver/bidi.rb +3 -0
- data/lib/selenium/webdriver/chrome/driver.rb +3 -3
- data/lib/selenium/webdriver/common/client_config.rb +97 -0
- data/lib/selenium/webdriver/common/driver.rb +2 -2
- data/lib/selenium/webdriver/common/local_driver.rb +15 -4
- data/lib/selenium/webdriver/common/proxy.rb +1 -1
- data/lib/selenium/webdriver/common.rb +1 -0
- data/lib/selenium/webdriver/edge/driver.rb +3 -3
- data/lib/selenium/webdriver/firefox/driver.rb +3 -3
- data/lib/selenium/webdriver/ie/driver.rb +3 -3
- data/lib/selenium/webdriver/remote/bidi_bridge.rb +6 -1
- data/lib/selenium/webdriver/remote/bridge.rb +8 -10
- data/lib/selenium/webdriver/remote/driver.rb +12 -4
- data/lib/selenium/webdriver/remote/http/common.rb +25 -12
- data/lib/selenium/webdriver/remote/http/default.rb +56 -39
- data/lib/selenium/webdriver/safari/driver.rb +3 -3
- data/lib/selenium/webdriver/version.rb +1 -1
- metadata +25 -2
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
+
# or more contributor license agreements. See the NOTICE file
|
|
5
|
+
# distributed with this work for additional information
|
|
6
|
+
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
+
# to you under the Apache License, Version 2.0 (the
|
|
8
|
+
# "License"); you may not use this file except in compliance
|
|
9
|
+
# with the License. You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
|
14
|
+
# software distributed under the License is distributed on an
|
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
# KIND, either express or implied. See the License for the
|
|
17
|
+
# specific language governing permissions and limitations
|
|
18
|
+
# under the License.
|
|
19
|
+
|
|
20
|
+
# This file is automatically generated. DO NOT EDIT!
|
|
21
|
+
# Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
|
|
22
|
+
|
|
23
|
+
module Selenium
|
|
24
|
+
module WebDriver
|
|
25
|
+
class BiDi
|
|
26
|
+
module Protocol
|
|
27
|
+
# @api private
|
|
28
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
29
|
+
class Network < Domain
|
|
30
|
+
EVENTS = {
|
|
31
|
+
auth_required: 'network.authRequired',
|
|
32
|
+
before_request_sent: 'network.beforeRequestSent',
|
|
33
|
+
fetch_error: 'network.fetchError',
|
|
34
|
+
response_completed: 'network.responseCompleted',
|
|
35
|
+
response_started: 'network.responseStarted'
|
|
36
|
+
}.freeze
|
|
37
|
+
|
|
38
|
+
COLLECTOR_TYPE = {
|
|
39
|
+
blob: 'blob'
|
|
40
|
+
}.freeze
|
|
41
|
+
|
|
42
|
+
SAME_SITE = {
|
|
43
|
+
strict: 'strict',
|
|
44
|
+
lax: 'lax',
|
|
45
|
+
none: 'none',
|
|
46
|
+
default: 'default'
|
|
47
|
+
}.freeze
|
|
48
|
+
|
|
49
|
+
DATA_TYPE = {
|
|
50
|
+
request: 'request',
|
|
51
|
+
response: 'response'
|
|
52
|
+
}.freeze
|
|
53
|
+
|
|
54
|
+
INTERCEPT_PHASE = {
|
|
55
|
+
before_request_sent: 'beforeRequestSent',
|
|
56
|
+
response_started: 'responseStarted',
|
|
57
|
+
auth_required: 'authRequired'
|
|
58
|
+
}.freeze
|
|
59
|
+
|
|
60
|
+
INITIATOR_TYPE = {
|
|
61
|
+
parser: 'parser',
|
|
62
|
+
script: 'script',
|
|
63
|
+
preflight: 'preflight',
|
|
64
|
+
other: 'other'
|
|
65
|
+
}.freeze
|
|
66
|
+
|
|
67
|
+
CONTINUE_WITH_AUTH_NO_CREDENTIALS_ACTION = {
|
|
68
|
+
default: 'default',
|
|
69
|
+
cancel: 'cancel'
|
|
70
|
+
}.freeze
|
|
71
|
+
|
|
72
|
+
SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR = {
|
|
73
|
+
default: 'default',
|
|
74
|
+
bypass: 'bypass'
|
|
75
|
+
}.freeze
|
|
76
|
+
|
|
77
|
+
# @api private
|
|
78
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
79
|
+
AuthChallenge = Serialization::Record.define(
|
|
80
|
+
scheme: {wire_key: 'scheme', primitive: 'string'},
|
|
81
|
+
realm: {wire_key: 'realm', primitive: 'string'}
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# @api private
|
|
85
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
86
|
+
AuthCredentials = Serialization::Record.define(
|
|
87
|
+
type: {fixed: 'password'},
|
|
88
|
+
username: {wire_key: 'username', primitive: 'string'},
|
|
89
|
+
password: {wire_key: 'password', primitive: 'string'}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# @api private
|
|
93
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
94
|
+
BaseParameters = Serialization::Record.define(
|
|
95
|
+
context: {wire_key: 'context', nullable: true},
|
|
96
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
97
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
98
|
+
redirect_count: 'redirectCount',
|
|
99
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
100
|
+
timestamp: 'timestamp',
|
|
101
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
102
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true}
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# @api private
|
|
106
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
107
|
+
class BytesValue < Serialization::Union
|
|
108
|
+
discriminator 'type', {string: 'string', base64: 'base64'}
|
|
109
|
+
variants(
|
|
110
|
+
string: 'Network::StringValue',
|
|
111
|
+
base64: 'Network::Base64Value'
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @api private
|
|
116
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
117
|
+
StringValue = Serialization::Record.define(
|
|
118
|
+
type: {fixed: 'string'},
|
|
119
|
+
value: {wire_key: 'value', primitive: 'string'}
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# @api private
|
|
123
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
124
|
+
Base64Value = Serialization::Record.define(
|
|
125
|
+
type: {fixed: 'base64'},
|
|
126
|
+
value: {wire_key: 'value', primitive: 'string'}
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# @api private
|
|
130
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
131
|
+
Cookie = Serialization::Record.define(
|
|
132
|
+
name: {wire_key: 'name', primitive: 'string'},
|
|
133
|
+
value: {wire_key: 'value', ref: 'Network::BytesValue'},
|
|
134
|
+
domain: {wire_key: 'domain', primitive: 'string'},
|
|
135
|
+
path: {wire_key: 'path', primitive: 'string'},
|
|
136
|
+
size: 'size',
|
|
137
|
+
http_only: {wire_key: 'httpOnly', primitive: 'boolean'},
|
|
138
|
+
secure: {wire_key: 'secure', primitive: 'boolean'},
|
|
139
|
+
same_site: {wire_key: 'sameSite', enum: 'Network::SAME_SITE'},
|
|
140
|
+
expiry: {wire_key: 'expiry', required: false},
|
|
141
|
+
extensible: true
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
# @api private
|
|
145
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
146
|
+
CookieHeader = Serialization::Record.define(
|
|
147
|
+
name: {wire_key: 'name', primitive: 'string'},
|
|
148
|
+
value: {wire_key: 'value', ref: 'Network::BytesValue'}
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
# @api private
|
|
152
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
153
|
+
FetchTimingInfo = Serialization::Record.define(
|
|
154
|
+
time_origin: {wire_key: 'timeOrigin', primitive: 'number'},
|
|
155
|
+
request_time: {wire_key: 'requestTime', primitive: 'number'},
|
|
156
|
+
redirect_start: {wire_key: 'redirectStart', primitive: 'number'},
|
|
157
|
+
redirect_end: {wire_key: 'redirectEnd', primitive: 'number'},
|
|
158
|
+
fetch_start: {wire_key: 'fetchStart', primitive: 'number'},
|
|
159
|
+
dns_start: {wire_key: 'dnsStart', primitive: 'number'},
|
|
160
|
+
dns_end: {wire_key: 'dnsEnd', primitive: 'number'},
|
|
161
|
+
connect_start: {wire_key: 'connectStart', primitive: 'number'},
|
|
162
|
+
connect_end: {wire_key: 'connectEnd', primitive: 'number'},
|
|
163
|
+
tls_start: {wire_key: 'tlsStart', primitive: 'number'},
|
|
164
|
+
request_start: {wire_key: 'requestStart', primitive: 'number'},
|
|
165
|
+
response_start: {wire_key: 'responseStart', primitive: 'number'},
|
|
166
|
+
response_end: {wire_key: 'responseEnd', primitive: 'number'}
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
# @api private
|
|
170
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
171
|
+
Header = Serialization::Record.define(
|
|
172
|
+
name: {wire_key: 'name', primitive: 'string'},
|
|
173
|
+
value: {wire_key: 'value', ref: 'Network::BytesValue'}
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
# @api private
|
|
177
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
178
|
+
Initiator = Serialization::Record.define(
|
|
179
|
+
column_number: {wire_key: 'columnNumber', required: false},
|
|
180
|
+
line_number: {wire_key: 'lineNumber', required: false},
|
|
181
|
+
request: {wire_key: 'request', required: false},
|
|
182
|
+
stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'},
|
|
183
|
+
type: {wire_key: 'type', required: false, enum: 'Network::INITIATOR_TYPE'}
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# @api private
|
|
187
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
188
|
+
RequestData = Serialization::Record.define(
|
|
189
|
+
request: 'request',
|
|
190
|
+
url: {wire_key: 'url', primitive: 'string'},
|
|
191
|
+
method_: {wire_key: 'method', primitive: 'string'},
|
|
192
|
+
headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
|
|
193
|
+
cookies: {wire_key: 'cookies', ref: 'Network::Cookie', list: true},
|
|
194
|
+
headers_size: 'headersSize',
|
|
195
|
+
body_size: {wire_key: 'bodySize', nullable: true},
|
|
196
|
+
destination: {wire_key: 'destination', primitive: 'string'},
|
|
197
|
+
initiator_type: {wire_key: 'initiatorType', nullable: true, primitive: 'string'},
|
|
198
|
+
timings: {wire_key: 'timings', ref: 'Network::FetchTimingInfo'}
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
# @api private
|
|
202
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
203
|
+
ResponseContent = Serialization::Record.define(size: 'size')
|
|
204
|
+
|
|
205
|
+
# @api private
|
|
206
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
207
|
+
ResponseData = Serialization::Record.define(
|
|
208
|
+
url: {wire_key: 'url', primitive: 'string'},
|
|
209
|
+
protocol: {wire_key: 'protocol', primitive: 'string'},
|
|
210
|
+
status: 'status',
|
|
211
|
+
status_text: {wire_key: 'statusText', primitive: 'string'},
|
|
212
|
+
from_cache: {wire_key: 'fromCache', primitive: 'boolean'},
|
|
213
|
+
headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
|
|
214
|
+
mime_type: {wire_key: 'mimeType', primitive: 'string'},
|
|
215
|
+
bytes_received: 'bytesReceived',
|
|
216
|
+
headers_size: {wire_key: 'headersSize', nullable: true},
|
|
217
|
+
body_size: {wire_key: 'bodySize', nullable: true},
|
|
218
|
+
content: {wire_key: 'content', ref: 'Network::ResponseContent'},
|
|
219
|
+
auth_challenges: {wire_key: 'authChallenges', required: false, ref: 'Network::AuthChallenge', list: true}
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
# @api private
|
|
223
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
224
|
+
SetCookieHeader = Serialization::Record.define(
|
|
225
|
+
name: {wire_key: 'name', primitive: 'string'},
|
|
226
|
+
value: {wire_key: 'value', ref: 'Network::BytesValue'},
|
|
227
|
+
domain: {wire_key: 'domain', required: false, primitive: 'string'},
|
|
228
|
+
http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
|
|
229
|
+
expiry: {wire_key: 'expiry', required: false, primitive: 'string'},
|
|
230
|
+
max_age: {wire_key: 'maxAge', required: false},
|
|
231
|
+
path: {wire_key: 'path', required: false, primitive: 'string'},
|
|
232
|
+
same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
|
|
233
|
+
secure: {wire_key: 'secure', required: false, primitive: 'boolean'}
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
# @api private
|
|
237
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
238
|
+
class UrlPattern < Serialization::Union
|
|
239
|
+
discriminator 'type', {pattern: 'pattern', string: 'string'}
|
|
240
|
+
variants(
|
|
241
|
+
pattern: 'Network::UrlPatternPattern',
|
|
242
|
+
string: 'Network::UrlPatternString'
|
|
243
|
+
)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# @api private
|
|
247
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
248
|
+
UrlPatternPattern = Serialization::Record.define(
|
|
249
|
+
type: {fixed: 'pattern'},
|
|
250
|
+
protocol: {wire_key: 'protocol', required: false, primitive: 'string'},
|
|
251
|
+
hostname: {wire_key: 'hostname', required: false, primitive: 'string'},
|
|
252
|
+
port: {wire_key: 'port', required: false, primitive: 'string'},
|
|
253
|
+
pathname: {wire_key: 'pathname', required: false, primitive: 'string'},
|
|
254
|
+
search: {wire_key: 'search', required: false, primitive: 'string'}
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
# @api private
|
|
258
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
259
|
+
UrlPatternString = Serialization::Record.define(
|
|
260
|
+
type: {fixed: 'string'},
|
|
261
|
+
pattern: {wire_key: 'pattern', primitive: 'string'}
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
# @api private
|
|
265
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
266
|
+
AddDataCollectorParameters = Serialization::Record.define(
|
|
267
|
+
data_types: {wire_key: 'dataTypes', list: true, enum: 'Network::DATA_TYPE'},
|
|
268
|
+
max_encoded_data_size: 'maxEncodedDataSize',
|
|
269
|
+
collector_type: {wire_key: 'collectorType', required: false, enum: 'Network::COLLECTOR_TYPE'},
|
|
270
|
+
contexts: {wire_key: 'contexts', required: false, list: true},
|
|
271
|
+
user_contexts: {wire_key: 'userContexts', required: false, list: true}
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
# @api private
|
|
275
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
276
|
+
AddDataCollectorResult = Serialization::Record.define(collector: 'collector')
|
|
277
|
+
|
|
278
|
+
# @api private
|
|
279
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
280
|
+
AddInterceptParameters = Serialization::Record.define(
|
|
281
|
+
phases: {wire_key: 'phases', list: true, enum: 'Network::INTERCEPT_PHASE'},
|
|
282
|
+
contexts: {wire_key: 'contexts', required: false, list: true},
|
|
283
|
+
url_patterns: {wire_key: 'urlPatterns', required: false, ref: 'Network::UrlPattern', list: true}
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
# @api private
|
|
287
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
288
|
+
AddInterceptResult = Serialization::Record.define(intercept: 'intercept')
|
|
289
|
+
|
|
290
|
+
# @api private
|
|
291
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
292
|
+
ContinueRequestParameters = Serialization::Record.define(
|
|
293
|
+
request: 'request',
|
|
294
|
+
body: {wire_key: 'body', required: false, ref: 'Network::BytesValue'},
|
|
295
|
+
cookies: {wire_key: 'cookies', required: false, ref: 'Network::CookieHeader', list: true},
|
|
296
|
+
headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
|
|
297
|
+
method_: {wire_key: 'method', required: false, primitive: 'string'},
|
|
298
|
+
url: {wire_key: 'url', required: false, primitive: 'string'}
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
# @api private
|
|
302
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
303
|
+
ContinueResponseParameters = Serialization::Record.define(
|
|
304
|
+
request: 'request',
|
|
305
|
+
cookies: {wire_key: 'cookies', required: false, ref: 'Network::SetCookieHeader', list: true},
|
|
306
|
+
credentials: {wire_key: 'credentials', required: false, ref: 'Network::AuthCredentials'},
|
|
307
|
+
headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
|
|
308
|
+
reason_phrase: {wire_key: 'reasonPhrase', required: false, primitive: 'string'},
|
|
309
|
+
status_code: {wire_key: 'statusCode', required: false}
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
# @api private
|
|
313
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
314
|
+
class ContinueWithAuthParameters < Serialization::Union
|
|
315
|
+
discriminator 'action', {provide_credentials: 'provideCredentials'}
|
|
316
|
+
variants(
|
|
317
|
+
provide_credentials: 'Network::ContinueWithAuthParameters::Credentials'
|
|
318
|
+
)
|
|
319
|
+
fallback 'Network::ContinueWithAuthParameters::NoCredentials'
|
|
320
|
+
|
|
321
|
+
# @api private
|
|
322
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
323
|
+
Credentials = Serialization::Record.define(
|
|
324
|
+
action: {fixed: 'provideCredentials'},
|
|
325
|
+
request: 'request',
|
|
326
|
+
credentials: {wire_key: 'credentials', ref: 'Network::AuthCredentials'}
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
# @api private
|
|
330
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
331
|
+
NoCredentials = Serialization::Record.define(
|
|
332
|
+
request: 'request',
|
|
333
|
+
action: {wire_key: 'action', enum: 'Network::CONTINUE_WITH_AUTH_NO_CREDENTIALS_ACTION'}
|
|
334
|
+
)
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# @api private
|
|
338
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
339
|
+
DisownDataParameters = Serialization::Record.define(
|
|
340
|
+
data_type: {wire_key: 'dataType', enum: 'Network::DATA_TYPE'},
|
|
341
|
+
collector: 'collector',
|
|
342
|
+
request: 'request'
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
# @api private
|
|
346
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
347
|
+
FailRequestParameters = Serialization::Record.define(request: 'request')
|
|
348
|
+
|
|
349
|
+
# @api private
|
|
350
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
351
|
+
GetDataParameters = Serialization::Record.define(
|
|
352
|
+
data_type: {wire_key: 'dataType', enum: 'Network::DATA_TYPE'},
|
|
353
|
+
collector: {wire_key: 'collector', required: false},
|
|
354
|
+
disown: {wire_key: 'disown', required: false, primitive: 'boolean'},
|
|
355
|
+
request: 'request'
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
# @api private
|
|
359
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
360
|
+
GetDataResult = Serialization::Record.define(bytes: {wire_key: 'bytes', ref: 'Network::BytesValue'})
|
|
361
|
+
|
|
362
|
+
# @api private
|
|
363
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
364
|
+
ProvideResponseParameters = Serialization::Record.define(
|
|
365
|
+
request: 'request',
|
|
366
|
+
body: {wire_key: 'body', required: false, ref: 'Network::BytesValue'},
|
|
367
|
+
cookies: {wire_key: 'cookies', required: false, ref: 'Network::SetCookieHeader', list: true},
|
|
368
|
+
headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
|
|
369
|
+
reason_phrase: {wire_key: 'reasonPhrase', required: false, primitive: 'string'},
|
|
370
|
+
status_code: {wire_key: 'statusCode', required: false}
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
# @api private
|
|
374
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
375
|
+
RemoveDataCollectorParameters = Serialization::Record.define(collector: 'collector')
|
|
376
|
+
|
|
377
|
+
# @api private
|
|
378
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
379
|
+
RemoveInterceptParameters = Serialization::Record.define(intercept: 'intercept')
|
|
380
|
+
|
|
381
|
+
# @api private
|
|
382
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
383
|
+
SetCacheBehaviorParameters = Serialization::Record.define(
|
|
384
|
+
cache_behavior: {wire_key: 'cacheBehavior', enum: 'Network::SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR'},
|
|
385
|
+
contexts: {wire_key: 'contexts', required: false, list: true}
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
# @api private
|
|
389
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
390
|
+
SetExtraHeadersParameters = Serialization::Record.define(
|
|
391
|
+
headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
|
|
392
|
+
contexts: {wire_key: 'contexts', required: false, list: true},
|
|
393
|
+
user_contexts: {wire_key: 'userContexts', required: false, list: true}
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
# @api private
|
|
397
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
398
|
+
AuthRequiredParameters = Serialization::Record.define(
|
|
399
|
+
context: {wire_key: 'context', nullable: true},
|
|
400
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
401
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
402
|
+
redirect_count: 'redirectCount',
|
|
403
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
404
|
+
timestamp: 'timestamp',
|
|
405
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
406
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true},
|
|
407
|
+
response: {wire_key: 'response', ref: 'Network::ResponseData'}
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
# @api private
|
|
411
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
412
|
+
BeforeRequestSentParameters = Serialization::Record.define(
|
|
413
|
+
context: {wire_key: 'context', nullable: true},
|
|
414
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
415
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
416
|
+
redirect_count: 'redirectCount',
|
|
417
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
418
|
+
timestamp: 'timestamp',
|
|
419
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
420
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true},
|
|
421
|
+
initiator: {wire_key: 'initiator', required: false, ref: 'Network::Initiator'}
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
# @api private
|
|
425
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
426
|
+
FetchErrorParameters = Serialization::Record.define(
|
|
427
|
+
context: {wire_key: 'context', nullable: true},
|
|
428
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
429
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
430
|
+
redirect_count: 'redirectCount',
|
|
431
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
432
|
+
timestamp: 'timestamp',
|
|
433
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
434
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true},
|
|
435
|
+
error_text: {wire_key: 'errorText', primitive: 'string'}
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
# @api private
|
|
439
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
440
|
+
ResponseCompletedParameters = Serialization::Record.define(
|
|
441
|
+
context: {wire_key: 'context', nullable: true},
|
|
442
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
443
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
444
|
+
redirect_count: 'redirectCount',
|
|
445
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
446
|
+
timestamp: 'timestamp',
|
|
447
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
448
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true},
|
|
449
|
+
response: {wire_key: 'response', ref: 'Network::ResponseData'}
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
# @api private
|
|
453
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
454
|
+
ResponseStartedParameters = Serialization::Record.define(
|
|
455
|
+
context: {wire_key: 'context', nullable: true},
|
|
456
|
+
is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
|
|
457
|
+
navigation: {wire_key: 'navigation', nullable: true},
|
|
458
|
+
redirect_count: 'redirectCount',
|
|
459
|
+
request: {wire_key: 'request', ref: 'Network::RequestData'},
|
|
460
|
+
timestamp: 'timestamp',
|
|
461
|
+
user_context: {wire_key: 'userContext', required: false, nullable: true},
|
|
462
|
+
intercepts: {wire_key: 'intercepts', required: false, list: true},
|
|
463
|
+
response: {wire_key: 'response', ref: 'Network::ResponseData'}
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
EVENT_TYPES = {
|
|
467
|
+
'network.authRequired' => Network::AuthRequiredParameters,
|
|
468
|
+
'network.beforeRequestSent' => Network::BeforeRequestSentParameters,
|
|
469
|
+
'network.fetchError' => Network::FetchErrorParameters,
|
|
470
|
+
'network.responseCompleted' => Network::ResponseCompletedParameters,
|
|
471
|
+
'network.responseStarted' => Network::ResponseStartedParameters
|
|
472
|
+
}.freeze
|
|
473
|
+
|
|
474
|
+
# @api private
|
|
475
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
476
|
+
def add_data_collector(
|
|
477
|
+
data_types:,
|
|
478
|
+
max_encoded_data_size:,
|
|
479
|
+
collector_type: Serialization::UNSET,
|
|
480
|
+
contexts: Serialization::UNSET,
|
|
481
|
+
user_contexts: Serialization::UNSET
|
|
482
|
+
)
|
|
483
|
+
Serialization.validate!('dataTypes', data_types, Network::DATA_TYPE)
|
|
484
|
+
Serialization.validate!('collectorType', collector_type, Network::COLLECTOR_TYPE)
|
|
485
|
+
params = AddDataCollectorParameters.new(
|
|
486
|
+
data_types: data_types,
|
|
487
|
+
max_encoded_data_size: max_encoded_data_size,
|
|
488
|
+
collector_type: collector_type,
|
|
489
|
+
contexts: contexts,
|
|
490
|
+
user_contexts: user_contexts
|
|
491
|
+
)
|
|
492
|
+
execute(cmd: 'network.addDataCollector', params: params, result: Network::AddDataCollectorResult)
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
# @api private
|
|
496
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
497
|
+
def add_intercept(phases:, contexts: Serialization::UNSET, url_patterns: Serialization::UNSET)
|
|
498
|
+
Serialization.validate!('phases', phases, Network::INTERCEPT_PHASE)
|
|
499
|
+
params = AddInterceptParameters.new(phases: phases, contexts: contexts, url_patterns: url_patterns)
|
|
500
|
+
execute(cmd: 'network.addIntercept', params: params, result: Network::AddInterceptResult)
|
|
501
|
+
end
|
|
502
|
+
|
|
503
|
+
# @api private
|
|
504
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
505
|
+
def continue_request(
|
|
506
|
+
request:,
|
|
507
|
+
body: Serialization::UNSET,
|
|
508
|
+
cookies: Serialization::UNSET,
|
|
509
|
+
headers: Serialization::UNSET,
|
|
510
|
+
method_: Serialization::UNSET,
|
|
511
|
+
url: Serialization::UNSET
|
|
512
|
+
)
|
|
513
|
+
params = ContinueRequestParameters.new(
|
|
514
|
+
request: request,
|
|
515
|
+
body: body,
|
|
516
|
+
cookies: cookies,
|
|
517
|
+
headers: headers,
|
|
518
|
+
method_: method_,
|
|
519
|
+
url: url
|
|
520
|
+
)
|
|
521
|
+
execute(cmd: 'network.continueRequest', params: params)
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
# @api private
|
|
525
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
526
|
+
def continue_response(
|
|
527
|
+
request:,
|
|
528
|
+
cookies: Serialization::UNSET,
|
|
529
|
+
credentials: Serialization::UNSET,
|
|
530
|
+
headers: Serialization::UNSET,
|
|
531
|
+
reason_phrase: Serialization::UNSET,
|
|
532
|
+
status_code: Serialization::UNSET
|
|
533
|
+
)
|
|
534
|
+
params = ContinueResponseParameters.new(
|
|
535
|
+
request: request,
|
|
536
|
+
cookies: cookies,
|
|
537
|
+
credentials: credentials,
|
|
538
|
+
headers: headers,
|
|
539
|
+
reason_phrase: reason_phrase,
|
|
540
|
+
status_code: status_code
|
|
541
|
+
)
|
|
542
|
+
execute(cmd: 'network.continueResponse', params: params)
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# @api private
|
|
546
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
547
|
+
def continue_with_auth(request:, action:, credentials: Serialization::UNSET)
|
|
548
|
+
Serialization.validate!(
|
|
549
|
+
'action',
|
|
550
|
+
action,
|
|
551
|
+
{provide_credentials: 'provideCredentials', default: 'default', cancel: 'cancel'}
|
|
552
|
+
)
|
|
553
|
+
params = ContinueWithAuthParameters.build(request: request, action: action, credentials: credentials)
|
|
554
|
+
execute(cmd: 'network.continueWithAuth', params: params)
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
# @api private
|
|
558
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
559
|
+
def disown_data(data_type:, collector:, request:)
|
|
560
|
+
Serialization.validate!('dataType', data_type, Network::DATA_TYPE)
|
|
561
|
+
params = DisownDataParameters.new(data_type: data_type, collector: collector, request: request)
|
|
562
|
+
execute(cmd: 'network.disownData', params: params)
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# @api private
|
|
566
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
567
|
+
def fail_request(request:)
|
|
568
|
+
params = FailRequestParameters.new(request: request)
|
|
569
|
+
execute(cmd: 'network.failRequest', params: params)
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# @api private
|
|
573
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
574
|
+
def get_data(data_type:, request:, collector: Serialization::UNSET, disown: Serialization::UNSET)
|
|
575
|
+
Serialization.validate!('dataType', data_type, Network::DATA_TYPE)
|
|
576
|
+
params = GetDataParameters.new(data_type: data_type, collector: collector, disown: disown, request: request)
|
|
577
|
+
execute(cmd: 'network.getData', params: params, result: Network::GetDataResult)
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# @api private
|
|
581
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
582
|
+
def provide_response(
|
|
583
|
+
request:,
|
|
584
|
+
body: Serialization::UNSET,
|
|
585
|
+
cookies: Serialization::UNSET,
|
|
586
|
+
headers: Serialization::UNSET,
|
|
587
|
+
reason_phrase: Serialization::UNSET,
|
|
588
|
+
status_code: Serialization::UNSET
|
|
589
|
+
)
|
|
590
|
+
params = ProvideResponseParameters.new(
|
|
591
|
+
request: request,
|
|
592
|
+
body: body,
|
|
593
|
+
cookies: cookies,
|
|
594
|
+
headers: headers,
|
|
595
|
+
reason_phrase: reason_phrase,
|
|
596
|
+
status_code: status_code
|
|
597
|
+
)
|
|
598
|
+
execute(cmd: 'network.provideResponse', params: params)
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
# @api private
|
|
602
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
603
|
+
def remove_data_collector(collector:)
|
|
604
|
+
params = RemoveDataCollectorParameters.new(collector: collector)
|
|
605
|
+
execute(cmd: 'network.removeDataCollector', params: params)
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
# @api private
|
|
609
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
610
|
+
def remove_intercept(intercept:)
|
|
611
|
+
params = RemoveInterceptParameters.new(intercept: intercept)
|
|
612
|
+
execute(cmd: 'network.removeIntercept', params: params)
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
# @api private
|
|
616
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
617
|
+
def set_cache_behavior(cache_behavior:, contexts: Serialization::UNSET)
|
|
618
|
+
Serialization.validate!(
|
|
619
|
+
'cacheBehavior',
|
|
620
|
+
cache_behavior,
|
|
621
|
+
Network::SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR
|
|
622
|
+
)
|
|
623
|
+
params = SetCacheBehaviorParameters.new(cache_behavior: cache_behavior, contexts: contexts)
|
|
624
|
+
execute(cmd: 'network.setCacheBehavior', params: params)
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
# @api private
|
|
628
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
629
|
+
def set_extra_headers(headers:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
|
|
630
|
+
params = SetExtraHeadersParameters.new(headers: headers, contexts: contexts, user_contexts: user_contexts)
|
|
631
|
+
execute(cmd: 'network.setExtraHeaders', params: params)
|
|
632
|
+
end
|
|
633
|
+
end # Network
|
|
634
|
+
end # Protocol
|
|
635
|
+
end # BiDi
|
|
636
|
+
end # WebDriver
|
|
637
|
+
end # Selenium
|