selenium-webdriver 4.45.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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +36 -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 +495 -0
  10. data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
  11. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
  12. data/lib/selenium/webdriver/bidi/protocol/domain.rb +46 -0
  13. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
  14. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  15. data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
  16. data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
  17. data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
  18. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
  19. data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
  20. data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
  21. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
  22. data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
  23. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
  24. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
  25. data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
  26. data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
  27. data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
  28. data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
  29. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
  30. data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
  31. data/lib/selenium/webdriver/bidi/transport.rb +57 -0
  32. data/lib/selenium/webdriver/bidi.rb +3 -0
  33. data/lib/selenium/webdriver/chrome/driver.rb +3 -3
  34. data/lib/selenium/webdriver/chrome/service.rb +4 -1
  35. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  36. data/lib/selenium/webdriver/chromium/options.rb +20 -0
  37. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  38. data/lib/selenium/webdriver/common/driver.rb +13 -2
  39. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  40. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  41. data/lib/selenium/webdriver/common/driver_finder.rb +4 -3
  42. data/lib/selenium/webdriver/common/local_driver.rb +15 -4
  43. data/lib/selenium/webdriver/common/options.rb +21 -1
  44. data/lib/selenium/webdriver/common/proxy.rb +1 -9
  45. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  46. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  47. data/lib/selenium/webdriver/common.rb +1 -1
  48. data/lib/selenium/webdriver/edge/driver.rb +3 -3
  49. data/lib/selenium/webdriver/edge/service.rb +4 -1
  50. data/lib/selenium/webdriver/firefox/driver.rb +3 -6
  51. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  52. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  53. data/lib/selenium/webdriver/ie/driver.rb +3 -3
  54. data/lib/selenium/webdriver/remote/bidi_bridge.rb +41 -9
  55. data/lib/selenium/webdriver/remote/bridge.rb +8 -10
  56. data/lib/selenium/webdriver/remote/driver.rb +14 -4
  57. data/lib/selenium/webdriver/remote/http/common.rb +25 -12
  58. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  59. data/lib/selenium/webdriver/safari/driver.rb +3 -3
  60. data/lib/selenium/webdriver/safari/options.rb +16 -1
  61. data/lib/selenium/webdriver/support/guards/guard.rb +20 -3
  62. data/lib/selenium/webdriver/support/guards.rb +9 -3
  63. data/lib/selenium/webdriver/version.rb +1 -1
  64. metadata +29 -3
