selenium-webdriver 4.46.0 → 4.47.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +29 -0
  3. data/bin/linux/selenium-manager +0 -0
  4. data/bin/macos/selenium-manager +0 -0
  5. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
  6. data/bin/selenium-manager.cdx.json +11629 -0
  7. data/bin/windows/selenium-manager.exe +0 -0
  8. data/lib/selenium/webdriver/{common/driver_extensions/has_bidi.rb → bidi/error.rb} +21 -13
  9. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +53 -23
  10. data/lib/selenium/webdriver/bidi/protocol/browser.rb +43 -15
  11. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +172 -68
  12. data/lib/selenium/webdriver/bidi/protocol/domain.rb +8 -2
  13. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +123 -9
  14. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  15. data/lib/selenium/webdriver/bidi/protocol/input.rb +101 -28
  16. data/lib/selenium/webdriver/bidi/protocol/log.rb +17 -6
  17. data/lib/selenium/webdriver/bidi/protocol/network.rb +146 -63
  18. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +4 -2
  19. data/lib/selenium/webdriver/bidi/protocol/script.rb +264 -86
  20. data/lib/selenium/webdriver/bidi/protocol/session.rb +48 -3
  21. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +4 -2
  22. data/lib/selenium/webdriver/bidi/protocol/storage.rb +32 -6
  23. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +7 -2
  24. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +49 -10
  25. data/lib/selenium/webdriver/bidi/protocol.rb +3 -0
  26. data/lib/selenium/webdriver/bidi/serialization/record.rb +194 -18
  27. data/lib/selenium/webdriver/bidi/serialization/union.rb +45 -3
  28. data/lib/selenium/webdriver/bidi/serialization.rb +13 -1
  29. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +529 -45
  30. data/lib/selenium/webdriver/bidi/support/check_generated.rb +12 -4
  31. data/lib/selenium/webdriver/bidi/transport.rb +8 -3
  32. data/lib/selenium/webdriver/chrome/service.rb +4 -1
  33. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  34. data/lib/selenium/webdriver/chromium/options.rb +20 -0
  35. data/lib/selenium/webdriver/common/driver.rb +11 -0
  36. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  37. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  38. data/lib/selenium/webdriver/common/driver_finder.rb +4 -3
  39. data/lib/selenium/webdriver/common/options.rb +21 -1
  40. data/lib/selenium/webdriver/common/proxy.rb +0 -8
  41. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  42. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  43. data/lib/selenium/webdriver/common.rb +0 -1
  44. data/lib/selenium/webdriver/edge/service.rb +4 -1
  45. data/lib/selenium/webdriver/firefox/driver.rb +0 -3
  46. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  47. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  48. data/lib/selenium/webdriver/remote/bidi_bridge.rb +39 -12
  49. data/lib/selenium/webdriver/remote/bridge.rb +1 -1
  50. data/lib/selenium/webdriver/remote/driver.rb +3 -1
  51. data/lib/selenium/webdriver/remote/http/default.rb +1 -1
  52. data/lib/selenium/webdriver/safari/options.rb +16 -1
  53. data/lib/selenium/webdriver/support/guards/guard.rb +20 -3
  54. data/lib/selenium/webdriver/support/guards.rb +9 -3
  55. data/lib/selenium/webdriver/version.rb +1 -1
  56. metadata +6 -3
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
20
+ # DO NOT EDIT! This file is generated by rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb.
21
+ # Regenerate with: `bazel run //rb/lib/selenium/webdriver:bidi-generate`
22
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -26,6 +26,7 @@ module Selenium
26
26
  module Protocol
27
27
  # @api private
28
28
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ # @see https://w3c.github.io/webdriver-bidi/#module-script
29
30
  class Script < Domain
30
31
  EVENTS = {
31
32
  message: 'script.message',
@@ -33,6 +34,7 @@ module Selenium
33
34
  realm_destroyed: 'script.realmDestroyed'
34
35
  }.freeze
35
36
 
37
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptspecialnumber
36
38
  SPECIAL_NUMBER = {
37
39
  na_n: 'NaN',
38
40
  neg0: '-0',
@@ -40,6 +42,7 @@ module Selenium
40
42
  neg_infinity: '-Infinity'
41
43
  }.freeze
42
44
 
45
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-RealmType
43
46
  REALM_TYPE = {
44
47
  window: 'window',
45
48
  dedicated_worker: 'dedicated-worker',
@@ -51,6 +54,7 @@ module Selenium
51
54
  worklet: 'worklet'
52
55
  }.freeze
53
56
 
