selenium-webdriver 4.45.0 → 4.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +7 -0
  3. data/bin/linux/selenium-manager +0 -0
  4. data/bin/macos/selenium-manager +0 -0
  5. data/bin/windows/selenium-manager.exe +0 -0
  6. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +465 -0
  7. data/lib/selenium/webdriver/bidi/protocol/browser.rb +222 -0
  8. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +694 -0
  9. data/lib/selenium/webdriver/bidi/protocol/domain.rb +40 -0
  10. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +334 -0
  11. data/lib/selenium/webdriver/bidi/protocol/input.rb +281 -0
  12. data/lib/selenium/webdriver/bidi/protocol/log.rb +104 -0
  13. data/lib/selenium/webdriver/bidi/protocol/network.rb +637 -0
  14. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +73 -0
  15. data/lib/selenium/webdriver/bidi/protocol/script.rb +874 -0
  16. data/lib/selenium/webdriver/bidi/protocol/session.rb +241 -0
  17. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +56 -0
  18. data/lib/selenium/webdriver/bidi/protocol/storage.rb +157 -0
  19. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +83 -0
  20. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +93 -0
  21. data/lib/selenium/webdriver/bidi/protocol.rb +39 -0
  22. data/lib/selenium/webdriver/bidi/serialization/record.rb +226 -0
  23. data/lib/selenium/webdriver/bidi/serialization/union.rb +114 -0
  24. data/lib/selenium/webdriver/bidi/serialization.rb +78 -0
  25. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +936 -0
  26. data/lib/selenium/webdriver/bidi/support/check_generated.rb +55 -0
  27. data/lib/selenium/webdriver/bidi/transport.rb +52 -0
  28. data/lib/selenium/webdriver/bidi.rb +3 -0
  29. data/lib/selenium/webdriver/chrome/driver.rb +3 -3
  30. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  31. data/lib/selenium/webdriver/common/driver.rb +2 -2
  32. data/lib/selenium/webdriver/common/local_driver.rb +15 -4
  33. data/lib/selenium/webdriver/common/proxy.rb +1 -1
  34. data/lib/selenium/webdriver/common.rb +1 -0
  35. data/lib/selenium/webdriver/edge/driver.rb +3 -3
  36. data/lib/selenium/webdriver/firefox/driver.rb +3 -3
  37. data/lib/selenium/webdriver/ie/driver.rb +3 -3
  38. data/lib/selenium/webdriver/remote/bidi_bridge.rb +6 -1
  39. data/lib/selenium/webdriver/remote/bridge.rb +8 -10
  40. data/lib/selenium/webdriver/remote/driver.rb +12 -4
  41. data/lib/selenium/webdriver/remote/http/common.rb +25 -12
  42. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  43. data/lib/selenium/webdriver/safari/driver.rb +3 -3
  44. data/lib/selenium/webdriver/version.rb +1 -1
  45. metadata +25 -2