@@ -0,0 +1,46 @@
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
+ module Selenium
21
+ module WebDriver
22
+ class BiDi
23
+ module Protocol
24
+ # @api private
25
+ class Domain
26
+ def initialize(source)
27
+ connection = source.is_a?(Driver) ? source.send(:bridge).connection : source
28
+ raise(Error::WebDriverError, 'a Driver or connection is required') unless connection.respond_to?(:send_cmd)
29
+
30
+ @transport = Transport.new(connection)
31
+ end
32
+
33
+ private
34
+
35
+ # The connection this domain runs over, so a generated vendor accessor can build its
36
+ # sibling variant (`Moz.new(connection)`) — construction stays connection-based.
37
+ def connection = @transport.connection
38
+
39
+ def execute(cmd:, params: nil, result: nil)
40
+ @transport.execute(cmd: cmd, params: params, result: result)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,448 @@
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-emulation
30
+ class Emulation < Domain
31
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationforcedcolorsmodetheme
32
+ FORCED_COLORS_MODE_THEME = {
33
+ light: 'light',
34
+ dark: 'dark'
35
+ }.freeze
36
+
37
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationscreenorientationnatural
38
+ SCREEN_ORIENTATION_NATURAL = {
39
+ portrait: 'portrait',
40
+ landscape: 'landscape'
41
+ }.freeze
42
+
43
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationscreenorientationtype
44
+ SCREEN_ORIENTATION_TYPE = {
45
+ portrait_primary: 'portrait-primary',
46
+ portrait_secondary: 'portrait-secondary',
47
+ landscape_primary: 'landscape-primary',
48
+ landscape_secondary: 'landscape-secondary'
49
+ }.freeze
50
+
51
+ SET_SCROLLBAR_TYPE_OVERRIDE_PARAMETERS_SCROLLBAR_TYPE = {
52
+ classic: 'classic',
53
+ overlay: 'overlay'
54
+ }.freeze
55
+
56
+ # @api private
57
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
58
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetforcedcolorsmodethemeoverrideparameters
59
+ SetForcedColorsModeThemeOverrideParameters = Serialization::Record.define(
60
+ theme: {wire_key: 'theme', nullable: true, enum: 'Emulation::FORCED_COLORS_MODE_THEME'},
61
+ contexts: {wire_key: 'contexts', required: false, list: true},
62
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
63
+ )
64
+
65
+ # @api private
66
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
67
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetgeolocationoverrideparameters
68
+ class SetGeolocationOverrideParameters < Serialization::Union
69
+ presence(
70
+ 'Emulation::SetGeolocationOverrideParameters::Coordinates' => ['coordinates'],
71
+ 'Emulation::SetGeolocationOverrideParameters::Error' => ['error']
72
+ )
73
+ object_only
74
+
75
+ # @api private
76
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
77
+ Coordinates = Serialization::Record.define(
78
+ contexts: {wire_key: 'contexts', required: false, list: true},
79
+ user_contexts: {wire_key: 'userContexts', required: false, list: true},
80
+ coordinates: {wire_key: 'coordinates', nullable: true, ref: 'Emulation::GeolocationCoordinates'}
81
+ )
82
+
83
+ # @api private
84
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
85
+ Error = Serialization::Record.define(
86
+ contexts: {wire_key: 'contexts', required: false, list: true},
87
+ user_contexts: {wire_key: 'userContexts', required: false, list: true},
88
+ error: {wire_key: 'error', ref: 'Emulation::GeolocationPositionError'}
89
+ )
90
+ end
91
+
92
+ # @api private
93
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
94
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationgeolocationcoordinates
95
+ GeolocationCoordinates = Serialization::Record.define(
96
+ latitude: {wire_key: 'latitude', primitive: 'number'},
97
+ longitude: {wire_key: 'longitude', primitive: 'number'},
98
+ accuracy: {wire_key: 'accuracy', required: false, primitive: 'number'},
99
+ altitude: {wire_key: 'altitude', required: false, nullable: true, primitive: 'number'},
100
+ altitude_accuracy: {wire_key: 'altitudeAccuracy', required: false, nullable: true, primitive: 'number'},
101
+ heading: {wire_key: 'heading', required: false, nullable: true, primitive: 'number'},
102
+ speed: {wire_key: 'speed', required: false, nullable: true, primitive: 'number'}
103
+ )
104
+
105
+ # @api private
106
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
107
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationgeolocationpositionerror
108
+ GeolocationPositionError = Serialization::Record.define(type: {fixed: 'positionUnavailable'})
109
+
110
+ # @api private
111
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
112
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetlocaleoverrideparameters
113
+ SetLocaleOverrideParameters = Serialization::Record.define(
114
+ locale: {wire_key: 'locale', nullable: true, primitive: 'string'},
115
+ contexts: {wire_key: 'contexts', required: false, list: true},
116
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
117
+ )
118
+
119
+ # @api private
120
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
121
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetmediafeaturesoverrideparameters
122
+ SetMediaFeaturesOverrideParameters = Serialization::Record.define(
123
+ features: {wire_key: 'features', nullable: true, ref: 'Emulation::MediaFeature', list: true},
124
+ contexts: {wire_key: 'contexts', required: false, list: true},
125
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
126
+ )
127
+
128
+ # @api private
129
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
130
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationmediafeature
131
+ MediaFeature = Serialization::Record.define(
132
+ name: {wire_key: 'name', primitive: 'string'},
133
+ value: {wire_key: 'value', primitive: 'string'}
134
+ )
135
+
136
+ # @api private
137
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
138
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetnetworkconditionsparameters
139
+ SetNetworkConditionsParameters = Serialization::Record.define(
140
+ network_conditions: {
141
+ wire_key: 'networkConditions',
142
+ nullable: true,
143
+ ref: 'Emulation::NetworkConditionsOffline'
144
+ },
145
+ contexts: {wire_key: 'contexts', required: false, list: true},
146
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
147
+ )
148
+
149
+ # @api private
150
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
151
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationnetworkconditionsoffline
152
+ NetworkConditionsOffline = Serialization::Record.define(type: {fixed: 'offline'})
153
+
154
+ # @api private
155
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
156
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationscreenarea
157
+ ScreenArea = Serialization::Record.define(
158
+ width: {wire_key: 'width', primitive: 'integer'},
159
+ height: {wire_key: 'height', primitive: 'integer'}
160
+ )
161
+
162
+ # @api private
163
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
164
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetscreensettingsoverrideparameters
165
+ SetScreenSettingsOverrideParameters = Serialization::Record.define(
166
+ screen_area: {wire_key: 'screenArea', nullable: true, ref: 'Emulation::ScreenArea'},
167
+ contexts: {wire_key: 'contexts', required: false, list: true},
168
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
169
+ )
170
+
171
+ # @api private
172
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
173
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationscreenorientation
174
+ ScreenOrientation = Serialization::Record.define(
175
+ natural: {wire_key: 'natural', enum: 'Emulation::SCREEN_ORIENTATION_NATURAL'},
176
+ type: {wire_key: 'type', enum: 'Emulation::SCREEN_ORIENTATION_TYPE'}
177
+ )
178
+
179
+ # @api private
180
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
181
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetscreenorientationoverrideparameters
182
+ SetScreenOrientationOverrideParameters = Serialization::Record.define(
183
+ screen_orientation: {wire_key: 'screenOrientation', nullable: true, ref: 'Emulation::ScreenOrientation'},
184
+ contexts: {wire_key: 'contexts', required: false, list: true},
185
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
186
+ )
187
+
188
+ # @api private
189
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
190
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetuseragentoverrideparameters
191
+ SetUserAgentOverrideParameters = Serialization::Record.define(
192
+ user_agent: {wire_key: 'userAgent', nullable: true, primitive: 'string'},
193
+ contexts: {wire_key: 'contexts', required: false, list: true},
194
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
195
+ )
196
+
197
+ # @api private
198
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
199
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetviewportmetaoverrideparameters
200
+ SetViewportMetaOverrideParameters = Serialization::Record.define(
201
+ viewport_meta: {wire_key: 'viewportMeta', nullable: true, const: true},
202
+ contexts: {wire_key: 'contexts', required: false, list: true},
203
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
204
+ )
205
+
206
+ # @api private
207
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
208
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetscriptingenabledparameters
209
+ SetScriptingEnabledParameters = Serialization::Record.define(
210
+ enabled: {wire_key: 'enabled', nullable: true, const: false},
211
+ contexts: {wire_key: 'contexts', required: false, list: true},
212
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
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-emulationsetscrollbartypeoverrideparameters
218
+ SetScrollbarTypeOverrideParameters = Serialization::Record.define(
219
+ scrollbar_type: {
220
+ wire_key: 'scrollbarType',
221
+ nullable: true,
222
+ enum: 'Emulation::SET_SCROLLBAR_TYPE_OVERRIDE_PARAMETERS_SCROLLBAR_TYPE'
223
+ },
224
+ contexts: {wire_key: 'contexts', required: false, list: true},
225
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
226
+ )
227
+
228
+ # @api private
229
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
230
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsettimezoneoverrideparameters
231
+ SetTimezoneOverrideParameters = Serialization::Record.define(
232
+ timezone: {wire_key: 'timezone', nullable: true, primitive: 'string'},
233
+ contexts: {wire_key: 'contexts', required: false, list: true},
234
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
235
+ )
236
+
237
+ # @api private
238
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
239
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsettouchoverrideparameters
240
+ SetTouchOverrideParameters = Serialization::Record.define(
241
+ max_touch_points: {wire_key: 'maxTouchPoints', nullable: true, primitive: 'integer'},
242
+ contexts: {wire_key: 'contexts', required: false, list: true},
243
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
244
+ )
245
+
246
+ def geolocation_coordinates(**) = GeolocationCoordinates.new(**)
247
+ def geolocation_position_error(**) = GeolocationPositionError.new(**)
248
+ def media_feature(**) = MediaFeature.new(**)
249
+ def network_conditions_offline(**) = NetworkConditionsOffline.new(**)
250
+ def screen_area(**) = ScreenArea.new(**)
251
+ def screen_orientation(**) = ScreenOrientation.new(**)
252
+
253
+ # @api private
254
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
255
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setForcedColorsModeThemeOverride
256
+ def set_forced_colors_mode_theme_override(
257
+ theme:,
258
+ contexts: Serialization::UNSET,
259
+ user_contexts: Serialization::UNSET
260
+ )
261
+ Serialization.validate!('theme', theme, Emulation::FORCED_COLORS_MODE_THEME)
262
+ params = SetForcedColorsModeThemeOverrideParameters.new(
263
+ theme: theme,
264
+ contexts: contexts,
265
+ user_contexts: user_contexts
266
+ )
267
+ execute(cmd: 'emulation.setForcedColorsModeThemeOverride', params: params)
268
+ end
269
+
270
+ # @api private
271
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
272
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setGeolocationOverride
273
+ def set_geolocation_override(
274
+ contexts: Serialization::UNSET,
275
+ user_contexts: Serialization::UNSET,
276
+ coordinates: Serialization::UNSET,
277
+ error: Serialization::UNSET
278
+ )
279
+ params = SetGeolocationOverrideParameters.build(
280
+ contexts: contexts,
281
+ user_contexts: user_contexts,
282
+ coordinates: coordinates,
283
+ error: error
284
+ )
285
+ execute(cmd: 'emulation.setGeolocationOverride', params: params)
286
+ end
287
+
288
+ # @api private
289
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
290
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setLocaleOverride
291
+ def set_locale_override(locale:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
292
+ params = SetLocaleOverrideParameters.new(locale: locale, contexts: contexts, user_contexts: user_contexts)
293
+ execute(cmd: 'emulation.setLocaleOverride', params: params)
294
+ end
295
+
296
+ # @api private
297
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
298
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setMediaFeaturesOverride
299
+ def set_media_features_override(
300
+ features:,
301
+ contexts: Serialization::UNSET,
302
+ user_contexts: Serialization::UNSET
303
+ )
304
+ params = SetMediaFeaturesOverrideParameters.new(
305
+ features: features,
306
+ contexts: contexts,
307
+ user_contexts: user_contexts
308
+ )
309
+ execute(cmd: 'emulation.setMediaFeaturesOverride', params: params)
310
+ end
311
+
312
+ # @api private
313
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
314
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setNetworkConditions
315
+ def set_network_conditions(
316
+ network_conditions:,
317
+ contexts: Serialization::UNSET,
318
+ user_contexts: Serialization::UNSET
319
+ )
320
+ params = SetNetworkConditionsParameters.new(
321
+ network_conditions: network_conditions,
322
+ contexts: contexts,
323
+ user_contexts: user_contexts
324
+ )
325
+ execute(cmd: 'emulation.setNetworkConditions', params: params)
326
+ end
327
+
328
+ # @api private
329
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
330
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setScreenOrientationOverride
331
+ def set_screen_orientation_override(
332
+ screen_orientation:,
333
+ contexts: Serialization::UNSET,
334
+ user_contexts: Serialization::UNSET
335
+ )
336
+ params = SetScreenOrientationOverrideParameters.new(
337
+ screen_orientation: screen_orientation,
338
+ contexts: contexts,
339
+ user_contexts: user_contexts
340
+ )
341
+ execute(cmd: 'emulation.setScreenOrientationOverride', params: params)
342
+ end
343
+
344
+ # @api private
345
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
346
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setScreenSettingsOverride
347
+ def set_screen_settings_override(
348
+ screen_area:,
349
+ contexts: Serialization::UNSET,
350
+ user_contexts: Serialization::UNSET
351
+ )
352
+ params = SetScreenSettingsOverrideParameters.new(
353
+ screen_area: screen_area,
354
+ contexts: contexts,
355
+ user_contexts: user_contexts
356
+ )
357
+ execute(cmd: 'emulation.setScreenSettingsOverride', params: params)
358
+ end
359
+
360
+ # @api private
361
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
362
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setScriptingEnabled
363
+ def set_scripting_enabled(enabled:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
364
+ params = SetScriptingEnabledParameters.new(
365
+ enabled: enabled,
366
+ contexts: contexts,
367
+ user_contexts: user_contexts
368
+ )
369
+ execute(cmd: 'emulation.setScriptingEnabled', params: params)
370
+ end
371
+
372
+ # @api private
373
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
374
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setScrollbarTypeOverride
375
+ def set_scrollbar_type_override(
376
+ scrollbar_type:,
377
+ contexts: Serialization::UNSET,
378
+ user_contexts: Serialization::UNSET
379
+ )
380
+ Serialization.validate!(
381
+ 'scrollbarType',
382
+ scrollbar_type,
383
+ Emulation::SET_SCROLLBAR_TYPE_OVERRIDE_PARAMETERS_SCROLLBAR_TYPE
384
+ )
385
+ params = SetScrollbarTypeOverrideParameters.new(
386
+ scrollbar_type: scrollbar_type,
387
+ contexts: contexts,
388
+ user_contexts: user_contexts
389
+ )
390
+ execute(cmd: 'emulation.setScrollbarTypeOverride', params: params)
391
+ end
392
+
393
+ # @api private
394
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
395
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setTimezoneOverride
396
+ def set_timezone_override(timezone:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
397
+ params = SetTimezoneOverrideParameters.new(
398
+ timezone: timezone,
399
+ contexts: contexts,
400
+ user_contexts: user_contexts
401
+ )
402
+ execute(cmd: 'emulation.setTimezoneOverride', params: params)
403
+ end
404
+
405
+ # @api private
406
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
407
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setTouchOverride
408
+ def set_touch_override(max_touch_points:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
409
+ params = SetTouchOverrideParameters.new(
410
+ max_touch_points: max_touch_points,
411
+ contexts: contexts,
412
+ user_contexts: user_contexts
413
+ )
414
+ execute(cmd: 'emulation.setTouchOverride', params: params)
415
+ end
416
+
417
+ # @api private
418
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
419
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setUserAgentOverride
420
+ def set_user_agent_override(user_agent:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
421
+ params = SetUserAgentOverrideParameters.new(
422
+ user_agent: user_agent,
423
+ contexts: contexts,
424
+ user_contexts: user_contexts
425
+ )
426
+ execute(cmd: 'emulation.setUserAgentOverride', params: params)
427
+ end
428
+
429
+ # @api private
430
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
431
+ # @see https://w3c.github.io/webdriver-bidi/#command-emulation-setViewportMetaOverride
432
+ def set_viewport_meta_override(
433
+ viewport_meta:,
434
+ contexts: Serialization::UNSET,
435
+ user_contexts: Serialization::UNSET
436
+ )
437
+ params = SetViewportMetaOverrideParameters.new(
438
+ viewport_meta: viewport_meta,
439
+ contexts: contexts,
440
+ user_contexts: user_contexts
441
+ )
442
+ execute(cmd: 'emulation.setViewportMetaOverride', params: params)
443
+ end
444
+ end # Emulation
445
+ end # Protocol
446
+ end # BiDi
447
+ end # WebDriver
448
+ end # Selenium
@@ -0,0 +1,66 @@
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
+ # The BiDi ErrorCode enum: each wire value mapped to its Ruby exception class name.
28
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ module ErrorCode
30
+ CLASS_NAMES = {
31
+ 'invalid argument' => 'InvalidArgumentError',
32
+ 'invalid selector' => 'InvalidSelectorError',
33
+ 'invalid session id' => 'InvalidSessionIdError',
34
+ 'invalid web extension' => 'InvalidWebExtensionError',
35
+ 'move target out of bounds' => 'MoveTargetOutOfBoundsError',
36
+ 'no such alert' => 'NoSuchAlertError',
37
+ 'no such network collector' => 'NoSuchNetworkCollectorError',
38
+ 'no such element' => 'NoSuchElementError',
39
+ 'no such frame' => 'NoSuchFrameError',
40
+ 'no such handle' => 'NoSuchHandleError',
41
+ 'no such history entry' => 'NoSuchHistoryEntryError',
42
+ 'no such intercept' => 'NoSuchInterceptError',
43
+ 'no such network data' => 'NoSuchNetworkDataError',
44
+ 'no such node' => 'NoSuchNodeError',
45
+ 'no such request' => 'NoSuchRequestError',
46
+ 'no such screencast' => 'NoSuchScreencastError',
47
+ 'no such script' => 'NoSuchScriptError',
48
+ 'no such storage partition' => 'NoSuchStoragePartitionError',
49
+ 'no such user context' => 'NoSuchUserContextError',
50
+ 'no such web extension' => 'NoSuchWebExtensionError',
51
+ 'session not created' => 'SessionNotCreatedError',
52
+ 'unable to capture screen' => 'UnableToCaptureScreenError',
53
+ 'unable to close browser' => 'UnableToCloseBrowserError',
54
+ 'unable to set cookie' => 'UnableToSetCookieError',
55
+ 'unable to set file input' => 'UnableToSetFileInputError',
56
+ 'unavailable network data' => 'UnavailableNetworkDataError',
57
+ 'underspecified storage partition' => 'UnderspecifiedStoragePartitionError',
58
+ 'unknown command' => 'UnknownCommandError',
59
+ 'unknown error' => 'UnknownError',
60
+ 'unsupported operation' => 'UnsupportedOperationError'
61
+ }.freeze
62
+ end # ErrorCode
63
+ end # Protocol
64
+ end # BiDi
65
+ end # WebDriver
66
+ end # Selenium