57
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-ResultOwnership
54
58
  RESULT_OWNERSHIP = {
55
59
  root: 'root',
56
60
  none: 'none'
@@ -69,6 +73,7 @@ module Selenium
69
73
 
70
74
  # @api private
71
75
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
76
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-ChannelValue
72
77
  ChannelValue = Serialization::Record.define(
73
78
  type: {fixed: 'channel'},
74
79
  value: {wire_key: 'value', ref: 'Script::ChannelProperties'}
@@ -76,8 +81,9 @@ module Selenium
76
81
 
77
82
  # @api private
78
83
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
84
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptchannelproperties
79
85
  ChannelProperties = Serialization::Record.define(
80
- channel: 'channel',
86
+ channel: {wire_key: 'channel', primitive: 'string'},
81
87
  serialization_options: {
82
88
  wire_key: 'serializationOptions',
83
89
  required: false,
@@ -88,42 +94,51 @@ module Selenium
88
94
 
89
95
  # @api private
90
96
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
97
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-EvaluateResult
91
98
  class EvaluateResult < Serialization::Union
92
99
  discriminator 'type', {success: 'success', exception: 'exception'}
93
100
  variants(
94
101
  success: 'Script::EvaluateResultSuccess',
95
102
  exception: 'Script::EvaluateResultException'
96
103
  )
104
+ object_only
105
+
106
+ def self.success(**) = Script::EvaluateResultSuccess.new(**)
107
+ def self.exception(**) = Script::EvaluateResultException.new(**)
97
108
  end
98
109
 
99
110
  # @api private
100
111
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
112
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptevaluateresultsuccess
101
113
  EvaluateResultSuccess = Serialization::Record.define(
102
114
  type: {fixed: 'success'},
103
115
  result: {wire_key: 'result', ref: 'Script::RemoteValue'},
104
- realm: 'realm'
116
+ realm: {wire_key: 'realm', primitive: 'string'}
105
117
  )
106
118
 
107
119
  # @api private
108
120
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
121
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptevaluateresultexception
109
122
  EvaluateResultException = Serialization::Record.define(
110
123
  type: {fixed: 'exception'},
111
124
  exception_details: {wire_key: 'exceptionDetails', ref: 'Script::ExceptionDetails'},
112
- realm: 'realm'
125
+ realm: {wire_key: 'realm', primitive: 'string'}
113
126
  )
114
127
 
115
128
  # @api private
116
129
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
130
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-ExceptionDetails
117
131
  ExceptionDetails = Serialization::Record.define(
118
- column_number: 'columnNumber',
132
+ column_number: {wire_key: 'columnNumber', primitive: 'integer'},
119
133
  exception: {wire_key: 'exception', ref: 'Script::RemoteValue'},
120
- line_number: 'lineNumber',
134
+ line_number: {wire_key: 'lineNumber', primitive: 'integer'},
121
135
  stack_trace: {wire_key: 'stackTrace', ref: 'Script::StackTrace'},
122
136
  text: {wire_key: 'text', primitive: 'string'}
123
137
  )
124
138
 
125
139
  # @api private
126
140
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
141
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-LocalValue
127
142
  class LocalValue < Serialization::Union
128
143
  discriminator 'type', {
129
144
  undefined: 'undefined',
@@ -156,10 +171,26 @@ module Selenium
156
171
  set: 'Script::SetLocalValue'
157
172
  )
158
173
  fallback 'Script::RemoteReference'
174
+ object_only
175
+
176
+ def self.undefined(**) = Script::UndefinedValue.new(**)
177
+ def self.null(**) = Script::NullValue.new(**)
178
+ def self.string(**) = Script::StringValue.new(**)
179
+ def self.number(**) = Script::NumberValue.new(**)
180
+ def self.boolean(**) = Script::BooleanValue.new(**)
181
+ def self.bigint(**) = Script::BigIntValue.new(**)
182
+ def self.channel(**) = Script::ChannelValue.new(**)
183
+ def self.array(**) = Script::ArrayLocalValue.new(**)
184
+ def self.date(**) = Script::DateLocalValue.new(**)
185
+ def self.map(**) = Script::MapLocalValue.new(**)
186
+ def self.object(**) = Script::ObjectLocalValue.new(**)
187
+ def self.regexp(**) = Script::RegExpLocalValue.new(**)
188
+ def self.set(**) = Script::SetLocalValue.new(**)
159
189
  end
160
190
 
161
191
  # @api private
162
192
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
193
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptarraylocalvalue
163
194
  ArrayLocalValue = Serialization::Record.define(
164
195
  type: {fixed: 'array'},
165
196
  value: {wire_key: 'value', ref: 'Script::LocalValue', list: true}
@@ -167,6 +198,7 @@ module Selenium
167
198
 
168
199
  # @api private
169
200
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
201
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptdatelocalvalue
170
202
  DateLocalValue = Serialization::Record.define(
171
203
  type: {fixed: 'date'},
172
204
  value: {wire_key: 'value', primitive: 'string'}
@@ -174,20 +206,23 @@ module Selenium
174
206
 
175
207
  # @api private
176
208
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
209
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptmaplocalvalue
177
210
  MapLocalValue = Serialization::Record.define(
178
211
  type: {fixed: 'map'},
179
- value: {wire_key: 'value', ref: 'Script::LocalValue', list: true}
212
+ value: {wire_key: 'value', ref: 'Script::LocalValue', list: true, scalar: 'string'}
180
213
  )
181
214
 
182
215
  # @api private
183
216
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
217
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptobjectlocalvalue
184
218
  ObjectLocalValue = Serialization::Record.define(
185
219
  type: {fixed: 'object'},
186
- value: {wire_key: 'value', ref: 'Script::LocalValue', list: true}
220
+ value: {wire_key: 'value', ref: 'Script::LocalValue', list: true, scalar: 'string'}
187
221
  )
188
222
 
189
223
  # @api private
190
224
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptregexpvalue
191
226
  RegExpValue = Serialization::Record.define(
192
227
  pattern: {wire_key: 'pattern', primitive: 'string'},
193
228
  flags: {wire_key: 'flags', required: false, primitive: 'string'}
@@ -195,6 +230,7 @@ module Selenium
195
230
 
196
231
  # @api private
197
232
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
233
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptregexplocalvalue
198
234
  RegExpLocalValue = Serialization::Record.define(
199
235
  type: {fixed: 'regexp'},
200
236
  value: {wire_key: 'value', ref: 'Script::RegExpValue'}
@@ -202,6 +238,7 @@ module Selenium
202
238
 
203
239
  # @api private
204
240
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
241
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptsetlocalvalue
205
242
  SetLocalValue = Serialization::Record.define(
206
243
  type: {fixed: 'set'},
207
244
  value: {wire_key: 'value', ref: 'Script::LocalValue', list: true}
@@ -209,6 +246,7 @@ module Selenium
209
246
 
210
247
  # @api private
211
248
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
249
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-PrimitiveProtocolValue
212
250
  class PrimitiveProtocolValue < Serialization::Union
213
251
  discriminator 'type', {
214
252
  undefined: 'undefined',
@@ -226,18 +264,29 @@ module Selenium
226
264
  boolean: 'Script::BooleanValue',
227
265
  bigint: 'Script::BigIntValue'
228
266
  )
267
+ object_only
268
+
269
+ def self.undefined(**) = Script::UndefinedValue.new(**)
270
+ def self.null(**) = Script::NullValue.new(**)
271
+ def self.string(**) = Script::StringValue.new(**)
272
+ def self.number(**) = Script::NumberValue.new(**)
273
+ def self.boolean(**) = Script::BooleanValue.new(**)
274
+ def self.bigint(**) = Script::BigIntValue.new(**)
229
275
  end
230
276
 
231
277
  # @api private
232
278
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
279
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptundefinedvalue
233
280
  UndefinedValue = Serialization::Record.define(type: {fixed: 'undefined'})
234
281
 
235
282
  # @api private
236
283
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
284
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptnullvalue
237
285
  NullValue = Serialization::Record.define(type: {fixed: 'null'})
238
286
 
239
287
  # @api private
240
288
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
289
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptstringvalue
241
290
  StringValue = Serialization::Record.define(
242
291
  type: {fixed: 'string'},
243
292
  value: {wire_key: 'value', primitive: 'string'}
@@ -245,10 +294,12 @@ module Selenium
245
294
 
246
295
  # @api private
247
296
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
297
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptnumbervalue
248
298
  NumberValue = Serialization::Record.define(type: {fixed: 'number'}, value: 'value')
249
299
 
250
300
  # @api private
251
301
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
302
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptbooleanvalue
252
303
  BooleanValue = Serialization::Record.define(
253
304
  type: {fixed: 'boolean'},
254
305
  value: {wire_key: 'value', primitive: 'boolean'}
@@ -256,6 +307,7 @@ module Selenium
256
307
 
257
308
  # @api private
258
309
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
310
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptbigintvalue
259
311
  BigIntValue = Serialization::Record.define(
260
312
  type: {fixed: 'bigint'},
261
313
  value: {wire_key: 'value', primitive: 'string'}
@@ -263,6 +315,7 @@ module Selenium
263
315
 
264
316
  # @api private
265
317
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
318
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-RealmInfo
266
319
  class RealmInfo < Serialization::Union
267
320
  discriminator 'type', {
268
321
  window: 'window',
@@ -284,110 +337,134 @@ module Selenium
284
337
  audio_worklet: 'Script::AudioWorkletRealmInfo',
285
338
  worklet: 'Script::WorkletRealmInfo'
286
339
  )
340
+ object_only
341
+
342
+ def self.window(**) = Script::WindowRealmInfo.new(**)
343
+ def self.dedicated_worker(**) = Script::DedicatedWorkerRealmInfo.new(**)
344
+ def self.shared_worker(**) = Script::SharedWorkerRealmInfo.new(**)
345
+ def self.service_worker(**) = Script::ServiceWorkerRealmInfo.new(**)
346
+ def self.worker(**) = Script::WorkerRealmInfo.new(**)
347
+ def self.paint_worklet(**) = Script::PaintWorkletRealmInfo.new(**)
348
+ def self.audio_worklet(**) = Script::AudioWorkletRealmInfo.new(**)
349
+ def self.worklet(**) = Script::WorkletRealmInfo.new(**)
287
350
  end
288
351
 
289
352
  # @api private
290
353
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
354
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptbaserealminfo
291
355
  BaseRealmInfo = Serialization::Record.define(
292
- realm: 'realm',
356
+ realm: {wire_key: 'realm', primitive: 'string'},
293
357
  origin: {wire_key: 'origin', primitive: 'string'}
294
358
  )
295
359
 
296
360
  # @api private
297
361
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
362
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptwindowrealminfo
298
363
  WindowRealmInfo = Serialization::Record.define(
299
364
  type: {fixed: 'window'},
300
- realm: 'realm',
365
+ realm: {wire_key: 'realm', primitive: 'string'},
301
366
  origin: {wire_key: 'origin', primitive: 'string'},
302
- context: 'context',
303
- user_context: {wire_key: 'userContext', required: false},
367
+ context: {wire_key: 'context', primitive: 'string'},
368
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
304
369
  sandbox: {wire_key: 'sandbox', required: false, primitive: 'string'}
305
370
  )
306
371
 
307
372
  # @api private
308
373
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
374
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptdedicatedworkerrealminfo
309
375
  DedicatedWorkerRealmInfo = Serialization::Record.define(
310
376
  type: {fixed: 'dedicated-worker'},
311
- realm: 'realm',
377
+ realm: {wire_key: 'realm', primitive: 'string'},
312
378
  origin: {wire_key: 'origin', primitive: 'string'},
313
379
  owners: {wire_key: 'owners', list: true}
314
380
  )
315
381
 
316
382
  # @api private
317
383
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
384
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptsharedworkerrealminfo
318
385
  SharedWorkerRealmInfo = Serialization::Record.define(
319
386
  type: {fixed: 'shared-worker'},
320
- realm: 'realm',
387
+ realm: {wire_key: 'realm', primitive: 'string'},
321
388
  origin: {wire_key: 'origin', primitive: 'string'}
322
389
  )
323
390
 
324
391
  # @api private
325
392
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
393
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptserviceworkerrealminfo
326
394
  ServiceWorkerRealmInfo = Serialization::Record.define(
327
395
  type: {fixed: 'service-worker'},
328
- realm: 'realm',
396
+ realm: {wire_key: 'realm', primitive: 'string'},
329
397
  origin: {wire_key: 'origin', primitive: 'string'}
330
398
  )
331
399
 
332
400
  # @api private
333
401
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
402
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptworkerrealminfo
334
403
  WorkerRealmInfo = Serialization::Record.define(
335
404
  type: {fixed: 'worker'},
336
- realm: 'realm',
405
+ realm: {wire_key: 'realm', primitive: 'string'},
337
406
  origin: {wire_key: 'origin', primitive: 'string'}
338
407
  )
339
408
 
340
409
  # @api private
341
410
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
411
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptpaintworkletrealminfo
342
412
  PaintWorkletRealmInfo = Serialization::Record.define(
343
413
  type: {fixed: 'paint-worklet'},
344
- realm: 'realm',
414
+ realm: {wire_key: 'realm', primitive: 'string'},
345
415
  origin: {wire_key: 'origin', primitive: 'string'}
346
416
  )
347
417
 
348
418
  # @api private
349
419
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
420
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptaudioworkletrealminfo
350
421
  AudioWorkletRealmInfo = Serialization::Record.define(
351
422
  type: {fixed: 'audio-worklet'},
352
- realm: 'realm',
423
+ realm: {wire_key: 'realm', primitive: 'string'},
353
424
  origin: {wire_key: 'origin', primitive: 'string'}
354
425
  )
355
426
 
356
427
  # @api private
357
428
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
429
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptworkletrealminfo
358
430
  WorkletRealmInfo = Serialization::Record.define(
359
431
  type: {fixed: 'worklet'},
360
- realm: 'realm',
432
+ realm: {wire_key: 'realm', primitive: 'string'},
361
433
  origin: {wire_key: 'origin', primitive: 'string'}
362
434
  )
363
435
 
364
436
  # @api private
365
437
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
438
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-RemoteReference
366
439
  class RemoteReference < Serialization::Union
367
440
  presence(
368
441
  'Script::SharedReference' => ['sharedId'],
369
442
  'Script::RemoteObjectReference' => ['handle']
370
443
  )
444
+ object_only
371
445
  end
372
446
 
373
447
  # @api private
374
448
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
449
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptsharedreference
375
450
  SharedReference = Serialization::Record.define(
376
- shared_id: 'sharedId',
377
- handle: {wire_key: 'handle', required: false},
451
+ shared_id: {wire_key: 'sharedId', primitive: 'string'},
452
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
378
453
  extensible: true
379
454
  )
380
455
 
381
456
  # @api private
382
457
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
458
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptremoteobjectreference
383
459
  RemoteObjectReference = Serialization::Record.define(
384
- handle: 'handle',
385
- shared_id: {wire_key: 'sharedId', required: false},
460
+ handle: {wire_key: 'handle', primitive: 'string'},
461
+ shared_id: {wire_key: 'sharedId', required: false, primitive: 'string'},
386
462
  extensible: true
387
463
  )
388
464
 
389
465
  # @api private
390
466
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
467
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-RemoteValue
391
468
  class RemoteValue < Serialization::Union
392
469
  discriminator 'type', {
393
470
  undefined: 'undefined',
@@ -445,175 +522,223 @@ module Selenium
445
522
  node: 'Script::NodeRemoteValue',
446
523
  window: 'Script::WindowProxyRemoteValue'
447
524
  )
525
+ object_only
526
+
527
+ def self.undefined(**) = Script::UndefinedValue.new(**)
528
+ def self.null(**) = Script::NullValue.new(**)
529
+ def self.string(**) = Script::StringValue.new(**)
530
+ def self.number(**) = Script::NumberValue.new(**)
531
+ def self.boolean(**) = Script::BooleanValue.new(**)
532
+ def self.bigint(**) = Script::BigIntValue.new(**)
533
+ def self.symbol(**) = Script::SymbolRemoteValue.new(**)
534
+ def self.array(**) = Script::ArrayRemoteValue.new(**)
535
+ def self.object(**) = Script::ObjectRemoteValue.new(**)
536
+ def self.function(**) = Script::FunctionRemoteValue.new(**)
537
+ def self.regexp(**) = Script::RegExpRemoteValue.new(**)
538
+ def self.date(**) = Script::DateRemoteValue.new(**)
539
+ def self.map(**) = Script::MapRemoteValue.new(**)
540
+ def self.set(**) = Script::SetRemoteValue.new(**)
541
+ def self.weakmap(**) = Script::WeakMapRemoteValue.new(**)
542
+ def self.weakset(**) = Script::WeakSetRemoteValue.new(**)
543
+ def self.generator(**) = Script::GeneratorRemoteValue.new(**)
544
+ def self.error(**) = Script::ErrorRemoteValue.new(**)
545
+ def self.proxy(**) = Script::ProxyRemoteValue.new(**)
546
+ def self.promise(**) = Script::PromiseRemoteValue.new(**)
547
+ def self.typedarray(**) = Script::TypedArrayRemoteValue.new(**)
548
+ def self.arraybuffer(**) = Script::ArrayBufferRemoteValue.new(**)
549
+ def self.nodelist(**) = Script::NodeListRemoteValue.new(**)
550
+ def self.htmlcollection(**) = Script::HTMLCollectionRemoteValue.new(**)
551
+ def self.node(**) = Script::NodeRemoteValue.new(**)
552
+ def self.window(**) = Script::WindowProxyRemoteValue.new(**)
448
553
  end
449
554
 
450
555
  # @api private
451
556
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
557
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptsymbolremotevalue
452
558
  SymbolRemoteValue = Serialization::Record.define(
453
559
  type: {fixed: 'symbol'},
454
- handle: {wire_key: 'handle', required: false},
455
- internal_id: {wire_key: 'internalId', required: false}
560
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
561
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
456
562
  )
457
563
 
458
564
  # @api private
459
565
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
566
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptarrayremotevalue
460
567
  ArrayRemoteValue = Serialization::Record.define(
461
568
  type: {fixed: 'array'},
462
- handle: {wire_key: 'handle', required: false},
463
- internal_id: {wire_key: 'internalId', required: false},
569
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
570
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
464
571
  value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
465
572
  )
466
573
 
467
574
  # @api private
468
575
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
576
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptobjectremotevalue
469
577
  ObjectRemoteValue = Serialization::Record.define(
470
578
  type: {fixed: 'object'},
471
- handle: {wire_key: 'handle', required: false},
472
- internal_id: {wire_key: 'internalId', required: false},
473
- value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
579
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
580
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
581
+ value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true, scalar: 'string'}
474
582
  )
475
583
 
476
584
  # @api private
477
585
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
586
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptfunctionremotevalue
478
587
  FunctionRemoteValue = Serialization::Record.define(
479
588
  type: {fixed: 'function'},
480
- handle: {wire_key: 'handle', required: false},
481
- internal_id: {wire_key: 'internalId', required: false}
589
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
590
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
482
591
  )
483
592
 
484
593
  # @api private
485
594
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
595
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptregexpremotevalue
486
596
  RegExpRemoteValue = Serialization::Record.define(
487
597
  type: {fixed: 'regexp'},
488
598
  value: {wire_key: 'value', ref: 'Script::RegExpValue'},
489
- handle: {wire_key: 'handle', required: false},
490
- internal_id: {wire_key: 'internalId', required: false}
599
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
600
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
491
601
  )
492
602
 
493
603
  # @api private
494
604
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
605
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptdateremotevalue
495
606
  DateRemoteValue = Serialization::Record.define(
496
607
  type: {fixed: 'date'},
497
608
  value: {wire_key: 'value', primitive: 'string'},
498
- handle: {wire_key: 'handle', required: false},
499
- internal_id: {wire_key: 'internalId', required: false}
609
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
610
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
500
611
  )
501
612
 
502
613
  # @api private
503
614
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
615
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptmapremotevalue
504
616
  MapRemoteValue = Serialization::Record.define(
505
617
  type: {fixed: 'map'},
506
- handle: {wire_key: 'handle', required: false},
507
- internal_id: {wire_key: 'internalId', required: false},
508
- value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
618
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
619
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
620
+ value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true, scalar: 'string'}
509
621
  )
510
622
 
511
623
  # @api private
512
624
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
625
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptsetremotevalue
513
626
  SetRemoteValue = Serialization::Record.define(
514
627
  type: {fixed: 'set'},
515
- handle: {wire_key: 'handle', required: false},
516
- internal_id: {wire_key: 'internalId', required: false},
628
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
629
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
517
630
  value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
518
631
  )
519
632
 
520
633
  # @api private
521
634
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
635
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptweakmapremotevalue
522
636
  WeakMapRemoteValue = Serialization::Record.define(
523
637
  type: {fixed: 'weakmap'},
524
- handle: {wire_key: 'handle', required: false},
525
- internal_id: {wire_key: 'internalId', required: false}
638
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
639
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
526
640
  )
527
641
 
528
642
  # @api private
529
643
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
644
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptweaksetremotevalue
530
645
  WeakSetRemoteValue = Serialization::Record.define(
531
646
  type: {fixed: 'weakset'},
532
- handle: {wire_key: 'handle', required: false},
533
- internal_id: {wire_key: 'internalId', required: false}
647
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
648
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
534
649
  )
535
650
 
536
651
  # @api private
537
652
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
653
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptgeneratorremotevalue
538
654
  GeneratorRemoteValue = Serialization::Record.define(
539
655
  type: {fixed: 'generator'},
540
- handle: {wire_key: 'handle', required: false},
541
- internal_id: {wire_key: 'internalId', required: false}
656
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
657
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
542
658
  )
543
659
 
544
660
  # @api private
545
661
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
662
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scripterrorremotevalue
546
663
  ErrorRemoteValue = Serialization::Record.define(
547
664
  type: {fixed: 'error'},
548
- handle: {wire_key: 'handle', required: false},
549
- internal_id: {wire_key: 'internalId', required: false}
665
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
666
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
550
667
  )
551
668
 
552
669
  # @api private
553
670
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
671
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptproxyremotevalue
554
672
  ProxyRemoteValue = Serialization::Record.define(
555
673
  type: {fixed: 'proxy'},
556
- handle: {wire_key: 'handle', required: false},
557
- internal_id: {wire_key: 'internalId', required: false}
674
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
675
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
558
676
  )
559
677
 
560
678
  # @api private
561
679
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
680
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptpromiseremotevalue
562
681
  PromiseRemoteValue = Serialization::Record.define(
563
682
  type: {fixed: 'promise'},
564
- handle: {wire_key: 'handle', required: false},
565
- internal_id: {wire_key: 'internalId', required: false}
683
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
684
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
566
685
  )
567
686
 
568
687
  # @api private
569
688
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
689
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scripttypedarrayremotevalue
570
690
  TypedArrayRemoteValue = Serialization::Record.define(
571
691
  type: {fixed: 'typedarray'},
572
- handle: {wire_key: 'handle', required: false},
573
- internal_id: {wire_key: 'internalId', required: false}
692
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
693
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
574
694
  )
575
695
 
576
696
  # @api private
577
697
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
698
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptarraybufferremotevalue
578
699
  ArrayBufferRemoteValue = Serialization::Record.define(
579
700
  type: {fixed: 'arraybuffer'},
580
- handle: {wire_key: 'handle', required: false},
581
- internal_id: {wire_key: 'internalId', required: false}
701
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
702
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
582
703
  )
583
704
 
584
705
  # @api private
585
706
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
707
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptnodelistremotevalue
586
708
  NodeListRemoteValue = Serialization::Record.define(
587
709
  type: {fixed: 'nodelist'},
588
- handle: {wire_key: 'handle', required: false},
589
- internal_id: {wire_key: 'internalId', required: false},
710
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
711
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
590
712
  value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
591
713
  )
592
714
 
593
715
  # @api private
594
716
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
717
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scripthtmlcollectionremotevalue
595
718
  HTMLCollectionRemoteValue = Serialization::Record.define(
596
719
  type: {fixed: 'htmlcollection'},
597
- handle: {wire_key: 'handle', required: false},
598
- internal_id: {wire_key: 'internalId', required: false},
720
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
721
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
599
722
  value: {wire_key: 'value', required: false, ref: 'Script::RemoteValue', list: true}
600
723
  )
601
724
 
602
725
  # @api private
603
726
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
727
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptnoderemotevalue
604
728
  NodeRemoteValue = Serialization::Record.define(
605
729
  type: {fixed: 'node'},
606
- shared_id: {wire_key: 'sharedId', required: false},
607
- handle: {wire_key: 'handle', required: false},
608
- internal_id: {wire_key: 'internalId', required: false},
730
+ shared_id: {wire_key: 'sharedId', required: false, primitive: 'string'},
731
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
732
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'},
609
733
  value: {wire_key: 'value', required: false, ref: 'Script::NodeProperties'}
610
734
  )
611
735
 
612
736
  # @api private
613
737
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
738
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptnodeproperties
614
739
  NodeProperties = Serialization::Record.define(
615
- node_type: 'nodeType',
616
- child_node_count: 'childNodeCount',
740
+ node_type: {wire_key: 'nodeType', primitive: 'integer'},
741
+ child_node_count: {wire_key: 'childNodeCount', primitive: 'integer'},
617
742
  attributes: {wire_key: 'attributes', required: false},
618
743
  children: {wire_key: 'children', required: false, ref: 'Script::NodeRemoteValue', list: true},
619
744
  local_name: {wire_key: 'localName', required: false, primitive: 'string'},
@@ -625,22 +750,25 @@ module Selenium
625
750
 
626
751
  # @api private
627
752
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
753
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptwindowproxyremotevalue
628
754
  WindowProxyRemoteValue = Serialization::Record.define(
629
755
  type: {fixed: 'window'},
630
756
  value: {wire_key: 'value', ref: 'Script::WindowProxyProperties'},
631
- handle: {wire_key: 'handle', required: false},
632
- internal_id: {wire_key: 'internalId', required: false}
757
+ handle: {wire_key: 'handle', required: false, primitive: 'string'},
758
+ internal_id: {wire_key: 'internalId', required: false, primitive: 'string'}
633
759
  )
634
760
 
635
761
  # @api private
636
762
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
637
- WindowProxyProperties = Serialization::Record.define(context: 'context')
763
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptwindowproxyproperties
764
+ WindowProxyProperties = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
638
765
 
639
766
  # @api private
640
767
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
768
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-SerializationOptions
641
769
  SerializationOptions = Serialization::Record.define(
642
- max_dom_depth: {wire_key: 'maxDomDepth', required: false, nullable: true},
643
- max_object_depth: {wire_key: 'maxObjectDepth', required: false, nullable: true},
770
+ max_dom_depth: {wire_key: 'maxDomDepth', required: false, nullable: true, primitive: 'integer'},
771
+ max_object_depth: {wire_key: 'maxObjectDepth', required: false, nullable: true, primitive: 'integer'},
644
772
  include_shadow_tree: {
645
773
  wire_key: 'includeShadowTree',
646
774
  required: false,
@@ -650,49 +778,57 @@ module Selenium
650
778
 
651
779
  # @api private
652
780
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
781
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-StackFrame
653
782
  StackFrame = Serialization::Record.define(
654
- column_number: 'columnNumber',
783
+ column_number: {wire_key: 'columnNumber', primitive: 'integer'},
655
784
  function_name: {wire_key: 'functionName', primitive: 'string'},
656
- line_number: 'lineNumber',
785
+ line_number: {wire_key: 'lineNumber', primitive: 'integer'},
657
786
  url: {wire_key: 'url', primitive: 'string'}
658
787
  )
659
788
 
660
789
  # @api private
661
790
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
791
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-StackTrace
662
792
  StackTrace = Serialization::Record.define(
663
793
  call_frames: {wire_key: 'callFrames', ref: 'Script::StackFrame', list: true}
664
794
  )
665
795
 
666
796
  # @api private
667
797
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
798
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-Source
668
799
  Source = Serialization::Record.define(
669
- realm: 'realm',
670
- context: {wire_key: 'context', required: false},
671
- user_context: {wire_key: 'userContext', required: false}
800
+ realm: {wire_key: 'realm', primitive: 'string'},
801
+ context: {wire_key: 'context', required: false, primitive: 'string'},
802
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
672
803
  )
673
804
 
674
805
  # @api private
675
806
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
676
- RealmTarget = Serialization::Record.define(realm: 'realm')
807
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptrealmtarget
808
+ RealmTarget = Serialization::Record.define(realm: {wire_key: 'realm', primitive: 'string'})
677
809
 
678
810
  # @api private
679
811
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
812
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptcontexttarget
680
813
  ContextTarget = Serialization::Record.define(
681
- context: 'context',
814
+ context: {wire_key: 'context', primitive: 'string'},
682
815
  sandbox: {wire_key: 'sandbox', required: false, primitive: 'string'}
683
816
  )
684
817
 
685
818
  # @api private
686
819
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
820
+ # @see https://w3c.github.io/webdriver-bidi/#type-script-Target
687
821
  class Target < Serialization::Union
688
822
  presence(
689
823
  'Script::ContextTarget' => ['context'],
690
824
  'Script::RealmTarget' => ['realm']
691
825
  )
826
+ object_only
692
827
  end
693
828
 
694
829
  # @api private
695
830
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
831
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptaddpreloadscriptparameters
696
832
  AddPreloadScriptParameters = Serialization::Record.define(
697
833
  function_declaration: {wire_key: 'functionDeclaration', primitive: 'string'},
698
834
  arguments: {wire_key: 'arguments', required: false, ref: 'Script::ChannelValue', list: true},
@@ -703,10 +839,12 @@ module Selenium
703
839
 
704
840
  # @api private
705
841
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
706
- AddPreloadScriptResult = Serialization::Record.define(script: 'script')
842
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptaddpreloadscriptresult
843
+ AddPreloadScriptResult = Serialization::Record.define(script: {wire_key: 'script', primitive: 'string'})
707
844
 
708
845
  # @api private
709
846
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
847
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptdisownparameters
710
848
  DisownParameters = Serialization::Record.define(
711
849
  handles: {wire_key: 'handles', list: true},
712
850
  target: {wire_key: 'target', ref: 'Script::Target'}
@@ -714,6 +852,7 @@ module Selenium
714
852
 
715
853
  # @api private
716
854
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
855
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptcallfunctionparameters
717
856
  CallFunctionParameters = Serialization::Record.define(
718
857
  function_declaration: {wire_key: 'functionDeclaration', primitive: 'string'},
719
858
  await_promise: {wire_key: 'awaitPromise', primitive: 'boolean'},
@@ -731,6 +870,7 @@ module Selenium
731
870
 
732
871
  # @api private
733
872
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
873
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptevaluateparameters
734
874
  EvaluateParameters = Serialization::Record.define(
735
875
  expression: {wire_key: 'expression', primitive: 'string'},
736
876
  target: {wire_key: 'target', ref: 'Script::Target'},
@@ -746,32 +886,39 @@ module Selenium
746
886
 
747
887
  # @api private
748
888
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
889
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptgetrealmsparameters
749
890
  GetRealmsParameters = Serialization::Record.define(
750
- context: {wire_key: 'context', required: false},
891
+ context: {wire_key: 'context', required: false, primitive: 'string'},
751
892
  type: {wire_key: 'type', required: false, enum: 'Script::REALM_TYPE'}
752
893
  )
753
894
 
754
895
  # @api private
755
896
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
897
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptgetrealmsresult
756
898
  GetRealmsResult = Serialization::Record.define(
757
899
  realms: {wire_key: 'realms', ref: 'Script::RealmInfo', list: true}
758
900
  )
759
901
 
760
902
  # @api private
761
903
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
762
- RemovePreloadScriptParameters = Serialization::Record.define(script: 'script')
904
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptremovepreloadscriptparameters
905
+ RemovePreloadScriptParameters = Serialization::Record.define(
906
+ script: {wire_key: 'script', primitive: 'string'}
907
+ )
763
908
 
764
909
  # @api private
765
910
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
911
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptmessageparameters
766
912
  MessageParameters = Serialization::Record.define(
767
- channel: 'channel',
913
+ channel: {wire_key: 'channel', primitive: 'string'},
768
914
  data: {wire_key: 'data', ref: 'Script::RemoteValue'},
769
915
  source: {wire_key: 'source', ref: 'Script::Source'}
770
916
  )
771
917
 
772
918
  # @api private
773
919
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
774
- RealmDestroyedParameters = Serialization::Record.define(realm: 'realm')
920
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-scriptrealmdestroyedparameters
921
+ RealmDestroyedParameters = Serialization::Record.define(realm: {wire_key: 'realm', primitive: 'string'})
775
922
 
776
923
  EVENT_TYPES = {
777
924
  'script.message' => Script::MessageParameters,
@@ -779,8 +926,34 @@ module Selenium
779
926
  'script.realmDestroyed' => Script::RealmDestroyedParameters
780
927
  }.freeze
781
928
 
782
- # @api private
783
- # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
929
+ def channel_value(**) = ChannelValue.new(**)
930
+ def channel_properties(**) = ChannelProperties.new(**)
931
+ def local_value = LocalValue
932
+ def array_local_value(**) = ArrayLocalValue.new(**)
933
+ def date_local_value(**) = DateLocalValue.new(**)
934
+ def map_local_value(**) = MapLocalValue.new(**)
935
+ def object_local_value(**) = ObjectLocalValue.new(**)
936
+ def reg_exp_value(**) = RegExpValue.new(**)
937
+ def reg_exp_local_value(**) = RegExpLocalValue.new(**)
938
+ def set_local_value(**) = SetLocalValue.new(**)
939
+ def primitive_protocol_value = PrimitiveProtocolValue
940
+ def undefined_value(**) = UndefinedValue.new(**)
941
+ def null_value(**) = NullValue.new(**)
942
+ def string_value(**) = StringValue.new(**)
943
+ def number_value(**) = NumberValue.new(**)
944
+ def boolean_value(**) = BooleanValue.new(**)
945
+ def big_int_value(**) = BigIntValue.new(**)
946
+ def remote_reference = RemoteReference
947
+ def shared_reference(**) = SharedReference.new(**)
948
+ def remote_object_reference(**) = RemoteObjectReference.new(**)
949
+ def serialization_options(**) = SerializationOptions.new(**)
950
+ def realm_target(**) = RealmTarget.new(**)
951
+ def context_target(**) = ContextTarget.new(**)
952
+ def target = Target
953
+
954
+ # @api private
955
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
956
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript
784
957
  def add_preload_script(
785
958
  function_declaration:,
786
959
  arguments: Serialization::UNSET,
@@ -800,6 +973,7 @@ module Selenium
800
973
 
801
974
  # @api private
802
975
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
976
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-callFunction
803
977
  def call_function(
804
978
  function_declaration:,
805
979
  await_promise:,
@@ -826,6 +1000,7 @@ module Selenium
826
1000
 
827
1001
  # @api private
828
1002
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
1003
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-disown
829
1004
  def disown(handles:, target:)
830
1005
  params = DisownParameters.new(handles: handles, target: target)
831
1006
  execute(cmd: 'script.disown', params: params)
@@ -833,6 +1008,7 @@ module Selenium
833
1008
 
834
1009
  # @api private
835
1010
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
1011
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-evaluate
836
1012
  def evaluate(
837
1013
  expression:,
838
1014
  target:,
@@ -855,6 +1031,7 @@ module Selenium
855
1031
 
856
1032
  # @api private
857
1033
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
1034
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-getRealms
858
1035
  def get_realms(context: Serialization::UNSET, type: Serialization::UNSET)
859
1036
  Serialization.validate!('type', type, Script::REALM_TYPE)
860
1037
  params = GetRealmsParameters.new(context: context, type: type)
@@ -863,6 +1040,7 @@ module Selenium
863
1040
 
864
1041
  # @api private
865
1042
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
1043
+ # @see https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript
866
1044
  def remove_preload_script(script:)
867
1045
  params = RemovePreloadScriptParameters.new(script: script)
868
1046
  execute(cmd: 'script.removePreloadScript', params: params)