selenium-webdriver 4.35.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +111 -0
  3. data/Gemfile +1 -4
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +43 -23
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
  10. data/bin/selenium-manager.cdx.json +11629 -0
  11. data/bin/windows/selenium-manager.exe +0 -0
  12. data/lib/selenium/server.rb +30 -5
  13. data/lib/selenium/webdriver/atoms/findElements.js +272 -54
  14. data/lib/selenium/webdriver/atoms/getAttribute.js +152 -6
  15. data/lib/selenium/webdriver/atoms/isDisplayed.js +385 -28
  16. data/lib/selenium/webdriver/bidi/browser.rb +71 -0
  17. data/lib/selenium/webdriver/bidi/browsing_context.rb +3 -2
  18. data/lib/selenium/webdriver/bidi/{log/filter_by.rb → error.rb} +20 -16
  19. data/lib/selenium/webdriver/bidi/log_handler.rb +5 -0
  20. data/lib/selenium/webdriver/bidi/network/cookies.rb +13 -9
  21. data/lib/selenium/webdriver/bidi/network/credentials.rb +4 -0
  22. data/lib/selenium/webdriver/bidi/network/headers.rb +4 -0
  23. data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +4 -0
  24. data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +4 -0
  25. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +20 -4
  26. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +24 -6
  27. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +4 -0
  28. data/lib/selenium/webdriver/bidi/network.rb +18 -9
  29. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
  30. data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
  31. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
  32. data/lib/selenium/webdriver/bidi/{log/base_log_entry.rb → protocol/domain.rb} +22 -11
  33. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
  34. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  35. data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
  36. data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
  37. data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
  38. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
  39. data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
  40. data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
  41. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
  42. data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
  43. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
  44. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
  45. data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
  46. data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
  47. data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
  48. data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
  49. data/lib/selenium/webdriver/bidi/session.rb +4 -0
  50. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
  51. data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
  52. data/lib/selenium/webdriver/bidi/transport.rb +57 -0
  53. data/lib/selenium/webdriver/bidi.rb +4 -1
  54. data/lib/selenium/webdriver/chrome/driver.rb +4 -3
  55. data/lib/selenium/webdriver/chrome/service.rb +13 -0
  56. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  57. data/lib/selenium/webdriver/chromium/options.rb +23 -1
  58. data/lib/selenium/webdriver/chromium/profile.rb +6 -0
  59. data/lib/selenium/webdriver/common/child_process.rb +2 -1
  60. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  61. data/lib/selenium/webdriver/common/driver.rb +13 -7
  62. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  63. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  64. data/lib/selenium/webdriver/common/driver_extensions/{has_bidi.rb → has_session_events.rb} +19 -7
  65. data/lib/selenium/webdriver/common/driver_finder.rb +35 -25
  66. data/lib/selenium/webdriver/common/error.rb +10 -3
  67. data/lib/selenium/webdriver/common/local_driver.rb +29 -12
  68. data/lib/selenium/webdriver/common/logger.rb +28 -0
  69. data/lib/selenium/webdriver/common/manager.rb +2 -0
  70. data/lib/selenium/webdriver/common/options.rb +41 -2
  71. data/lib/selenium/webdriver/common/platform.rb +1 -3
  72. data/lib/selenium/webdriver/common/proxy.rb +1 -9
  73. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  74. data/lib/selenium/webdriver/common/service.rb +4 -8
  75. data/lib/selenium/webdriver/common/service_manager.rb +36 -4
  76. data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
  77. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  78. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +1 -1
  79. data/lib/selenium/webdriver/common/wait.rb +4 -1
  80. data/lib/selenium/webdriver/common/websocket_connection.rb +73 -37
  81. data/lib/selenium/webdriver/common.rb +2 -1
  82. data/lib/selenium/webdriver/devtools/response.rb +3 -3
  83. data/lib/selenium/webdriver/devtools.rb +1 -1
  84. data/lib/selenium/webdriver/edge/driver.rb +4 -3
  85. data/lib/selenium/webdriver/edge/service.rb +14 -0
  86. data/lib/selenium/webdriver/firefox/driver.rb +4 -6
  87. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  88. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  89. data/lib/selenium/webdriver/firefox/service.rb +31 -2
  90. data/lib/selenium/webdriver/ie/driver.rb +4 -3
  91. data/lib/selenium/webdriver/ie/service.rb +10 -0
  92. data/lib/selenium/webdriver/remote/bidi_bridge.rb +44 -10
  93. data/lib/selenium/webdriver/remote/bridge.rb +20 -14
  94. data/lib/selenium/webdriver/remote/driver.rb +15 -4
  95. data/lib/selenium/webdriver/remote/features.rb +26 -1
  96. data/lib/selenium/webdriver/remote/http/common.rb +57 -12
  97. data/lib/selenium/webdriver/remote/http/curb.rb +6 -8
  98. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  99. data/lib/selenium/webdriver/safari/driver.rb +4 -3
  100. data/lib/selenium/webdriver/safari/options.rb +23 -4
  101. data/lib/selenium/webdriver/safari.rb +1 -6
  102. data/lib/selenium/webdriver/support/block_event_listener.rb +5 -1
  103. data/lib/selenium/webdriver/support/color.rb +14 -14
  104. data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -1
  105. data/lib/selenium/webdriver/support/guards/guard.rb +30 -14
  106. data/lib/selenium/webdriver/support/guards.rb +11 -4
  107. data/lib/selenium/webdriver/version.rb +1 -1
  108. data/lib/selenium/webdriver.rb +7 -2
  109. data/selenium-webdriver.gemspec +1 -1
  110. metadata +33 -11
  111. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
  112. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
  113. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
  114. data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
