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-browsingContext
29
30
  class BrowsingContext < Domain
30
31
  EVENTS = {
31
32
  context_created: 'browsingContext.contextCreated',
@@ -44,12 +45,14 @@ module Selenium
44
45
  user_prompt_opened: 'browsingContext.userPromptOpened'
45
46
  }.freeze
46
47
 
48
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-ReadinessState
47
49
  READINESS_STATE = {
48
50
  none: 'none',
49
51
  interactive: 'interactive',
50
52
  complete: 'complete'
51
53
  }.freeze
52
54
 
55
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-UserPromptType
53
56
  USER_PROMPT_TYPE = {
54
57
  alert: 'alert',
55
58
  beforeunload: 'beforeunload',
@@ -57,6 +60,7 @@ module Selenium
57
60
  prompt: 'prompt'
58
61
  }.freeze
59
62
 
63
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreatetype
60
64
  CREATE_TYPE = {
61
65
  tab: 'tab',
62
66
  window: 'window'
@@ -79,18 +83,20 @@ module Selenium
79
83
 
80
84
  # @api private
81
85
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
86
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-Info
82
87
  Info = Serialization::Record.define(
83
88
  children: {wire_key: 'children', nullable: true, ref: 'BrowsingContext::Info', list: true},
84
- client_window: 'clientWindow',
85
- context: 'context',
86
- original_opener: {wire_key: 'originalOpener', nullable: true},
89
+ client_window: {wire_key: 'clientWindow', primitive: 'string'},
90
+ context: {wire_key: 'context', primitive: 'string'},
91
+ original_opener: {wire_key: 'originalOpener', nullable: true, primitive: 'string'},
87
92
  url: {wire_key: 'url', primitive: 'string'},
88
- user_context: 'userContext',
89
- parent: {wire_key: 'parent', required: false, nullable: true}
93
+ user_context: {wire_key: 'userContext', primitive: 'string'},
94
+ parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'}
90
95
  )
91
96
 
92
97
  # @api private
93
98
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
99
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-Locator
94
100
  class Locator < Serialization::Union
95
101
  discriminator 'type', {
96
102
  accessibility: 'accessibility',
@@ -106,10 +112,18 @@ module Selenium
106
112
  inner_text: 'BrowsingContext::InnerTextLocator',
107
113
  xpath: 'BrowsingContext::XPathLocator'
108
114
  )
115
+ object_only
116
+
117
+ def self.accessibility(**) = BrowsingContext::AccessibilityLocator.new(**)
118
+ def self.css(**) = BrowsingContext::CssLocator.new(**)
119
+ def self.context(**) = BrowsingContext::ContextLocator.new(**)
120
+ def self.inner_text(**) = BrowsingContext::InnerTextLocator.new(**)
121
+ def self.xpath(**) = BrowsingContext::XPathLocator.new(**)
109
122
  end
110
123
 
111
124
  # @api private
112
125
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
126
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextaccessibilitylocator
113
127
  AccessibilityLocator = Serialization::Record.define(
114
128
  type: {fixed: 'accessibility'},
115
129
  value: {wire_key: 'value', ref: 'BrowsingContext::AccessibilityLocator::Value'}
@@ -124,6 +138,7 @@ module Selenium
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/#cddl-type-browsingcontextcsslocator
127
142
  CssLocator = Serialization::Record.define(
128
143
  type: {fixed: 'css'},
129
144
  value: {wire_key: 'value', primitive: 'string'}
@@ -131,6 +146,7 @@ module Selenium
131
146
 
132
147
  # @api private
133
148
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
149
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcontextlocator
134
150
  ContextLocator = Serialization::Record.define(
135
151
  type: {fixed: 'context'},
136
152
  value: {wire_key: 'value', ref: 'BrowsingContext::ContextLocator::Value'}
@@ -138,20 +154,22 @@ module Selenium
138
154
 
139
155
  # @api private
140
156
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
141
- ContextLocator::Value = Serialization::Record.define(context: 'context')
157
+ ContextLocator::Value = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
142
158
 
143
159
  # @api private
144
160
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
161
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextinnertextlocator
145
162
  InnerTextLocator = Serialization::Record.define(
146
163
  type: {fixed: 'innerText'},
147
164
  value: {wire_key: 'value', primitive: 'string'},
148
165
  ignore_case: {wire_key: 'ignoreCase', required: false, primitive: 'boolean'},
149
166
  match_type: {wire_key: 'matchType', required: false, enum: 'BrowsingContext::INNER_TEXT_LOCATOR_MATCH_TYPE'},
150
- max_depth: {wire_key: 'maxDepth', required: false}
167
+ max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer'}
151
168
  )
152
169
 
153
170
  # @api private
154
171
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
172
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextxpathlocator
155
173
  XPathLocator = Serialization::Record.define(
156
174
  type: {fixed: 'xpath'},
157
175
  value: {wire_key: 'value', primitive: 'string'}
@@ -159,32 +177,36 @@ module Selenium
159
177
 
160
178
  # @api private
161
179
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
180
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextbasenavigationinfo
162
181
  BaseNavigationInfo = Serialization::Record.define(
163
- context: 'context',
164
- navigation: {wire_key: 'navigation', nullable: true},
165
- timestamp: 'timestamp',
182
+ context: {wire_key: 'context', primitive: 'string'},
183
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
184
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
166
185
  url: {wire_key: 'url', primitive: 'string'},
167
- user_context: {wire_key: 'userContext', required: false}
186
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
168
187
  )
169
188
 
170
189
  # @api private
171
190
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
191
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-NavigationInfo
172
192
  NavigationInfo = Serialization::Record.define(
173
- context: 'context',
174
- navigation: {wire_key: 'navigation', nullable: true},
175
- timestamp: 'timestamp',
193
+ context: {wire_key: 'context', primitive: 'string'},
194
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
195
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
176
196
  url: {wire_key: 'url', primitive: 'string'},
177
- user_context: {wire_key: 'userContext', required: false}
197
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
178
198
  )
179
199
 
180
200
  # @api private
181
201
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
182
- ActivateParameters = Serialization::Record.define(context: 'context')
202
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextactivateparameters
203
+ ActivateParameters = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
183
204
 
184
205
  # @api private
185
206
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
207
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcapturescreenshotparameters
186
208
  CaptureScreenshotParameters = Serialization::Record.define(
187
- context: 'context',
209
+ context: {wire_key: 'context', primitive: 'string'},
188
210
  origin: {wire_key: 'origin', required: false, enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'},
189
211
  format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
190
212
  clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'}
@@ -192,23 +214,30 @@ module Selenium
192
214
 
193
215
  # @api private
194
216
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
217
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimageformat
195
218
  ImageFormat = Serialization::Record.define(
196
219
  type: {wire_key: 'type', primitive: 'string'},
197
- quality: {wire_key: 'quality', required: false, primitive: 'integer'}
220
+ quality: {wire_key: 'quality', required: false, primitive: 'number'}
198
221
  )
199
222
 
200
223
  # @api private
201
224
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcliprectangle
202
226
  class ClipRectangle < Serialization::Union
203
227
  discriminator 'type', {box: 'box', element: 'element'}
204
228
  variants(
205
229
  box: 'BrowsingContext::BoxClipRectangle',
206
230
  element: 'BrowsingContext::ElementClipRectangle'
207
231
  )
232
+ object_only
233
+
234
+ def self.box(**) = BrowsingContext::BoxClipRectangle.new(**)
235
+ def self.element(**) = BrowsingContext::ElementClipRectangle.new(**)
208
236
  end
209
237
 
210
238
  # @api private
211
239
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
240
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextelementcliprectangle
212
241
  ElementClipRectangle = Serialization::Record.define(
213
242
  type: {fixed: 'element'},
214
243
  element: {wire_key: 'element', ref: 'Script::SharedReference'}
@@ -216,6 +245,7 @@ module Selenium
216
245
 
217
246
  # @api private
218
247
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
248
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextboxcliprectangle
219
249
  BoxClipRectangle = Serialization::Record.define(
220
250
  type: {fixed: 'box'},
221
251
  x: {wire_key: 'x', primitive: 'number'},
@@ -226,58 +256,66 @@ module Selenium
226
256
 
227
257
  # @api private
228
258
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
259
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcapturescreenshotresult
229
260
  CaptureScreenshotResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
230
261
 
231
262
  # @api private
232
263
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
264
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcloseparameters
233
265
  CloseParameters = Serialization::Record.define(
234
- context: 'context',
266
+ context: {wire_key: 'context', primitive: 'string'},
235
267
  prompt_unload: {wire_key: 'promptUnload', required: false, primitive: 'boolean'}
236
268
  )
237
269
 
238
270
  # @api private
239
271
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
272
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreateparameters
240
273
  CreateParameters = Serialization::Record.define(
241
274
  type: {wire_key: 'type', enum: 'BrowsingContext::CREATE_TYPE'},
242
- reference_context: {wire_key: 'referenceContext', required: false},
275
+ reference_context: {wire_key: 'referenceContext', required: false, primitive: 'string'},
243
276
  background: {wire_key: 'background', required: false, primitive: 'boolean'},
244
- user_context: {wire_key: 'userContext', required: false}
277
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
245
278
  )
246
279
 
247
280
  # @api private
248
281
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
282
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreateresult
249
283
  CreateResult = Serialization::Record.define(
250
- context: 'context',
251
- user_context: {wire_key: 'userContext', required: false}
284
+ context: {wire_key: 'context', primitive: 'string'},
285
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
252
286
  )
253
287
 
254
288
  # @api private
255
289
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
290
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeparameters
256
291
  GetTreeParameters = Serialization::Record.define(
257
- max_depth: {wire_key: 'maxDepth', required: false},
258
- root: {wire_key: 'root', required: false}
292
+ max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer'},
293
+ root: {wire_key: 'root', required: false, primitive: 'string'}
259
294
  )
260
295
 
261
296
  # @api private
262
297
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
298
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeresult
263
299
  GetTreeResult = Serialization::Record.define(
264
300
  contexts: {wire_key: 'contexts', ref: 'BrowsingContext::Info', list: true}
265
301
  )
266
302
 
267
303
  # @api private
268
304
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
305
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexthandleuserpromptparameters
269
306
  HandleUserPromptParameters = Serialization::Record.define(
270
- context: 'context',
307
+ context: {wire_key: 'context', primitive: 'string'},
271
308
  accept: {wire_key: 'accept', required: false, primitive: 'boolean'},
272
309
  user_text: {wire_key: 'userText', required: false, primitive: 'string'}
273
310
  )
274
311
 
275
312
  # @api private
276
313
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
314
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextlocatenodesparameters
277
315
  LocateNodesParameters = Serialization::Record.define(
278
- context: 'context',
316
+ context: {wire_key: 'context', primitive: 'string'},
279
317
  locator: {wire_key: 'locator', ref: 'BrowsingContext::Locator'},
280
- max_node_count: {wire_key: 'maxNodeCount', required: false},
318
+ max_node_count: {wire_key: 'maxNodeCount', required: false, primitive: 'integer'},
281
319
  serialization_options: {
282
320
  wire_key: 'serializationOptions',
283
321
  required: false,
@@ -288,29 +326,33 @@ module Selenium
288
326
 
289
327
  # @api private
290
328
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
329
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextlocatenodesresult
291
330
  LocateNodesResult = Serialization::Record.define(
292
331
  nodes: {wire_key: 'nodes', ref: 'Script::NodeRemoteValue', list: true}
293
332
  )
294
333
 
295
334
  # @api private
296
335
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
336
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextnavigateparameters
297
337
  NavigateParameters = Serialization::Record.define(
298
- context: 'context',
338
+ context: {wire_key: 'context', primitive: 'string'},
299
339
  url: {wire_key: 'url', primitive: 'string'},
300
340
  wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
301
341
  )
302
342
 
303
343
  # @api private
304
344
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
345
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextnavigateresult
305
346
  NavigateResult = Serialization::Record.define(
306
- navigation: {wire_key: 'navigation', nullable: true},
347
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
307
348
  url: {wire_key: 'url', primitive: 'string'}
308
349
  )
309
350
 
310
351
  # @api private
311
352
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
353
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintparameters
312
354
  PrintParameters = Serialization::Record.define(
313
- context: 'context',
355
+ context: {wire_key: 'context', primitive: 'string'},
314
356
  background: {wire_key: 'background', required: false, primitive: 'boolean'},
315
357
  margin: {wire_key: 'margin', required: false, ref: 'BrowsingContext::PrintMarginParameters'},
316
358
  orientation: {
@@ -326,6 +368,7 @@ module Selenium
326
368
 
327
369
  # @api private
328
370
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
371
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintmarginparameters
329
372
  PrintMarginParameters = Serialization::Record.define(
330
373
  bottom: {wire_key: 'bottom', required: false, primitive: 'number'},
331
374
  left: {wire_key: 'left', required: false, primitive: 'number'},
@@ -335,6 +378,7 @@ module Selenium
335
378
 
336
379
  # @api private
337
380
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
381
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintpageparameters
338
382
  PrintPageParameters = Serialization::Record.define(
339
383
  height: {wire_key: 'height', required: false, primitive: 'number'},
340
384
  width: {wire_key: 'width', required: false, primitive: 'number'}
@@ -342,28 +386,32 @@ module Selenium
342
386
 
343
387
  # @api private
344
388
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
389
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintresult
345
390
  PrintResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
346
391
 
347
392
  # @api private
348
393
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
394
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextreloadparameters
349
395
  ReloadParameters = Serialization::Record.define(
350
- context: 'context',
396
+ context: {wire_key: 'context', primitive: 'string'},
351
397
  ignore_cache: {wire_key: 'ignoreCache', required: false, primitive: 'boolean'},
352
398
  wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
353
399
  )
354
400
 
355
401
  # @api private
356
402
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
403
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextsetbypasscspparameters
357
404
  SetBypassCSPParameters = Serialization::Record.define(
358
- bypass: {wire_key: 'bypass', nullable: true},
405
+ bypass: {wire_key: 'bypass', nullable: true, const: true},
359
406
  contexts: {wire_key: 'contexts', required: false, list: true},
360
407
  user_contexts: {wire_key: 'userContexts', required: false, list: true}
361
408
  )
362
409
 
363
410
  # @api private
364
411
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
412
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextsetviewportparameters
365
413
  SetViewportParameters = Serialization::Record.define(
366
- context: {wire_key: 'context', required: false},
414
+ context: {wire_key: 'context', required: false, primitive: 'string'},
367
415
  viewport: {wire_key: 'viewport', required: false, nullable: true, ref: 'BrowsingContext::Viewport'},
368
416
  device_pixel_ratio: {wire_key: 'devicePixelRatio', required: false, nullable: true, primitive: 'number'},
369
417
  user_contexts: {wire_key: 'userContexts', required: false, list: true}
@@ -371,12 +419,17 @@ module Selenium
371
419
 
372
420
  # @api private
373
421
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
374
- Viewport = Serialization::Record.define(width: 'width', height: 'height')
422
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextviewport
423
+ Viewport = Serialization::Record.define(
424
+ width: {wire_key: 'width', primitive: 'integer'},
425
+ height: {wire_key: 'height', primitive: 'integer'}
426
+ )
375
427
 
376
428
  # @api private
377
429
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
430
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstartscreencastparameters
378
431
  StartScreencastParameters = Serialization::Record.define(
379
- context: 'context',
432
+ context: {wire_key: 'context', primitive: 'string'},
380
433
  mime_type: {wire_key: 'mimeType', required: false, primitive: 'string'},
381
434
  video: {wire_key: 'video', required: false, ref: 'BrowsingContext::MediaTrackConstraints'},
382
435
  audio: {wire_key: 'audio', required: false, primitive: 'boolean'}
@@ -384,25 +437,31 @@ module Selenium
384
437
 
385
438
  # @api private
386
439
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
440
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextmediatrackconstraints
387
441
  MediaTrackConstraints = Serialization::Record.define(
388
- width: {wire_key: 'width', required: false},
389
- height: {wire_key: 'height', required: false},
390
- frame_rate: {wire_key: 'frameRate', required: false}
442
+ width: {wire_key: 'width', required: false, primitive: 'integer'},
443
+ height: {wire_key: 'height', required: false, primitive: 'integer'},
444
+ frame_rate: {wire_key: 'frameRate', required: false, primitive: 'integer'}
391
445
  )
392
446
 
393
447
  # @api private
394
448
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
449
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstartscreencastresult
395
450
  StartScreencastResult = Serialization::Record.define(
396
- screencast: 'screencast',
451
+ screencast: {wire_key: 'screencast', primitive: 'string'},
397
452
  path: {wire_key: 'path', primitive: 'string'}
398
453
  )
399
454
 
400
455
  # @api private
401
456
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
402
- StopScreencastParameters = Serialization::Record.define(screencast: 'screencast')
457
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstopscreencastparameters
458
+ StopScreencastParameters = Serialization::Record.define(
459
+ screencast: {wire_key: 'screencast', primitive: 'string'}
460
+ )
403
461
 
404
462
  # @api private
405
463
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
464
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstopscreencastresult
406
465
  StopScreencastResult = Serialization::Record.define(
407
466
  path: {wire_key: 'path', primitive: 'string'},
408
467
  error: {wire_key: 'error', required: false, primitive: 'string'}
@@ -410,82 +469,95 @@ module Selenium
410
469
 
411
470
  # @api private
412
471
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
413
- TraverseHistoryParameters = Serialization::Record.define(context: 'context', delta: 'delta')
472
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexttraversehistoryparameters
473
+ TraverseHistoryParameters = Serialization::Record.define(
474
+ context: {wire_key: 'context', primitive: 'string'},
475
+ delta: {wire_key: 'delta', primitive: 'integer'}
476
+ )
414
477
 
415
478
  # @api private
416
479
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
480
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexthistoryupdatedparameters
417
481
  HistoryUpdatedParameters = Serialization::Record.define(
418
- context: 'context',
419
- timestamp: 'timestamp',
482
+ context: {wire_key: 'context', primitive: 'string'},
483
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
420
484
  url: {wire_key: 'url', primitive: 'string'},
421
- user_context: {wire_key: 'userContext', required: false}
485
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
422
486
  )
423
487
 
424
488
  # @api private
425
489
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
490
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextdownloadwillbeginparams
426
491
  DownloadWillBeginParams = Serialization::Record.define(
427
- download: 'download',
492
+ download: {wire_key: 'download', primitive: 'string'},
428
493
  suggested_filename: {wire_key: 'suggestedFilename', primitive: 'string'},
429
- context: 'context',
430
- navigation: {wire_key: 'navigation', nullable: true},
431
- timestamp: 'timestamp',
494
+ context: {wire_key: 'context', primitive: 'string'},
495
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
496
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
432
497
  url: {wire_key: 'url', primitive: 'string'},
433
- user_context: {wire_key: 'userContext', required: false}
498
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
434
499
  )
435
500
 
436
501
  # @api private
437
502
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
503
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextdownloadendparams
438
504
  class DownloadEndParams < Serialization::Union
439
505
  discriminator 'status', {canceled: 'canceled', complete: 'complete'}
440
506
  variants(
441
507
  canceled: 'BrowsingContext::DownloadEndParams::CanceledParams',
442
508
  complete: 'BrowsingContext::DownloadEndParams::CompleteParams'
443
509
  )
510
+ object_only
444
511
 
445
512
  # @api private
446
513
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
447
514
  CanceledParams = Serialization::Record.define(
448
515
  status: {fixed: 'canceled'},
449
- download: 'download',
450
- context: 'context',
451
- navigation: {wire_key: 'navigation', nullable: true},
452
- timestamp: 'timestamp',
516
+ download: {wire_key: 'download', primitive: 'string'},
517
+ context: {wire_key: 'context', primitive: 'string'},
518
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
519
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
453
520
  url: {wire_key: 'url', primitive: 'string'},
454
- user_context: {wire_key: 'userContext', required: false}
521
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
455
522
  )
456
523
 
457
524
  # @api private
458
525
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
459
526
  CompleteParams = Serialization::Record.define(
460
527
  status: {fixed: 'complete'},
461
- download: 'download',
528
+ download: {wire_key: 'download', primitive: 'string'},
462
529
  filepath: {wire_key: 'filepath', nullable: true, primitive: 'string'},
463
- context: 'context',
464
- navigation: {wire_key: 'navigation', nullable: true},
465
- timestamp: 'timestamp',
530
+ context: {wire_key: 'context', primitive: 'string'},
531
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
532
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
466
533
  url: {wire_key: 'url', primitive: 'string'},
467
- user_context: {wire_key: 'userContext', required: false}
534
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
468
535
  )
536
+
537
+ def self.canceled(**) = BrowsingContext::DownloadEndParams::CanceledParams.new(**)
538
+ def self.complete(**) = BrowsingContext::DownloadEndParams::CompleteParams.new(**)
469
539
  end
470
540
 
471
541
  # @api private
472
542
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
543
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextuserpromptclosedparameters
473
544
  UserPromptClosedParameters = Serialization::Record.define(
474
- context: 'context',
545
+ context: {wire_key: 'context', primitive: 'string'},
475
546
  accepted: {wire_key: 'accepted', primitive: 'boolean'},
476
547
  type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
477
- user_context: {wire_key: 'userContext', required: false},
548
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
478
549
  user_text: {wire_key: 'userText', required: false, primitive: 'string'}
479
550
  )
480
551
 
481
552
  # @api private
482
553
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
554
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextuserpromptopenedparameters
483
555
  UserPromptOpenedParameters = Serialization::Record.define(
484
- context: 'context',
556
+ context: {wire_key: 'context', primitive: 'string'},
485
557
  handler: {wire_key: 'handler', enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
486
558
  message: {wire_key: 'message', primitive: 'string'},
487
559
  type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
488
- user_context: {wire_key: 'userContext', required: false},
560
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
489
561
  default_value: {wire_key: 'defaultValue', required: false, primitive: 'string'}
490
562
  )
491
563
 
@@ -506,8 +578,26 @@ module Selenium
506
578
  'browsingContext.userPromptOpened' => BrowsingContext::UserPromptOpenedParameters
507
579
  }.freeze
508
580
 
509
- # @api private
510
- # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
581
+ def locator = Locator
582
+ def accessibility_locator(**) = AccessibilityLocator.new(**)
583
+ def css_locator(**) = CssLocator.new(**)
584
+ def context_locator(**) = ContextLocator.new(**)
585
+ def inner_text_locator(**) = InnerTextLocator.new(**)
586
+ def x_path_locator(**) = XPathLocator.new(**)
587
+ def image_format(**) = ImageFormat.new(**)
588
+ def clip_rectangle = ClipRectangle
589
+ def element_clip_rectangle(**) = ElementClipRectangle.new(**)
590
+ def box_clip_rectangle(**) = BoxClipRectangle.new(**)
591
+ def print_margin_parameters(**) = PrintMarginParameters.new(**)
592
+ def print_page_parameters(**) = PrintPageParameters.new(**)
593
+ def viewport(**) = Viewport.new(**)
594
+ def media_track_constraints(**) = MediaTrackConstraints.new(**)
595
+ def accessibility_locator_value(**) = AccessibilityLocator::Value.new(**)
596
+ def context_locator_value(**) = ContextLocator::Value.new(**)
597
+
598
+ # @api private
599
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
600
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-activate
511
601
  def activate(context:)
512
602
  params = ActivateParameters.new(context: context)
513
603
  execute(cmd: 'browsingContext.activate', params: params)
@@ -515,6 +605,7 @@ module Selenium
515
605
 
516
606
  # @api private
517
607
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
608
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot
518
609
  def capture_screenshot(
519
610
  context:,
520
611
  origin: Serialization::UNSET,
@@ -532,6 +623,7 @@ module Selenium
532
623
 
533
624
  # @api private
534
625
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
626
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-close
535
627
  def close(context:, prompt_unload: Serialization::UNSET)
536
628
  params = CloseParameters.new(context: context, prompt_unload: prompt_unload)
537
629
  execute(cmd: 'browsingContext.close', params: params)
@@ -539,6 +631,7 @@ module Selenium
539
631
 
540
632
  # @api private
541
633
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
634
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-create
542
635
  def create(
543
636
  type:,
544
637
  reference_context: Serialization::UNSET,
@@ -557,6 +650,7 @@ module Selenium
557
650
 
558
651
  # @api private
559
652
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
653
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
560
654
  def get_tree(max_depth: Serialization::UNSET, root: Serialization::UNSET)
561
655
  params = GetTreeParameters.new(max_depth: max_depth, root: root)
562
656
  execute(cmd: 'browsingContext.getTree', params: params, result: BrowsingContext::GetTreeResult)
@@ -564,6 +658,7 @@ module Selenium
564
658
 
565
659
  # @api private
566
660
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
661
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt
567
662
  def handle_user_prompt(context:, accept: Serialization::UNSET, user_text: Serialization::UNSET)
568
663
  params = HandleUserPromptParameters.new(context: context, accept: accept, user_text: user_text)
569
664
  execute(cmd: 'browsingContext.handleUserPrompt', params: params)
@@ -571,6 +666,7 @@ module Selenium
571
666
 
572
667
  # @api private
573
668
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
669
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-locateNodes
574
670
  def locate_nodes(
575
671
  context:,
576
672
  locator:,
@@ -590,6 +686,7 @@ module Selenium
590
686
 
591
687
  # @api private
592
688
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
689
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate
593
690
  def navigate(context:, url:, wait: Serialization::UNSET)
594
691
  Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
595
692
  params = NavigateParameters.new(context: context, url: url, wait: wait)
@@ -598,6 +695,7 @@ module Selenium
598
695
 
599
696
  # @api private
600
697
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
698
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-print
601
699
  def print(
602
700
  context:,
603
701
  background: Serialization::UNSET,
@@ -624,6 +722,7 @@ module Selenium
624
722
 
625
723
  # @api private
626
724
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
725
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload
627
726
  def reload(context:, ignore_cache: Serialization::UNSET, wait: Serialization::UNSET)
628
727
  Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
629
728
  params = ReloadParameters.new(context: context, ignore_cache: ignore_cache, wait: wait)
@@ -632,6 +731,7 @@ module Selenium
632
731
 
633
732
  # @api private
634
733
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
734
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-setBypassCSP
635
735
  def set_bypass_csp(bypass:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
636
736
  params = SetBypassCSPParameters.new(bypass: bypass, contexts: contexts, user_contexts: user_contexts)
637
737
  execute(cmd: 'browsingContext.setBypassCSP', params: params)
@@ -639,6 +739,7 @@ module Selenium
639
739
 
640
740
  # @api private
641
741
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
742
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-setViewport
642
743
  def set_viewport(
643
744
  context: Serialization::UNSET,
644
745
  viewport: Serialization::UNSET,
@@ -656,6 +757,7 @@ module Selenium
656
757
 
657
758
  # @api private
658
759
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
760
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-startScreencast
659
761
  def start_screencast(
660
762
  context:,
661
763
  mime_type: Serialization::UNSET,
@@ -672,6 +774,7 @@ module Selenium
672
774
 
673
775
  # @api private
674
776
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
777
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-stopScreencast
675
778
  def stop_screencast(screencast:)
676
779
  params = StopScreencastParameters.new(screencast: screencast)
677
780
  execute(
@@ -683,6 +786,7 @@ module Selenium
683
786
 
684
787
  # @api private
685
788
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
789
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-traverseHistory
686
790
  def traverse_history(context:, delta:)
687
791
  params = TraverseHistoryParameters.new(context: context, delta: delta)
688
792
  execute(cmd: 'browsingContext.traverseHistory', params: params)