@@ -0,0 +1,694 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. DO NOT EDIT!
21
+ # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
22
+
23
+ module Selenium
24
+ module WebDriver
25
+ class BiDi
26
+ module Protocol
27
+ # @api private
28
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ class BrowsingContext < Domain
30
+ EVENTS = {
31
+ context_created: 'browsingContext.contextCreated',
32
+ context_destroyed: 'browsingContext.contextDestroyed',
33
+ dom_content_loaded: 'browsingContext.domContentLoaded',
34
+ download_end: 'browsingContext.downloadEnd',
35
+ download_will_begin: 'browsingContext.downloadWillBegin',
36
+ fragment_navigated: 'browsingContext.fragmentNavigated',
37
+ history_updated: 'browsingContext.historyUpdated',
38
+ load: 'browsingContext.load',
39
+ navigation_aborted: 'browsingContext.navigationAborted',
40
+ navigation_committed: 'browsingContext.navigationCommitted',
41
+ navigation_failed: 'browsingContext.navigationFailed',
42
+ navigation_started: 'browsingContext.navigationStarted',
43
+ user_prompt_closed: 'browsingContext.userPromptClosed',
44
+ user_prompt_opened: 'browsingContext.userPromptOpened'
45
+ }.freeze
46
+
47
+ READINESS_STATE = {
48
+ none: 'none',
49
+ interactive: 'interactive',
50
+ complete: 'complete'
51
+ }.freeze
52
+
53
+ USER_PROMPT_TYPE = {
54
+ alert: 'alert',
55
+ beforeunload: 'beforeunload',
56
+ confirm: 'confirm',
57
+ prompt: 'prompt'
58
+ }.freeze
59
+
60
+ CREATE_TYPE = {
61
+ tab: 'tab',
62
+ window: 'window'
63
+ }.freeze
64
+
65
+ INNER_TEXT_LOCATOR_MATCH_TYPE = {
66
+ full: 'full',
67
+ partial: 'partial'
68
+ }.freeze
69
+
70
+ CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN = {
71
+ viewport: 'viewport',
72
+ document: 'document'
73
+ }.freeze
74
+
75
+ PRINT_PARAMETERS_ORIENTATION = {
76
+ portrait: 'portrait',
77
+ landscape: 'landscape'
78
+ }.freeze
79
+
80
+ # @api private
81
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
82
+ Info = Serialization::Record.define(
83
+ 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},
87
+ url: {wire_key: 'url', primitive: 'string'},
88
+ user_context: 'userContext',
89
+ parent: {wire_key: 'parent', required: false, nullable: true}
90
+ )
91
+
92
+ # @api private
93
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
94
+ class Locator < Serialization::Union
95
+ discriminator 'type', {
96
+ accessibility: 'accessibility',
97
+ css: 'css',
98
+ context: 'context',
99
+ inner_text: 'innerText',
100
+ xpath: 'xpath'
101
+ }
102
+ variants(
103
+ accessibility: 'BrowsingContext::AccessibilityLocator',
104
+ css: 'BrowsingContext::CssLocator',
105
+ context: 'BrowsingContext::ContextLocator',
106
+ inner_text: 'BrowsingContext::InnerTextLocator',
107
+ xpath: 'BrowsingContext::XPathLocator'
108
+ )
109
+ end
110
+
111
+ # @api private
112
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
113
+ AccessibilityLocator = Serialization::Record.define(
114
+ type: {fixed: 'accessibility'},
115
+ value: {wire_key: 'value', ref: 'BrowsingContext::AccessibilityLocator::Value'}
116
+ )
117
+
118
+ # @api private
119
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
120
+ AccessibilityLocator::Value = Serialization::Record.define(
121
+ name: {wire_key: 'name', required: false, primitive: 'string'},
122
+ role: {wire_key: 'role', required: false, primitive: 'string'}
123
+ )
124
+
125
+ # @api private
126
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
127
+ CssLocator = Serialization::Record.define(
128
+ type: {fixed: 'css'},
129
+ value: {wire_key: 'value', primitive: 'string'}
130
+ )
131
+
132
+ # @api private
133
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
134
+ ContextLocator = Serialization::Record.define(
135
+ type: {fixed: 'context'},
136
+ value: {wire_key: 'value', ref: 'BrowsingContext::ContextLocator::Value'}
137
+ )
138
+
139
+ # @api private
140
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
141
+ ContextLocator::Value = Serialization::Record.define(context: 'context')
142
+
143
+ # @api private
144
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
145
+ InnerTextLocator = Serialization::Record.define(
146
+ type: {fixed: 'innerText'},
147
+ value: {wire_key: 'value', primitive: 'string'},
148
+ ignore_case: {wire_key: 'ignoreCase', required: false, primitive: 'boolean'},
149
+ match_type: {wire_key: 'matchType', required: false, enum: 'BrowsingContext::INNER_TEXT_LOCATOR_MATCH_TYPE'},
150
+ max_depth: {wire_key: 'maxDepth', required: false}
151
+ )
152
+
153
+ # @api private
154
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
155
+ XPathLocator = Serialization::Record.define(
156
+ type: {fixed: 'xpath'},
157
+ value: {wire_key: 'value', primitive: 'string'}
158
+ )
159
+
160
+ # @api private
161
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
162
+ BaseNavigationInfo = Serialization::Record.define(
163
+ context: 'context',
164
+ navigation: {wire_key: 'navigation', nullable: true},
165
+ timestamp: 'timestamp',
166
+ url: {wire_key: 'url', primitive: 'string'},
167
+ user_context: {wire_key: 'userContext', required: false}
168
+ )
169
+
170
+ # @api private
171
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
172
+ NavigationInfo = Serialization::Record.define(
173
+ context: 'context',
174
+ navigation: {wire_key: 'navigation', nullable: true},
175
+ timestamp: 'timestamp',
176
+ url: {wire_key: 'url', primitive: 'string'},
177
+ user_context: {wire_key: 'userContext', required: false}
178
+ )
179
+
180
+ # @api private
181
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
182
+ ActivateParameters = Serialization::Record.define(context: 'context')
183
+
184
+ # @api private
185
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
186
+ CaptureScreenshotParameters = Serialization::Record.define(
187
+ context: 'context',
188
+ origin: {wire_key: 'origin', required: false, enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'},
189
+ format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
190
+ clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'}
191
+ )
192
+
193
+ # @api private
194
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
195
+ ImageFormat = Serialization::Record.define(
196
+ type: {wire_key: 'type', primitive: 'string'},
197
+ quality: {wire_key: 'quality', required: false, primitive: 'integer'}
198
+ )
199
+
200
+ # @api private
201
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
202
+ class ClipRectangle < Serialization::Union
203
+ discriminator 'type', {box: 'box', element: 'element'}
204
+ variants(
205
+ box: 'BrowsingContext::BoxClipRectangle',
206
+ element: 'BrowsingContext::ElementClipRectangle'
207
+ )
208
+ end
209
+
210
+ # @api private
211
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
212
+ ElementClipRectangle = Serialization::Record.define(
213
+ type: {fixed: 'element'},
214
+ element: {wire_key: 'element', ref: 'Script::SharedReference'}
215
+ )
216
+
217
+ # @api private
218
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
219
+ BoxClipRectangle = Serialization::Record.define(
220
+ type: {fixed: 'box'},
221
+ x: {wire_key: 'x', primitive: 'number'},
222
+ y: {wire_key: 'y', primitive: 'number'},
223
+ width: {wire_key: 'width', primitive: 'number'},
224
+ height: {wire_key: 'height', primitive: 'number'}
225
+ )
226
+
227
+ # @api private
228
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
229
+ CaptureScreenshotResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
230
+
231
+ # @api private
232
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
233
+ CloseParameters = Serialization::Record.define(
234
+ context: 'context',
235
+ prompt_unload: {wire_key: 'promptUnload', required: false, primitive: 'boolean'}
236
+ )
237
+
238
+ # @api private
239
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
240
+ CreateParameters = Serialization::Record.define(
241
+ type: {wire_key: 'type', enum: 'BrowsingContext::CREATE_TYPE'},
242
+ reference_context: {wire_key: 'referenceContext', required: false},
243
+ background: {wire_key: 'background', required: false, primitive: 'boolean'},
244
+ user_context: {wire_key: 'userContext', required: false}
245
+ )
246
+
247
+ # @api private
248
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
249
+ CreateResult = Serialization::Record.define(
250
+ context: 'context',
251
+ user_context: {wire_key: 'userContext', required: false}
252
+ )
253
+
254
+ # @api private
255
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
256
+ GetTreeParameters = Serialization::Record.define(
257
+ max_depth: {wire_key: 'maxDepth', required: false},
258
+ root: {wire_key: 'root', required: false}
259
+ )
260
+
261
+ # @api private
262
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
263
+ GetTreeResult = Serialization::Record.define(
264
+ contexts: {wire_key: 'contexts', ref: 'BrowsingContext::Info', list: true}
265
+ )
266
+
267
+ # @api private
268
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
269
+ HandleUserPromptParameters = Serialization::Record.define(
270
+ context: 'context',
271
+ accept: {wire_key: 'accept', required: false, primitive: 'boolean'},
272
+ user_text: {wire_key: 'userText', required: false, primitive: 'string'}
273
+ )
274
+
275
+ # @api private
276
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
277
+ LocateNodesParameters = Serialization::Record.define(
278
+ context: 'context',
279
+ locator: {wire_key: 'locator', ref: 'BrowsingContext::Locator'},
280
+ max_node_count: {wire_key: 'maxNodeCount', required: false},
281
+ serialization_options: {
282
+ wire_key: 'serializationOptions',
283
+ required: false,
284
+ ref: 'Script::SerializationOptions'
285
+ },
286
+ start_nodes: {wire_key: 'startNodes', required: false, ref: 'Script::SharedReference', list: true}
287
+ )
288
+
289
+ # @api private
290
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
291
+ LocateNodesResult = Serialization::Record.define(
292
+ nodes: {wire_key: 'nodes', ref: 'Script::NodeRemoteValue', list: true}
293
+ )
294
+
295
+ # @api private
296
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
297
+ NavigateParameters = Serialization::Record.define(
298
+ context: 'context',
299
+ url: {wire_key: 'url', primitive: 'string'},
300
+ wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
301
+ )
302
+
303
+ # @api private
304
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
305
+ NavigateResult = Serialization::Record.define(
306
+ navigation: {wire_key: 'navigation', nullable: true},
307
+ url: {wire_key: 'url', primitive: 'string'}
308
+ )
309
+
310
+ # @api private
311
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
312
+ PrintParameters = Serialization::Record.define(
313
+ context: 'context',
314
+ background: {wire_key: 'background', required: false, primitive: 'boolean'},
315
+ margin: {wire_key: 'margin', required: false, ref: 'BrowsingContext::PrintMarginParameters'},
316
+ orientation: {
317
+ wire_key: 'orientation',
318
+ required: false,
319
+ enum: 'BrowsingContext::PRINT_PARAMETERS_ORIENTATION'
320
+ },
321
+ page: {wire_key: 'page', required: false, ref: 'BrowsingContext::PrintPageParameters'},
322
+ page_ranges: {wire_key: 'pageRanges', required: false, list: true},
323
+ scale: {wire_key: 'scale', required: false, primitive: 'number'},
324
+ shrink_to_fit: {wire_key: 'shrinkToFit', required: false, primitive: 'boolean'}
325
+ )
326
+
327
+ # @api private
328
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
329
+ PrintMarginParameters = Serialization::Record.define(
330
+ bottom: {wire_key: 'bottom', required: false, primitive: 'number'},
331
+ left: {wire_key: 'left', required: false, primitive: 'number'},
332
+ right: {wire_key: 'right', required: false, primitive: 'number'},
333
+ top: {wire_key: 'top', required: false, primitive: 'number'}
334
+ )
335
+
336
+ # @api private
337
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
338
+ PrintPageParameters = Serialization::Record.define(
339
+ height: {wire_key: 'height', required: false, primitive: 'number'},
340
+ width: {wire_key: 'width', required: false, primitive: 'number'}
341
+ )
342
+
343
+ # @api private
344
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
345
+ PrintResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
346
+
347
+ # @api private
348
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
349
+ ReloadParameters = Serialization::Record.define(
350
+ context: 'context',
351
+ ignore_cache: {wire_key: 'ignoreCache', required: false, primitive: 'boolean'},
352
+ wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
353
+ )
354
+
355
+ # @api private
356
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
357
+ SetBypassCSPParameters = Serialization::Record.define(
358
+ bypass: {wire_key: 'bypass', nullable: true},
359
+ contexts: {wire_key: 'contexts', required: false, list: true},
360
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
361
+ )
362
+
363
+ # @api private
364
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
365
+ SetViewportParameters = Serialization::Record.define(
366
+ context: {wire_key: 'context', required: false},
367
+ viewport: {wire_key: 'viewport', required: false, nullable: true, ref: 'BrowsingContext::Viewport'},
368
+ device_pixel_ratio: {wire_key: 'devicePixelRatio', required: false, nullable: true, primitive: 'number'},
369
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
370
+ )
371
+
372
+ # @api private
373
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
374
+ Viewport = Serialization::Record.define(width: 'width', height: 'height')
375
+
376
+ # @api private
377
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
378
+ StartScreencastParameters = Serialization::Record.define(
379
+ context: 'context',
380
+ mime_type: {wire_key: 'mimeType', required: false, primitive: 'string'},
381
+ video: {wire_key: 'video', required: false, ref: 'BrowsingContext::MediaTrackConstraints'},
382
+ audio: {wire_key: 'audio', required: false, primitive: 'boolean'}
383
+ )
384
+
385
+ # @api private
386
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
387
+ 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}
391
+ )
392
+
393
+ # @api private
394
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
395
+ StartScreencastResult = Serialization::Record.define(
396
+ screencast: 'screencast',
397
+ path: {wire_key: 'path', primitive: 'string'}
398
+ )
399
+
400
+ # @api private
401
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
402
+ StopScreencastParameters = Serialization::Record.define(screencast: 'screencast')
403
+
404
+ # @api private
405
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
406
+ StopScreencastResult = Serialization::Record.define(
407
+ path: {wire_key: 'path', primitive: 'string'},
408
+ error: {wire_key: 'error', required: false, primitive: 'string'}
409
+ )
410
+
411
+ # @api private
412
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
413
+ TraverseHistoryParameters = Serialization::Record.define(context: 'context', delta: 'delta')
414
+
415
+ # @api private
416
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
417
+ HistoryUpdatedParameters = Serialization::Record.define(
418
+ context: 'context',
419
+ timestamp: 'timestamp',
420
+ url: {wire_key: 'url', primitive: 'string'},
421
+ user_context: {wire_key: 'userContext', required: false}
422
+ )
423
+
424
+ # @api private
425
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
426
+ DownloadWillBeginParams = Serialization::Record.define(
427
+ download: 'download',
428
+ suggested_filename: {wire_key: 'suggestedFilename', primitive: 'string'},
429
+ context: 'context',
430
+ navigation: {wire_key: 'navigation', nullable: true},
431
+ timestamp: 'timestamp',
432
+ url: {wire_key: 'url', primitive: 'string'},
433
+ user_context: {wire_key: 'userContext', required: false}
434
+ )
435
+
436
+ # @api private
437
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
438
+ class DownloadEndParams < Serialization::Union
439
+ discriminator 'status', {canceled: 'canceled', complete: 'complete'}
440
+ variants(
441
+ canceled: 'BrowsingContext::DownloadEndParams::CanceledParams',
442
+ complete: 'BrowsingContext::DownloadEndParams::CompleteParams'
443
+ )
444
+
445
+ # @api private
446
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
447
+ CanceledParams = Serialization::Record.define(
448
+ status: {fixed: 'canceled'},
449
+ download: 'download',
450
+ context: 'context',
451
+ navigation: {wire_key: 'navigation', nullable: true},
452
+ timestamp: 'timestamp',
453
+ url: {wire_key: 'url', primitive: 'string'},
454
+ user_context: {wire_key: 'userContext', required: false}
455
+ )
456
+
457
+ # @api private
458
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
459
+ CompleteParams = Serialization::Record.define(
460
+ status: {fixed: 'complete'},
461
+ download: 'download',
462
+ filepath: {wire_key: 'filepath', nullable: true, primitive: 'string'},
463
+ context: 'context',
464
+ navigation: {wire_key: 'navigation', nullable: true},
465
+ timestamp: 'timestamp',
466
+ url: {wire_key: 'url', primitive: 'string'},
467
+ user_context: {wire_key: 'userContext', required: false}
468
+ )
469
+ end
470
+
471
+ # @api private
472
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
473
+ UserPromptClosedParameters = Serialization::Record.define(
474
+ context: 'context',
475
+ accepted: {wire_key: 'accepted', primitive: 'boolean'},
476
+ type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
477
+ user_context: {wire_key: 'userContext', required: false},
478
+ user_text: {wire_key: 'userText', required: false, primitive: 'string'}
479
+ )
480
+
481
+ # @api private
482
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
483
+ UserPromptOpenedParameters = Serialization::Record.define(
484
+ context: 'context',
485
+ handler: {wire_key: 'handler', enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
486
+ message: {wire_key: 'message', primitive: 'string'},
487
+ type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
488
+ user_context: {wire_key: 'userContext', required: false},
489
+ default_value: {wire_key: 'defaultValue', required: false, primitive: 'string'}
490
+ )
491
+
492
+ EVENT_TYPES = {
493
+ 'browsingContext.contextCreated' => BrowsingContext::Info,
494
+ 'browsingContext.contextDestroyed' => BrowsingContext::Info,
495
+ 'browsingContext.domContentLoaded' => BrowsingContext::NavigationInfo,
496
+ 'browsingContext.downloadEnd' => BrowsingContext::DownloadEndParams,
497
+ 'browsingContext.downloadWillBegin' => BrowsingContext::DownloadWillBeginParams,
498
+ 'browsingContext.fragmentNavigated' => BrowsingContext::NavigationInfo,
499
+ 'browsingContext.historyUpdated' => BrowsingContext::HistoryUpdatedParameters,
500
+ 'browsingContext.load' => BrowsingContext::NavigationInfo,
501
+ 'browsingContext.navigationAborted' => BrowsingContext::NavigationInfo,
502
+ 'browsingContext.navigationCommitted' => BrowsingContext::NavigationInfo,
503
+ 'browsingContext.navigationFailed' => BrowsingContext::NavigationInfo,
504
+ 'browsingContext.navigationStarted' => BrowsingContext::NavigationInfo,
505
+ 'browsingContext.userPromptClosed' => BrowsingContext::UserPromptClosedParameters,
506
+ 'browsingContext.userPromptOpened' => BrowsingContext::UserPromptOpenedParameters
507
+ }.freeze
508
+
509
+ # @api private
510
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
511
+ def activate(context:)
512
+ params = ActivateParameters.new(context: context)
513
+ execute(cmd: 'browsingContext.activate', params: params)
514
+ end
515
+
516
+ # @api private
517
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
518
+ def capture_screenshot(
519
+ context:,
520
+ origin: Serialization::UNSET,
521
+ format: Serialization::UNSET,
522
+ clip: Serialization::UNSET
523
+ )
524
+ Serialization.validate!('origin', origin, BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN)
525
+ params = CaptureScreenshotParameters.new(context: context, origin: origin, format: format, clip: clip)
526
+ execute(
527
+ cmd: 'browsingContext.captureScreenshot',
528
+ params: params,
529
+ result: BrowsingContext::CaptureScreenshotResult
530
+ )
531
+ end
532
+
533
+ # @api private
534
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
535
+ def close(context:, prompt_unload: Serialization::UNSET)
536
+ params = CloseParameters.new(context: context, prompt_unload: prompt_unload)
537
+ execute(cmd: 'browsingContext.close', params: params)
538
+ end
539
+
540
+ # @api private
541
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
542
+ def create(
543
+ type:,
544
+ reference_context: Serialization::UNSET,
545
+ background: Serialization::UNSET,
546
+ user_context: Serialization::UNSET
547
+ )
548
+ Serialization.validate!('type', type, BrowsingContext::CREATE_TYPE)
549
+ params = CreateParameters.new(
550
+ type: type,
551
+ reference_context: reference_context,
552
+ background: background,
553
+ user_context: user_context
554
+ )
555
+ execute(cmd: 'browsingContext.create', params: params, result: BrowsingContext::CreateResult)
556
+ end
557
+
558
+ # @api private
559
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
560
+ def get_tree(max_depth: Serialization::UNSET, root: Serialization::UNSET)
561
+ params = GetTreeParameters.new(max_depth: max_depth, root: root)
562
+ execute(cmd: 'browsingContext.getTree', params: params, result: BrowsingContext::GetTreeResult)
563
+ end
564
+
565
+ # @api private
566
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
567
+ def handle_user_prompt(context:, accept: Serialization::UNSET, user_text: Serialization::UNSET)
568
+ params = HandleUserPromptParameters.new(context: context, accept: accept, user_text: user_text)
569
+ execute(cmd: 'browsingContext.handleUserPrompt', params: params)
570
+ end
571
+
572
+ # @api private
573
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
574
+ def locate_nodes(
575
+ context:,
576
+ locator:,
577
+ max_node_count: Serialization::UNSET,
578
+ serialization_options: Serialization::UNSET,
579
+ start_nodes: Serialization::UNSET
580
+ )
581
+ params = LocateNodesParameters.new(
582
+ context: context,
583
+ locator: locator,
584
+ max_node_count: max_node_count,
585
+ serialization_options: serialization_options,
586
+ start_nodes: start_nodes
587
+ )
588
+ execute(cmd: 'browsingContext.locateNodes', params: params, result: BrowsingContext::LocateNodesResult)
589
+ end
590
+
591
+ # @api private
592
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
593
+ def navigate(context:, url:, wait: Serialization::UNSET)
594
+ Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
595
+ params = NavigateParameters.new(context: context, url: url, wait: wait)
596
+ execute(cmd: 'browsingContext.navigate', params: params, result: BrowsingContext::NavigateResult)
597
+ end
598
+
599
+ # @api private
600
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
601
+ def print(
602
+ context:,
603
+ background: Serialization::UNSET,
604
+ margin: Serialization::UNSET,
605
+ orientation: Serialization::UNSET,
606
+ page: Serialization::UNSET,
607
+ page_ranges: Serialization::UNSET,
608
+ scale: Serialization::UNSET,
609
+ shrink_to_fit: Serialization::UNSET
610
+ )
611
+ Serialization.validate!('orientation', orientation, BrowsingContext::PRINT_PARAMETERS_ORIENTATION)
612
+ params = PrintParameters.new(
613
+ context: context,
614
+ background: background,
615
+ margin: margin,
616
+ orientation: orientation,
617
+ page: page,
618
+ page_ranges: page_ranges,
619
+ scale: scale,
620
+ shrink_to_fit: shrink_to_fit
621
+ )
622
+ execute(cmd: 'browsingContext.print', params: params, result: BrowsingContext::PrintResult)
623
+ end
624
+
625
+ # @api private
626
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
627
+ def reload(context:, ignore_cache: Serialization::UNSET, wait: Serialization::UNSET)
628
+ Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
629
+ params = ReloadParameters.new(context: context, ignore_cache: ignore_cache, wait: wait)
630
+ execute(cmd: 'browsingContext.reload', params: params, result: BrowsingContext::NavigateResult)
631
+ end
632
+
633
+ # @api private
634
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
635
+ def set_bypass_csp(bypass:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
636
+ params = SetBypassCSPParameters.new(bypass: bypass, contexts: contexts, user_contexts: user_contexts)
637
+ execute(cmd: 'browsingContext.setBypassCSP', params: params)
638
+ end
639
+
640
+ # @api private
641
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
642
+ def set_viewport(
643
+ context: Serialization::UNSET,
644
+ viewport: Serialization::UNSET,
645
+ device_pixel_ratio: Serialization::UNSET,
646
+ user_contexts: Serialization::UNSET
647
+ )
648
+ params = SetViewportParameters.new(
649
+ context: context,
650
+ viewport: viewport,
651
+ device_pixel_ratio: device_pixel_ratio,
652
+ user_contexts: user_contexts
653
+ )
654
+ execute(cmd: 'browsingContext.setViewport', params: params)
655
+ end
656
+
657
+ # @api private
658
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
659
+ def start_screencast(
660
+ context:,
661
+ mime_type: Serialization::UNSET,
662
+ video: Serialization::UNSET,
663
+ audio: Serialization::UNSET
664
+ )
665
+ params = StartScreencastParameters.new(context: context, mime_type: mime_type, video: video, audio: audio)
666
+ execute(
667
+ cmd: 'browsingContext.startScreencast',
668
+ params: params,
669
+ result: BrowsingContext::StartScreencastResult
670
+ )
671
+ end
672
+
673
+ # @api private
674
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
675
+ def stop_screencast(screencast:)
676
+ params = StopScreencastParameters.new(screencast: screencast)
677
+ execute(
678
+ cmd: 'browsingContext.stopScreencast',
679
+ params: params,
680
+ result: BrowsingContext::StopScreencastResult
681
+ )
682
+ end
683
+
684
+ # @api private
685
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
686
+ def traverse_history(context:, delta:)
687
+ params = TraverseHistoryParameters.new(context: context, delta: delta)
688
+ execute(cmd: 'browsingContext.traverseHistory', params: params)
689
+ end
690
+ end # BrowsingContext
691
+ end # Protocol
692
+ end # BiDi
693
+ end # WebDriver
694
+ end # Selenium