@@ -0,0 +1,798 @@
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
+ # 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
+
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
+ # @see https://w3c.github.io/webdriver-bidi/#module-browsingContext
30
+ class BrowsingContext < Domain
31
+ EVENTS = {
32
+ context_created: 'browsingContext.contextCreated',
33
+ context_destroyed: 'browsingContext.contextDestroyed',
34
+ dom_content_loaded: 'browsingContext.domContentLoaded',
35
+ download_end: 'browsingContext.downloadEnd',
36
+ download_will_begin: 'browsingContext.downloadWillBegin',
37
+ fragment_navigated: 'browsingContext.fragmentNavigated',
38
+ history_updated: 'browsingContext.historyUpdated',
39
+ load: 'browsingContext.load',
40
+ navigation_aborted: 'browsingContext.navigationAborted',
41
+ navigation_committed: 'browsingContext.navigationCommitted',
42
+ navigation_failed: 'browsingContext.navigationFailed',
43
+ navigation_started: 'browsingContext.navigationStarted',
44
+ user_prompt_closed: 'browsingContext.userPromptClosed',
45
+ user_prompt_opened: 'browsingContext.userPromptOpened'
46
+ }.freeze
47
+
48
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-ReadinessState
49
+ READINESS_STATE = {
50
+ none: 'none',
51
+ interactive: 'interactive',
52
+ complete: 'complete'
53
+ }.freeze
54
+
55
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-UserPromptType
56
+ USER_PROMPT_TYPE = {
57
+ alert: 'alert',
58
+ beforeunload: 'beforeunload',
59
+ confirm: 'confirm',
60
+ prompt: 'prompt'
61
+ }.freeze
62
+
63
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreatetype
64
+ CREATE_TYPE = {
65
+ tab: 'tab',
66
+ window: 'window'
67
+ }.freeze
68
+
69
+ INNER_TEXT_LOCATOR_MATCH_TYPE = {
70
+ full: 'full',
71
+ partial: 'partial'
72
+ }.freeze
73
+
74
+ CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN = {
75
+ viewport: 'viewport',
76
+ document: 'document'
77
+ }.freeze
78
+
79
+ PRINT_PARAMETERS_ORIENTATION = {
80
+ portrait: 'portrait',
81
+ landscape: 'landscape'
82
+ }.freeze
83
+
84
+ # @api private
85
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
86
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-Info
87
+ Info = Serialization::Record.define(
88
+ children: {wire_key: 'children', nullable: true, ref: 'BrowsingContext::Info', list: 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'},
92
+ url: {wire_key: 'url', primitive: 'string'},
93
+ user_context: {wire_key: 'userContext', primitive: 'string'},
94
+ parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'}
95
+ )
96
+
97
+ # @api private
98
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
99
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-Locator
100
+ class Locator < Serialization::Union
101
+ discriminator 'type', {
102
+ accessibility: 'accessibility',
103
+ css: 'css',
104
+ context: 'context',
105
+ inner_text: 'innerText',
106
+ xpath: 'xpath'
107
+ }
108
+ variants(
109
+ accessibility: 'BrowsingContext::AccessibilityLocator',
110
+ css: 'BrowsingContext::CssLocator',
111
+ context: 'BrowsingContext::ContextLocator',
112
+ inner_text: 'BrowsingContext::InnerTextLocator',
113
+ xpath: 'BrowsingContext::XPathLocator'
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(**)
122
+ end
123
+
124
+ # @api private
125
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
126
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextaccessibilitylocator
127
+ AccessibilityLocator = Serialization::Record.define(
128
+ type: {fixed: 'accessibility'},
129
+ value: {wire_key: 'value', ref: 'BrowsingContext::AccessibilityLocator::Value'}
130
+ )
131
+
132
+ # @api private
133
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
134
+ AccessibilityLocator::Value = Serialization::Record.define(
135
+ name: {wire_key: 'name', required: false, primitive: 'string'},
136
+ role: {wire_key: 'role', required: false, primitive: 'string'}
137
+ )
138
+
139
+ # @api private
140
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
141
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcsslocator
142
+ CssLocator = Serialization::Record.define(
143
+ type: {fixed: 'css'},
144
+ value: {wire_key: 'value', primitive: 'string'}
145
+ )
146
+
147
+ # @api private
148
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
149
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcontextlocator
150
+ ContextLocator = Serialization::Record.define(
151
+ type: {fixed: 'context'},
152
+ value: {wire_key: 'value', ref: 'BrowsingContext::ContextLocator::Value'}
153
+ )
154
+
155
+ # @api private
156
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
157
+ ContextLocator::Value = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
158
+
159
+ # @api private
160
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
161
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextinnertextlocator
162
+ InnerTextLocator = Serialization::Record.define(
163
+ type: {fixed: 'innerText'},
164
+ value: {wire_key: 'value', primitive: 'string'},
165
+ ignore_case: {wire_key: 'ignoreCase', required: false, primitive: 'boolean'},
166
+ match_type: {wire_key: 'matchType', required: false, enum: 'BrowsingContext::INNER_TEXT_LOCATOR_MATCH_TYPE'},
167
+ max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer'}
168
+ )
169
+
170
+ # @api private
171
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
172
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextxpathlocator
173
+ XPathLocator = Serialization::Record.define(
174
+ type: {fixed: 'xpath'},
175
+ value: {wire_key: 'value', primitive: 'string'}
176
+ )
177
+
178
+ # @api private
179
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
180
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextbasenavigationinfo
181
+ BaseNavigationInfo = Serialization::Record.define(
182
+ context: {wire_key: 'context', primitive: 'string'},
183
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
184
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
185
+ url: {wire_key: 'url', primitive: 'string'},
186
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
187
+ )
188
+
189
+ # @api private
190
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
191
+ # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-NavigationInfo
192
+ NavigationInfo = Serialization::Record.define(
193
+ context: {wire_key: 'context', primitive: 'string'},
194
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
195
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
196
+ url: {wire_key: 'url', primitive: 'string'},
197
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
198
+ )
199
+
200
+ # @api private
201
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
202
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextactivateparameters
203
+ ActivateParameters = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
204
+
205
+ # @api private
206
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
207
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcapturescreenshotparameters
208
+ CaptureScreenshotParameters = Serialization::Record.define(
209
+ context: {wire_key: 'context', primitive: 'string'},
210
+ origin: {wire_key: 'origin', required: false, enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'},
211
+ format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
212
+ clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'}
213
+ )
214
+
215
+ # @api private
216
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
217
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimageformat
218
+ ImageFormat = Serialization::Record.define(
219
+ type: {wire_key: 'type', primitive: 'string'},
220
+ quality: {wire_key: 'quality', required: false, primitive: 'number'}
221
+ )
222
+
223
+ # @api private
224
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcliprectangle
226
+ class ClipRectangle < Serialization::Union
227
+ discriminator 'type', {box: 'box', element: 'element'}
228
+ variants(
229
+ box: 'BrowsingContext::BoxClipRectangle',
230
+ element: 'BrowsingContext::ElementClipRectangle'
231
+ )
232
+ object_only
233
+
234
+ def self.box(**) = BrowsingContext::BoxClipRectangle.new(**)
235
+ def self.element(**) = BrowsingContext::ElementClipRectangle.new(**)
236
+ end
237
+
238
+ # @api private
239
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
240
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextelementcliprectangle
241
+ ElementClipRectangle = Serialization::Record.define(
242
+ type: {fixed: 'element'},
243
+ element: {wire_key: 'element', ref: 'Script::SharedReference'}
244
+ )
245
+
246
+ # @api private
247
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
248
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextboxcliprectangle
249
+ BoxClipRectangle = Serialization::Record.define(
250
+ type: {fixed: 'box'},
251
+ x: {wire_key: 'x', primitive: 'number'},
252
+ y: {wire_key: 'y', primitive: 'number'},
253
+ width: {wire_key: 'width', primitive: 'number'},
254
+ height: {wire_key: 'height', primitive: 'number'}
255
+ )
256
+
257
+ # @api private
258
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
259
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcapturescreenshotresult
260
+ CaptureScreenshotResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
261
+
262
+ # @api private
263
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
264
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcloseparameters
265
+ CloseParameters = Serialization::Record.define(
266
+ context: {wire_key: 'context', primitive: 'string'},
267
+ prompt_unload: {wire_key: 'promptUnload', required: false, primitive: 'boolean'}
268
+ )
269
+
270
+ # @api private
271
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
272
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreateparameters
273
+ CreateParameters = Serialization::Record.define(
274
+ type: {wire_key: 'type', enum: 'BrowsingContext::CREATE_TYPE'},
275
+ reference_context: {wire_key: 'referenceContext', required: false, primitive: 'string'},
276
+ background: {wire_key: 'background', required: false, primitive: 'boolean'},
277
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
278
+ )
279
+
280
+ # @api private
281
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
282
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcreateresult
283
+ CreateResult = Serialization::Record.define(
284
+ context: {wire_key: 'context', primitive: 'string'},
285
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
286
+ )
287
+
288
+ # @api private
289
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
290
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeparameters
291
+ GetTreeParameters = Serialization::Record.define(
292
+ max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer'},
293
+ root: {wire_key: 'root', required: false, primitive: 'string'}
294
+ )
295
+
296
+ # @api private
297
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
298
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeresult
299
+ GetTreeResult = Serialization::Record.define(
300
+ contexts: {wire_key: 'contexts', ref: 'BrowsingContext::Info', list: true}
301
+ )
302
+
303
+ # @api private
304
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
305
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexthandleuserpromptparameters
306
+ HandleUserPromptParameters = Serialization::Record.define(
307
+ context: {wire_key: 'context', primitive: 'string'},
308
+ accept: {wire_key: 'accept', required: false, primitive: 'boolean'},
309
+ user_text: {wire_key: 'userText', required: false, primitive: 'string'}
310
+ )
311
+
312
+ # @api private
313
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
314
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextlocatenodesparameters
315
+ LocateNodesParameters = Serialization::Record.define(
316
+ context: {wire_key: 'context', primitive: 'string'},
317
+ locator: {wire_key: 'locator', ref: 'BrowsingContext::Locator'},
318
+ max_node_count: {wire_key: 'maxNodeCount', required: false, primitive: 'integer'},
319
+ serialization_options: {
320
+ wire_key: 'serializationOptions',
321
+ required: false,
322
+ ref: 'Script::SerializationOptions'
323
+ },
324
+ start_nodes: {wire_key: 'startNodes', required: false, ref: 'Script::SharedReference', list: true}
325
+ )
326
+
327
+ # @api private
328
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
329
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextlocatenodesresult
330
+ LocateNodesResult = Serialization::Record.define(
331
+ nodes: {wire_key: 'nodes', ref: 'Script::NodeRemoteValue', list: true}
332
+ )
333
+
334
+ # @api private
335
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
336
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextnavigateparameters
337
+ NavigateParameters = Serialization::Record.define(
338
+ context: {wire_key: 'context', primitive: 'string'},
339
+ url: {wire_key: 'url', primitive: 'string'},
340
+ wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
341
+ )
342
+
343
+ # @api private
344
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
345
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextnavigateresult
346
+ NavigateResult = Serialization::Record.define(
347
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
348
+ url: {wire_key: 'url', primitive: 'string'}
349
+ )
350
+
351
+ # @api private
352
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
353
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintparameters
354
+ PrintParameters = Serialization::Record.define(
355
+ context: {wire_key: 'context', primitive: 'string'},
356
+ background: {wire_key: 'background', required: false, primitive: 'boolean'},
357
+ margin: {wire_key: 'margin', required: false, ref: 'BrowsingContext::PrintMarginParameters'},
358
+ orientation: {
359
+ wire_key: 'orientation',
360
+ required: false,
361
+ enum: 'BrowsingContext::PRINT_PARAMETERS_ORIENTATION'
362
+ },
363
+ page: {wire_key: 'page', required: false, ref: 'BrowsingContext::PrintPageParameters'},
364
+ page_ranges: {wire_key: 'pageRanges', required: false, list: true},
365
+ scale: {wire_key: 'scale', required: false, primitive: 'number'},
366
+ shrink_to_fit: {wire_key: 'shrinkToFit', required: false, primitive: 'boolean'}
367
+ )
368
+
369
+ # @api private
370
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
371
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintmarginparameters
372
+ PrintMarginParameters = Serialization::Record.define(
373
+ bottom: {wire_key: 'bottom', required: false, primitive: 'number'},
374
+ left: {wire_key: 'left', required: false, primitive: 'number'},
375
+ right: {wire_key: 'right', required: false, primitive: 'number'},
376
+ top: {wire_key: 'top', required: false, primitive: 'number'}
377
+ )
378
+
379
+ # @api private
380
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
381
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintpageparameters
382
+ PrintPageParameters = Serialization::Record.define(
383
+ height: {wire_key: 'height', required: false, primitive: 'number'},
384
+ width: {wire_key: 'width', required: false, primitive: 'number'}
385
+ )
386
+
387
+ # @api private
388
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
389
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextprintresult
390
+ PrintResult = Serialization::Record.define(data: {wire_key: 'data', primitive: 'string'})
391
+
392
+ # @api private
393
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
394
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextreloadparameters
395
+ ReloadParameters = Serialization::Record.define(
396
+ context: {wire_key: 'context', primitive: 'string'},
397
+ ignore_cache: {wire_key: 'ignoreCache', required: false, primitive: 'boolean'},
398
+ wait: {wire_key: 'wait', required: false, enum: 'BrowsingContext::READINESS_STATE'}
399
+ )
400
+
401
+ # @api private
402
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
403
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextsetbypasscspparameters
404
+ SetBypassCSPParameters = Serialization::Record.define(
405
+ bypass: {wire_key: 'bypass', nullable: true, const: true},
406
+ contexts: {wire_key: 'contexts', required: false, list: true},
407
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
408
+ )
409
+
410
+ # @api private
411
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
412
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextsetviewportparameters
413
+ SetViewportParameters = Serialization::Record.define(
414
+ context: {wire_key: 'context', required: false, primitive: 'string'},
415
+ viewport: {wire_key: 'viewport', required: false, nullable: true, ref: 'BrowsingContext::Viewport'},
416
+ device_pixel_ratio: {wire_key: 'devicePixelRatio', required: false, nullable: true, primitive: 'number'},
417
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
418
+ )
419
+
420
+ # @api private
421
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
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
+ )
427
+
428
+ # @api private
429
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
430
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstartscreencastparameters
431
+ StartScreencastParameters = Serialization::Record.define(
432
+ context: {wire_key: 'context', primitive: 'string'},
433
+ mime_type: {wire_key: 'mimeType', required: false, primitive: 'string'},
434
+ video: {wire_key: 'video', required: false, ref: 'BrowsingContext::MediaTrackConstraints'},
435
+ audio: {wire_key: 'audio', required: false, primitive: 'boolean'}
436
+ )
437
+
438
+ # @api private
439
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
440
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextmediatrackconstraints
441
+ MediaTrackConstraints = Serialization::Record.define(
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'}
445
+ )
446
+
447
+ # @api private
448
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
449
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstartscreencastresult
450
+ StartScreencastResult = Serialization::Record.define(
451
+ screencast: {wire_key: 'screencast', primitive: 'string'},
452
+ path: {wire_key: 'path', primitive: 'string'}
453
+ )
454
+
455
+ # @api private
456
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
457
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstopscreencastparameters
458
+ StopScreencastParameters = Serialization::Record.define(
459
+ screencast: {wire_key: 'screencast', primitive: 'string'}
460
+ )
461
+
462
+ # @api private
463
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
464
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstopscreencastresult
465
+ StopScreencastResult = Serialization::Record.define(
466
+ path: {wire_key: 'path', primitive: 'string'},
467
+ error: {wire_key: 'error', required: false, primitive: 'string'}
468
+ )
469
+
470
+ # @api private
471
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
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
+ )
477
+
478
+ # @api private
479
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
480
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontexthistoryupdatedparameters
481
+ HistoryUpdatedParameters = Serialization::Record.define(
482
+ context: {wire_key: 'context', primitive: 'string'},
483
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
484
+ url: {wire_key: 'url', primitive: 'string'},
485
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
486
+ )
487
+
488
+ # @api private
489
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
490
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextdownloadwillbeginparams
491
+ DownloadWillBeginParams = Serialization::Record.define(
492
+ download: {wire_key: 'download', primitive: 'string'},
493
+ suggested_filename: {wire_key: 'suggestedFilename', primitive: 'string'},
494
+ context: {wire_key: 'context', primitive: 'string'},
495
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
496
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
497
+ url: {wire_key: 'url', primitive: 'string'},
498
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
499
+ )
500
+
501
+ # @api private
502
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
503
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextdownloadendparams
504
+ class DownloadEndParams < Serialization::Union
505
+ discriminator 'status', {canceled: 'canceled', complete: 'complete'}
506
+ variants(
507
+ canceled: 'BrowsingContext::DownloadEndParams::CanceledParams',
508
+ complete: 'BrowsingContext::DownloadEndParams::CompleteParams'
509
+ )
510
+ object_only
511
+
512
+ # @api private
513
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
514
+ CanceledParams = Serialization::Record.define(
515
+ status: {fixed: 'canceled'},
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'},
520
+ url: {wire_key: 'url', primitive: 'string'},
521
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
522
+ )
523
+
524
+ # @api private
525
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
526
+ CompleteParams = Serialization::Record.define(
527
+ status: {fixed: 'complete'},
528
+ download: {wire_key: 'download', primitive: 'string'},
529
+ filepath: {wire_key: 'filepath', nullable: true, primitive: 'string'},
530
+ context: {wire_key: 'context', primitive: 'string'},
531
+ navigation: {wire_key: 'navigation', nullable: true, primitive: 'string'},
532
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
533
+ url: {wire_key: 'url', primitive: 'string'},
534
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
535
+ )
536
+
537
+ def self.canceled(**) = BrowsingContext::DownloadEndParams::CanceledParams.new(**)
538
+ def self.complete(**) = BrowsingContext::DownloadEndParams::CompleteParams.new(**)
539
+ end
540
+
541
+ # @api private
542
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
543
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextuserpromptclosedparameters
544
+ UserPromptClosedParameters = Serialization::Record.define(
545
+ context: {wire_key: 'context', primitive: 'string'},
546
+ accepted: {wire_key: 'accepted', primitive: 'boolean'},
547
+ type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
548
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
549
+ user_text: {wire_key: 'userText', required: false, primitive: 'string'}
550
+ )
551
+
552
+ # @api private
553
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
554
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextuserpromptopenedparameters
555
+ UserPromptOpenedParameters = Serialization::Record.define(
556
+ context: {wire_key: 'context', primitive: 'string'},
557
+ handler: {wire_key: 'handler', enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
558
+ message: {wire_key: 'message', primitive: 'string'},
559
+ type: {wire_key: 'type', enum: 'BrowsingContext::USER_PROMPT_TYPE'},
560
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
561
+ default_value: {wire_key: 'defaultValue', required: false, primitive: 'string'}
562
+ )
563
+
564
+ EVENT_TYPES = {
565
+ 'browsingContext.contextCreated' => BrowsingContext::Info,
566
+ 'browsingContext.contextDestroyed' => BrowsingContext::Info,
567
+ 'browsingContext.domContentLoaded' => BrowsingContext::NavigationInfo,
568
+ 'browsingContext.downloadEnd' => BrowsingContext::DownloadEndParams,
569
+ 'browsingContext.downloadWillBegin' => BrowsingContext::DownloadWillBeginParams,
570
+ 'browsingContext.fragmentNavigated' => BrowsingContext::NavigationInfo,
571
+ 'browsingContext.historyUpdated' => BrowsingContext::HistoryUpdatedParameters,
572
+ 'browsingContext.load' => BrowsingContext::NavigationInfo,
573
+ 'browsingContext.navigationAborted' => BrowsingContext::NavigationInfo,
574
+ 'browsingContext.navigationCommitted' => BrowsingContext::NavigationInfo,
575
+ 'browsingContext.navigationFailed' => BrowsingContext::NavigationInfo,
576
+ 'browsingContext.navigationStarted' => BrowsingContext::NavigationInfo,
577
+ 'browsingContext.userPromptClosed' => BrowsingContext::UserPromptClosedParameters,
578
+ 'browsingContext.userPromptOpened' => BrowsingContext::UserPromptOpenedParameters
579
+ }.freeze
580
+
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
601
+ def activate(context:)
602
+ params = ActivateParameters.new(context: context)
603
+ execute(cmd: 'browsingContext.activate', params: params)
604
+ end
605
+
606
+ # @api private
607
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
608
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot
609
+ def capture_screenshot(
610
+ context:,
611
+ origin: Serialization::UNSET,
612
+ format: Serialization::UNSET,
613
+ clip: Serialization::UNSET
614
+ )
615
+ Serialization.validate!('origin', origin, BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN)
616
+ params = CaptureScreenshotParameters.new(context: context, origin: origin, format: format, clip: clip)
617
+ execute(
618
+ cmd: 'browsingContext.captureScreenshot',
619
+ params: params,
620
+ result: BrowsingContext::CaptureScreenshotResult
621
+ )
622
+ end
623
+
624
+ # @api private
625
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
626
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-close
627
+ def close(context:, prompt_unload: Serialization::UNSET)
628
+ params = CloseParameters.new(context: context, prompt_unload: prompt_unload)
629
+ execute(cmd: 'browsingContext.close', params: params)
630
+ end
631
+
632
+ # @api private
633
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
634
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-create
635
+ def create(
636
+ type:,
637
+ reference_context: Serialization::UNSET,
638
+ background: Serialization::UNSET,
639
+ user_context: Serialization::UNSET
640
+ )
641
+ Serialization.validate!('type', type, BrowsingContext::CREATE_TYPE)
642
+ params = CreateParameters.new(
643
+ type: type,
644
+ reference_context: reference_context,
645
+ background: background,
646
+ user_context: user_context
647
+ )
648
+ execute(cmd: 'browsingContext.create', params: params, result: BrowsingContext::CreateResult)
649
+ end
650
+
651
+ # @api private
652
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
653
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
654
+ def get_tree(max_depth: Serialization::UNSET, root: Serialization::UNSET)
655
+ params = GetTreeParameters.new(max_depth: max_depth, root: root)
656
+ execute(cmd: 'browsingContext.getTree', params: params, result: BrowsingContext::GetTreeResult)
657
+ end
658
+
659
+ # @api private
660
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
661
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt
662
+ def handle_user_prompt(context:, accept: Serialization::UNSET, user_text: Serialization::UNSET)
663
+ params = HandleUserPromptParameters.new(context: context, accept: accept, user_text: user_text)
664
+ execute(cmd: 'browsingContext.handleUserPrompt', params: params)
665
+ end
666
+
667
+ # @api private
668
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
669
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-locateNodes
670
+ def locate_nodes(
671
+ context:,
672
+ locator:,
673
+ max_node_count: Serialization::UNSET,
674
+ serialization_options: Serialization::UNSET,
675
+ start_nodes: Serialization::UNSET
676
+ )
677
+ params = LocateNodesParameters.new(
678
+ context: context,
679
+ locator: locator,
680
+ max_node_count: max_node_count,
681
+ serialization_options: serialization_options,
682
+ start_nodes: start_nodes
683
+ )
684
+ execute(cmd: 'browsingContext.locateNodes', params: params, result: BrowsingContext::LocateNodesResult)
685
+ end
686
+
687
+ # @api private
688
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
689
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate
690
+ def navigate(context:, url:, wait: Serialization::UNSET)
691
+ Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
692
+ params = NavigateParameters.new(context: context, url: url, wait: wait)
693
+ execute(cmd: 'browsingContext.navigate', params: params, result: BrowsingContext::NavigateResult)
694
+ end
695
+
696
+ # @api private
697
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
698
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-print
699
+ def print(
700
+ context:,
701
+ background: Serialization::UNSET,
702
+ margin: Serialization::UNSET,
703
+ orientation: Serialization::UNSET,
704
+ page: Serialization::UNSET,
705
+ page_ranges: Serialization::UNSET,
706
+ scale: Serialization::UNSET,
707
+ shrink_to_fit: Serialization::UNSET
708
+ )
709
+ Serialization.validate!('orientation', orientation, BrowsingContext::PRINT_PARAMETERS_ORIENTATION)
710
+ params = PrintParameters.new(
711
+ context: context,
712
+ background: background,
713
+ margin: margin,
714
+ orientation: orientation,
715
+ page: page,
716
+ page_ranges: page_ranges,
717
+ scale: scale,
718
+ shrink_to_fit: shrink_to_fit
719
+ )
720
+ execute(cmd: 'browsingContext.print', params: params, result: BrowsingContext::PrintResult)
721
+ end
722
+
723
+ # @api private
724
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
725
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload
726
+ def reload(context:, ignore_cache: Serialization::UNSET, wait: Serialization::UNSET)
727
+ Serialization.validate!('wait', wait, BrowsingContext::READINESS_STATE)
728
+ params = ReloadParameters.new(context: context, ignore_cache: ignore_cache, wait: wait)
729
+ execute(cmd: 'browsingContext.reload', params: params, result: BrowsingContext::NavigateResult)
730
+ end
731
+
732
+ # @api private
733
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
734
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-setBypassCSP
735
+ def set_bypass_csp(bypass:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
736
+ params = SetBypassCSPParameters.new(bypass: bypass, contexts: contexts, user_contexts: user_contexts)
737
+ execute(cmd: 'browsingContext.setBypassCSP', params: params)
738
+ end
739
+
740
+ # @api private
741
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
742
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-setViewport
743
+ def set_viewport(
744
+ context: Serialization::UNSET,
745
+ viewport: Serialization::UNSET,
746
+ device_pixel_ratio: Serialization::UNSET,
747
+ user_contexts: Serialization::UNSET
748
+ )
749
+ params = SetViewportParameters.new(
750
+ context: context,
751
+ viewport: viewport,
752
+ device_pixel_ratio: device_pixel_ratio,
753
+ user_contexts: user_contexts
754
+ )
755
+ execute(cmd: 'browsingContext.setViewport', params: params)
756
+ end
757
+
758
+ # @api private
759
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
760
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-startScreencast
761
+ def start_screencast(
762
+ context:,
763
+ mime_type: Serialization::UNSET,
764
+ video: Serialization::UNSET,
765
+ audio: Serialization::UNSET
766
+ )
767
+ params = StartScreencastParameters.new(context: context, mime_type: mime_type, video: video, audio: audio)
768
+ execute(
769
+ cmd: 'browsingContext.startScreencast',
770
+ params: params,
771
+ result: BrowsingContext::StartScreencastResult
772
+ )
773
+ end
774
+
775
+ # @api private
776
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
777
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-stopScreencast
778
+ def stop_screencast(screencast:)
779
+ params = StopScreencastParameters.new(screencast: screencast)
780
+ execute(
781
+ cmd: 'browsingContext.stopScreencast',
782
+ params: params,
783
+ result: BrowsingContext::StopScreencastResult
784
+ )
785
+ end
786
+
787
+ # @api private
788
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
789
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-traverseHistory
790
+ def traverse_history(context:, delta:)
791
+ params = TraverseHistoryParameters.new(context: context, delta: delta)
792
+ execute(cmd: 'browsingContext.traverseHistory', params: params)
793
+ end
794
+ end # BrowsingContext
795
+ end # Protocol
796
+ end # BiDi
797
+ end # WebDriver
798
+ end # Selenium