selenium-webdriver 4.51.0 → 4.52.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 +15 -0
- data/Gemfile +14 -0
- data/README.md +20 -0
- data/bin/linux-arm64/selenium-manager +0 -0
- data/bin/linux-x86_64/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +543 -226
- data/bin/selenium-manager.cdx.json +804 -722
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/atoms/findElements.js +960 -250
- data/lib/selenium/webdriver/atoms/getAttribute.js +153 -127
- data/lib/selenium/webdriver/atoms/isDisplayed.js +433 -364
- data/lib/selenium/webdriver/atoms.rb +4 -1
- data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +6 -6
- data/lib/selenium/webdriver/bidi/protocol/browser.rb +21 -9
- data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +109 -39
- data/lib/selenium/webdriver/bidi/protocol/emulation.rb +89 -44
- data/lib/selenium/webdriver/bidi/protocol/input.rb +95 -31
- data/lib/selenium/webdriver/bidi/protocol/log.rb +4 -4
- data/lib/selenium/webdriver/bidi/protocol/moz_debugging.rb +12 -10
- data/lib/selenium/webdriver/bidi/protocol/moz_profiler.rb +4 -4
- data/lib/selenium/webdriver/bidi/protocol/network.rb +82 -39
- data/lib/selenium/webdriver/bidi/protocol/script.rb +38 -24
- data/lib/selenium/webdriver/bidi/protocol/session.rb +61 -8
- data/lib/selenium/webdriver/bidi/protocol/storage.rb +3 -3
- data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +3 -3
- data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +17 -9
- data/lib/selenium/webdriver/bidi/serialization/record.rb +66 -24
- data/lib/selenium/webdriver/bidi/serialization.rb +2 -2
- data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +228 -150
- data/lib/selenium/webdriver/common/client_config.rb +4 -1
- data/lib/selenium/webdriver/common/driver_finder.rb +5 -2
- data/lib/selenium/webdriver/common/websocket_connection.rb +51 -13
- data/lib/selenium/webdriver/remote/http/default.rb +17 -1
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +0 -12
- metadata +6 -163
|
@@ -28,7 +28,10 @@ module Selenium
|
|
|
28
28
|
private
|
|
29
29
|
|
|
30
30
|
def read_atom(function)
|
|
31
|
-
|
|
31
|
+
file = "selenium/webdriver/atoms/#{function}.js"
|
|
32
|
+
lib = File.expand_path('../..', __dir__.to_s)
|
|
33
|
+
dir = [lib, *$LOAD_PATH].find { |path| File.exist?(File.expand_path(file, path)) }
|
|
34
|
+
File.read(File.expand_path(file, dir || lib))
|
|
32
35
|
end
|
|
33
36
|
|
|
34
37
|
def execute_atom(function_name, *)
|
|
@@ -115,7 +115,7 @@ module Selenium
|
|
|
115
115
|
# @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothscanrecord
|
|
116
116
|
ScanRecord = Serialization::Record.define(
|
|
117
117
|
name: {wire_key: 'name', required: false, primitive: 'string'},
|
|
118
|
-
uuids: {wire_key: 'uuids', required: false, list: true},
|
|
118
|
+
uuids: {wire_key: 'uuids', required: false, list: true, primitive: 'string'},
|
|
119
119
|
appearance: {wire_key: 'appearance', required: false, primitive: 'number'},
|
|
120
120
|
manufacturer_data: {
|
|
121
121
|
wire_key: 'manufacturerData',
|
|
@@ -181,7 +181,7 @@ module Selenium
|
|
|
181
181
|
address: {wire_key: 'address', primitive: 'string'},
|
|
182
182
|
name: {wire_key: 'name', primitive: 'string'},
|
|
183
183
|
manufacturer_data: {wire_key: 'manufacturerData', ref: 'Bluetooth::BluetoothManufacturerData', list: true},
|
|
184
|
-
known_service_uuids: {wire_key: 'knownServiceUuids', list: true}
|
|
184
|
+
known_service_uuids: {wire_key: 'knownServiceUuids', list: true, primitive: 'string'}
|
|
185
185
|
)
|
|
186
186
|
|
|
187
187
|
# @api private
|
|
@@ -254,7 +254,7 @@ module Selenium
|
|
|
254
254
|
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
255
255
|
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_CHARACTERISTIC_RESPONSE_PARAMETERS_TYPE'},
|
|
256
256
|
code: {wire_key: 'code', primitive: 'integer'},
|
|
257
|
-
data: {wire_key: 'data', required: false, list: true}
|
|
257
|
+
data: {wire_key: 'data', required: false, list: true, primitive: 'integer'}
|
|
258
258
|
)
|
|
259
259
|
|
|
260
260
|
# @api private
|
|
@@ -280,7 +280,7 @@ module Selenium
|
|
|
280
280
|
descriptor_uuid: {wire_key: 'descriptorUuid', primitive: 'string'},
|
|
281
281
|
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_DESCRIPTOR_RESPONSE_PARAMETERS_TYPE'},
|
|
282
282
|
code: {wire_key: 'code', primitive: 'integer'},
|
|
283
|
-
data: {wire_key: 'data', required: false, list: true}
|
|
283
|
+
data: {wire_key: 'data', required: false, list: true, primitive: 'integer'}
|
|
284
284
|
)
|
|
285
285
|
|
|
286
286
|
# @api private
|
|
@@ -309,7 +309,7 @@ module Selenium
|
|
|
309
309
|
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
310
310
|
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
311
311
|
type: {wire_key: 'type', enum: 'Bluetooth::CHARACTERISTIC_EVENT_GENERATED_PARAMETERS_TYPE'},
|
|
312
|
-
data: {wire_key: 'data', required: false, list: true}
|
|
312
|
+
data: {wire_key: 'data', required: false, list: true, primitive: 'integer'}
|
|
313
313
|
)
|
|
314
314
|
|
|
315
315
|
# @api private
|
|
@@ -322,7 +322,7 @@ module Selenium
|
|
|
322
322
|
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
323
323
|
descriptor_uuid: {wire_key: 'descriptorUuid', primitive: 'string'},
|
|
324
324
|
type: {wire_key: 'type', enum: 'Bluetooth::DESCRIPTOR_EVENT_GENERATED_PARAMETERS_TYPE'},
|
|
325
|
-
data: {wire_key: 'data', required: false, list: true}
|
|
325
|
+
data: {wire_key: 'data', required: false, list: true, primitive: 'integer'}
|
|
326
326
|
)
|
|
327
327
|
|
|
328
328
|
EVENT_TYPES = {
|
|
@@ -47,11 +47,11 @@ module Selenium
|
|
|
47
47
|
ClientWindowInfo = Serialization::Record.define(
|
|
48
48
|
active: {wire_key: 'active', primitive: 'boolean'},
|
|
49
49
|
client_window: {wire_key: 'clientWindow', primitive: 'string'},
|
|
50
|
-
height: {wire_key: 'height', primitive: 'integer'},
|
|
50
|
+
height: {wire_key: 'height', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
51
51
|
state: {wire_key: 'state', enum: 'Browser::CLIENT_WINDOW_INFO_STATE'},
|
|
52
|
-
width: {wire_key: 'width', primitive: 'integer'},
|
|
53
|
-
x: {wire_key: 'x', primitive: 'integer'},
|
|
54
|
-
y: {wire_key: 'y', primitive: 'integer'}
|
|
52
|
+
width: {wire_key: 'width', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
53
|
+
x: {wire_key: 'x', primitive: 'integer', min: -9_007_199_254_740_991, max: 9_007_199_254_740_991},
|
|
54
|
+
y: {wire_key: 'y', primitive: 'integer', min: -9_007_199_254_740_991, max: 9_007_199_254_740_991}
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
# @api private
|
|
@@ -116,10 +116,22 @@ module Selenium
|
|
|
116
116
|
ClientWindowRectState = Serialization::Record.define(
|
|
117
117
|
state: {fixed: 'normal'},
|
|
118
118
|
client_window: {wire_key: 'clientWindow', primitive: 'string'},
|
|
119
|
-
width: {wire_key: 'width', required: false, primitive: 'integer'},
|
|
120
|
-
height: {wire_key: 'height', required: false, primitive: 'integer'},
|
|
121
|
-
x: {
|
|
122
|
-
|
|
119
|
+
width: {wire_key: 'width', required: false, primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
120
|
+
height: {wire_key: 'height', required: false, primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
121
|
+
x: {
|
|
122
|
+
wire_key: 'x',
|
|
123
|
+
required: false,
|
|
124
|
+
primitive: 'integer',
|
|
125
|
+
min: -9_007_199_254_740_991,
|
|
126
|
+
max: 9_007_199_254_740_991
|
|
127
|
+
},
|
|
128
|
+
y: {
|
|
129
|
+
wire_key: 'y',
|
|
130
|
+
required: false,
|
|
131
|
+
primitive: 'integer',
|
|
132
|
+
min: -9_007_199_254_740_991,
|
|
133
|
+
max: 9_007_199_254_740_991
|
|
134
|
+
}
|
|
123
135
|
)
|
|
124
136
|
|
|
125
137
|
def self.normal(**) = Browser::SetClientWindowStateParameters::ClientWindowRectState.new(**)
|
|
@@ -130,7 +142,7 @@ module Selenium
|
|
|
130
142
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsersetdownloadbehaviorparameters
|
|
131
143
|
SetDownloadBehaviorParameters = Serialization::Record.define(
|
|
132
144
|
download_behavior: {wire_key: 'downloadBehavior', nullable: true, ref: 'Browser::DownloadBehavior'},
|
|
133
|
-
user_contexts: {wire_key: 'userContexts', required: false, list: true}
|
|
145
|
+
user_contexts: {wire_key: 'userContexts', required: false, list: true, primitive: 'string'}
|
|
134
146
|
)
|
|
135
147
|
|
|
136
148
|
# @api private
|
|
@@ -81,6 +81,11 @@ module Selenium
|
|
|
81
81
|
landscape: 'landscape'
|
|
82
82
|
}.freeze
|
|
83
83
|
|
|
84
|
+
MOZ_SCOPE = {
|
|
85
|
+
chrome: 'chrome',
|
|
86
|
+
content: 'content'
|
|
87
|
+
}.freeze
|
|
88
|
+
|
|
84
89
|
# @api private
|
|
85
90
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
86
91
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextbaseinfo
|
|
@@ -105,7 +110,8 @@ module Selenium
|
|
|
105
110
|
url: {wire_key: 'url', primitive: 'string'},
|
|
106
111
|
user_context: {wire_key: 'userContext', primitive: 'string'},
|
|
107
112
|
parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'},
|
|
108
|
-
|
|
113
|
+
moz_name: {wire_key: 'moz:name', required: false, primitive: 'string'},
|
|
114
|
+
moz_scope: {wire_key: 'moz:scope', required: false, enum: 'BrowsingContext::MOZ_SCOPE'}
|
|
109
115
|
)
|
|
110
116
|
|
|
111
117
|
# @api private
|
|
@@ -177,8 +183,12 @@ module Selenium
|
|
|
177
183
|
type: {fixed: 'innerText'},
|
|
178
184
|
value: {wire_key: 'value', primitive: 'string'},
|
|
179
185
|
ignore_case: {wire_key: 'ignoreCase', required: false, primitive: 'boolean'},
|
|
180
|
-
match_type: {
|
|
181
|
-
|
|
186
|
+
match_type: {
|
|
187
|
+
wire_key: 'matchType',
|
|
188
|
+
required: false,
|
|
189
|
+
enum: 'BrowsingContext::INNER_TEXT_LOCATOR_MATCH_TYPE'
|
|
190
|
+
},
|
|
191
|
+
max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer', min: 0, max: 9_007_199_254_740_991}
|
|
182
192
|
)
|
|
183
193
|
|
|
184
194
|
# @api private
|
|
@@ -195,7 +205,7 @@ module Selenium
|
|
|
195
205
|
BaseNavigationInfo = Serialization::Record.define(
|
|
196
206
|
context: {wire_key: 'context', primitive: 'string'},
|
|
197
207
|
navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
|
|
198
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
208
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
199
209
|
url: {wire_key: 'url', primitive: 'string'},
|
|
200
210
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
201
211
|
)
|
|
@@ -206,7 +216,7 @@ module Selenium
|
|
|
206
216
|
NavigationInfo = Serialization::Record.define(
|
|
207
217
|
context: {wire_key: 'context', primitive: 'string'},
|
|
208
218
|
navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
|
|
209
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
219
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
210
220
|
url: {wire_key: 'url', primitive: 'string'},
|
|
211
221
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
212
222
|
)
|
|
@@ -221,7 +231,11 @@ module Selenium
|
|
|
221
231
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcapturescreenshotparameters
|
|
222
232
|
CaptureScreenshotParameters = Serialization::Record.define(
|
|
223
233
|
context: {wire_key: 'context', primitive: 'string'},
|
|
224
|
-
origin: {
|
|
234
|
+
origin: {
|
|
235
|
+
wire_key: 'origin',
|
|
236
|
+
required: false,
|
|
237
|
+
enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'
|
|
238
|
+
},
|
|
225
239
|
format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
|
|
226
240
|
clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'},
|
|
227
241
|
image_size: {wire_key: 'imageSize', required: false, ref: 'BrowsingContext::ImageSize'}
|
|
@@ -232,15 +246,27 @@ module Selenium
|
|
|
232
246
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimageformat
|
|
233
247
|
ImageFormat = Serialization::Record.define(
|
|
234
248
|
type: {wire_key: 'type', primitive: 'string'},
|
|
235
|
-
quality: {wire_key: 'quality', required: false, primitive: 'number'}
|
|
249
|
+
quality: {wire_key: 'quality', required: false, primitive: 'number', min: 0, max: 1}
|
|
236
250
|
)
|
|
237
251
|
|
|
238
252
|
# @api private
|
|
239
253
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
240
254
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimagesize
|
|
241
255
|
ImageSize = Serialization::Record.define(
|
|
242
|
-
max_width: {
|
|
243
|
-
|
|
256
|
+
max_width: {
|
|
257
|
+
wire_key: 'maxWidth',
|
|
258
|
+
required: false,
|
|
259
|
+
primitive: 'integer',
|
|
260
|
+
min: 1,
|
|
261
|
+
max: 9_007_199_254_740_991
|
|
262
|
+
},
|
|
263
|
+
max_height: {
|
|
264
|
+
wire_key: 'maxHeight',
|
|
265
|
+
required: false,
|
|
266
|
+
primitive: 'integer',
|
|
267
|
+
min: 1,
|
|
268
|
+
max: 9_007_199_254_740_991
|
|
269
|
+
}
|
|
244
270
|
)
|
|
245
271
|
|
|
246
272
|
# @api private
|
|
@@ -312,9 +338,14 @@ module Selenium
|
|
|
312
338
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
313
339
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeparameters
|
|
314
340
|
GetTreeParameters = Serialization::Record.define(
|
|
315
|
-
max_depth: {
|
|
316
|
-
|
|
317
|
-
|
|
341
|
+
max_depth: {
|
|
342
|
+
wire_key: 'maxDepth',
|
|
343
|
+
required: false,
|
|
344
|
+
primitive: 'integer',
|
|
345
|
+
min: 0,
|
|
346
|
+
max: 9_007_199_254_740_991
|
|
347
|
+
},
|
|
348
|
+
root: {wire_key: 'root', required: false, primitive: 'string'}
|
|
318
349
|
)
|
|
319
350
|
|
|
320
351
|
# @api private
|
|
@@ -339,7 +370,13 @@ module Selenium
|
|
|
339
370
|
LocateNodesParameters = Serialization::Record.define(
|
|
340
371
|
context: {wire_key: 'context', primitive: 'string'},
|
|
341
372
|
locator: {wire_key: 'locator', ref: 'BrowsingContext::Locator'},
|
|
342
|
-
max_node_count: {
|
|
373
|
+
max_node_count: {
|
|
374
|
+
wire_key: 'maxNodeCount',
|
|
375
|
+
required: false,
|
|
376
|
+
primitive: 'integer',
|
|
377
|
+
min: 1,
|
|
378
|
+
max: 9_007_199_254_740_991
|
|
379
|
+
},
|
|
343
380
|
serialization_options: {
|
|
344
381
|
wire_key: 'serializationOptions',
|
|
345
382
|
required: false,
|
|
@@ -385,8 +422,15 @@ module Selenium
|
|
|
385
422
|
enum: 'BrowsingContext::PRINT_PARAMETERS_ORIENTATION'
|
|
386
423
|
},
|
|
387
424
|
page: {wire_key: 'page', required: false, ref: 'BrowsingContext::PrintPageParameters'},
|
|
388
|
-
page_ranges: {
|
|
389
|
-
|
|
425
|
+
page_ranges: {
|
|
426
|
+
wire_key: 'pageRanges',
|
|
427
|
+
required: false,
|
|
428
|
+
list: true,
|
|
429
|
+
primitive: %w[integer string],
|
|
430
|
+
min: 0,
|
|
431
|
+
max: 9_007_199_254_740_991
|
|
432
|
+
},
|
|
433
|
+
scale: {wire_key: 'scale', required: false, primitive: 'number', min: 0.1, max: 2},
|
|
390
434
|
shrink_to_fit: {wire_key: 'shrinkToFit', required: false, primitive: 'boolean'}
|
|
391
435
|
)
|
|
392
436
|
|
|
@@ -394,18 +438,18 @@ module Selenium
|
|
|
394
438
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
395
439
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintmarginparameters
|
|
396
440
|
PrintMarginParameters = Serialization::Record.define(
|
|
397
|
-
bottom: {wire_key: 'bottom', required: false, primitive: 'number'},
|
|
398
|
-
left: {wire_key: 'left', required: false, primitive: 'number'},
|
|
399
|
-
right: {wire_key: 'right', required: false, primitive: 'number'},
|
|
400
|
-
top: {wire_key: 'top', required: false, primitive: 'number'}
|
|
441
|
+
bottom: {wire_key: 'bottom', required: false, primitive: 'number', min: 0},
|
|
442
|
+
left: {wire_key: 'left', required: false, primitive: 'number', min: 0},
|
|
443
|
+
right: {wire_key: 'right', required: false, primitive: 'number', min: 0},
|
|
444
|
+
top: {wire_key: 'top', required: false, primitive: 'number', min: 0}
|
|
401
445
|
)
|
|
402
446
|
|
|
403
447
|
# @api private
|
|
404
448
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
405
449
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintpageparameters
|
|
406
450
|
PrintPageParameters = Serialization::Record.define(
|
|
407
|
-
height: {wire_key: 'height', required: false, primitive: 'number'},
|
|
408
|
-
width: {wire_key: 'width', required: false, primitive: 'number'}
|
|
451
|
+
height: {wire_key: 'height', required: false, primitive: 'number', min: 0.0352},
|
|
452
|
+
width: {wire_key: 'width', required: false, primitive: 'number', min: 0.0352}
|
|
409
453
|
)
|
|
410
454
|
|
|
411
455
|
# @api private
|
|
@@ -427,8 +471,8 @@ module Selenium
|
|
|
427
471
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextsetbypasscspparameters
|
|
428
472
|
SetBypassCSPParameters = Serialization::Record.define(
|
|
429
473
|
bypass: {wire_key: 'bypass', nullable: true, const: true},
|
|
430
|
-
contexts: {wire_key: 'contexts', required: false, list: true},
|
|
431
|
-
user_contexts: {wire_key: 'userContexts', required: false, list: true}
|
|
474
|
+
contexts: {wire_key: 'contexts', required: false, list: true, primitive: 'string'},
|
|
475
|
+
user_contexts: {wire_key: 'userContexts', required: false, list: true, primitive: 'string'}
|
|
432
476
|
)
|
|
433
477
|
|
|
434
478
|
# @api private
|
|
@@ -437,16 +481,23 @@ module Selenium
|
|
|
437
481
|
SetViewportParameters = Serialization::Record.define(
|
|
438
482
|
context: {wire_key: 'context', required: false, primitive: 'string'},
|
|
439
483
|
viewport: {wire_key: 'viewport', required: false, nullable: true, ref: 'BrowsingContext::Viewport'},
|
|
440
|
-
device_pixel_ratio: {
|
|
441
|
-
|
|
484
|
+
device_pixel_ratio: {
|
|
485
|
+
wire_key: 'devicePixelRatio',
|
|
486
|
+
required: false,
|
|
487
|
+
nullable: true,
|
|
488
|
+
primitive: 'number',
|
|
489
|
+
min: 0,
|
|
490
|
+
exclusive_min: true
|
|
491
|
+
},
|
|
492
|
+
user_contexts: {wire_key: 'userContexts', required: false, list: true, primitive: 'string'}
|
|
442
493
|
)
|
|
443
494
|
|
|
444
495
|
# @api private
|
|
445
496
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
446
497
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextviewport
|
|
447
498
|
Viewport = Serialization::Record.define(
|
|
448
|
-
width: {wire_key: 'width', primitive: 'integer'},
|
|
449
|
-
height: {wire_key: 'height', primitive: 'integer'}
|
|
499
|
+
width: {wire_key: 'width', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
500
|
+
height: {wire_key: 'height', primitive: 'integer', min: 0, max: 9_007_199_254_740_991}
|
|
450
501
|
)
|
|
451
502
|
|
|
452
503
|
# @api private
|
|
@@ -464,9 +515,15 @@ module Selenium
|
|
|
464
515
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
465
516
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextmediatrackconstraints
|
|
466
517
|
MediaTrackConstraints = Serialization::Record.define(
|
|
467
|
-
width: {wire_key: 'width', required: false, primitive: 'integer'},
|
|
468
|
-
height: {wire_key: 'height', required: false, primitive: 'integer'},
|
|
469
|
-
frame_rate: {
|
|
518
|
+
width: {wire_key: 'width', required: false, primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
519
|
+
height: {wire_key: 'height', required: false, primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
520
|
+
frame_rate: {
|
|
521
|
+
wire_key: 'frameRate',
|
|
522
|
+
required: false,
|
|
523
|
+
primitive: 'integer',
|
|
524
|
+
min: 0,
|
|
525
|
+
max: 9_007_199_254_740_991
|
|
526
|
+
}
|
|
470
527
|
)
|
|
471
528
|
|
|
472
529
|
# @api private
|
|
@@ -497,7 +554,7 @@ module Selenium
|
|
|
497
554
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexttraversehistoryparameters
|
|
498
555
|
TraverseHistoryParameters = Serialization::Record.define(
|
|
499
556
|
context: {wire_key: 'context', primitive: 'string'},
|
|
500
|
-
delta: {wire_key: 'delta', primitive: 'integer'}
|
|
557
|
+
delta: {wire_key: 'delta', primitive: 'integer', min: -9_007_199_254_740_991, max: 9_007_199_254_740_991}
|
|
501
558
|
)
|
|
502
559
|
|
|
503
560
|
# @api private
|
|
@@ -505,7 +562,7 @@ module Selenium
|
|
|
505
562
|
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexthistoryupdatedparameters
|
|
506
563
|
HistoryUpdatedParameters = Serialization::Record.define(
|
|
507
564
|
context: {wire_key: 'context', primitive: 'string'},
|
|
508
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
565
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
509
566
|
url: {wire_key: 'url', primitive: 'string'},
|
|
510
567
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
511
568
|
)
|
|
@@ -518,7 +575,7 @@ module Selenium
|
|
|
518
575
|
suggested_filename: {wire_key: 'suggestedFilename', primitive: 'string'},
|
|
519
576
|
context: {wire_key: 'context', primitive: 'string'},
|
|
520
577
|
navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
|
|
521
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
578
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
522
579
|
url: {wire_key: 'url', primitive: 'string'},
|
|
523
580
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
524
581
|
)
|
|
@@ -541,7 +598,7 @@ module Selenium
|
|
|
541
598
|
download: {wire_key: 'download', primitive: 'string'},
|
|
542
599
|
context: {wire_key: 'context', primitive: 'string'},
|
|
543
600
|
navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
|
|
544
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
601
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
545
602
|
url: {wire_key: 'url', primitive: 'string'},
|
|
546
603
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
547
604
|
)
|
|
@@ -554,7 +611,7 @@ module Selenium
|
|
|
554
611
|
filepath: {wire_key: 'filepath', nullable: true, primitive: 'string'},
|
|
555
612
|
context: {wire_key: 'context', primitive: 'string'},
|
|
556
613
|
navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
|
|
557
|
-
timestamp: {wire_key: 'timestamp', primitive: 'integer'},
|
|
614
|
+
timestamp: {wire_key: 'timestamp', primitive: 'integer', min: 0, max: 9_007_199_254_740_991},
|
|
558
615
|
url: {wire_key: 'url', primitive: 'string'},
|
|
559
616
|
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
|
|
560
617
|
)
|
|
@@ -851,14 +908,27 @@ module Selenium
|
|
|
851
908
|
# moz: vendor variant of BrowsingContext, with browser-specific commands and params.
|
|
852
909
|
# Construct Moz.new(source) for a matching session; other sessions use BrowsingContext.
|
|
853
910
|
class Moz < BrowsingContext
|
|
911
|
+
# @api private
|
|
912
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
913
|
+
# @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeparameters
|
|
914
|
+
GetTreeParameters = Serialization::Record.define(
|
|
915
|
+
max_depth: {
|
|
916
|
+
wire_key: 'maxDepth',
|
|
917
|
+
required: false,
|
|
918
|
+
primitive: 'integer',
|
|
919
|
+
min: 0,
|
|
920
|
+
max: 9_007_199_254_740_991
|
|
921
|
+
},
|
|
922
|
+
root: {wire_key: 'root', required: false, primitive: 'string'},
|
|
923
|
+
scope: {wire_key: 'moz:scope', required: false, enum: 'BrowsingContext::MOZ_SCOPE'}
|
|
924
|
+
)
|
|
925
|
+
|
|
854
926
|
# @api private
|
|
855
927
|
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
856
928
|
# @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
|
|
857
929
|
def get_tree(max_depth: Serialization::UNSET, root: Serialization::UNSET, scope: Serialization::UNSET)
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
}.reject { |_, value| Serialization::UNSET.equal?(value) }
|
|
861
|
-
params = GetTreeParameters.new(max_depth: max_depth, root: root, extensions: extensions)
|
|
930
|
+
Serialization.validate!('moz:scope', scope, BrowsingContext::MOZ_SCOPE)
|
|
931
|
+
params = GetTreeParameters.new(max_depth: max_depth, root: root, scope: scope)
|
|
862
932
|
execute(cmd: 'browsingContext.getTree', params: params, result: BrowsingContext::GetTreeResult)
|
|
863
933
|
end
|
|
864
934
|
end
|