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,40 @@
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
+ @transport = source.is_a?(Driver) ? source.send(:bridge).transport : source
28
+ raise(Error::WebDriverError, 'a Driver or Transport is required') unless @transport.is_a?(Transport)
29
+ end
30
+
31
+ private
32
+
33
+ def execute(cmd:, params: nil, result: nil)
34
+ @transport.execute(cmd: cmd, params: params, result: result)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,334 @@
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 Emulation < Domain
30
+ FORCED_COLORS_MODE_THEME = {
31
+ light: 'light',
32
+ dark: 'dark'
33
+ }.freeze
34
+
35
+ SCREEN_ORIENTATION_NATURAL = {
36
+ portrait: 'portrait',
37
+ landscape: 'landscape'
38
+ }.freeze
39
+
40
+ SCREEN_ORIENTATION_TYPE = {
41
+ portrait_primary: 'portrait-primary',
42
+ portrait_secondary: 'portrait-secondary',
43
+ landscape_primary: 'landscape-primary',
44
+ landscape_secondary: 'landscape-secondary'
45
+ }.freeze
46
+
47
+ # @api private
48
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
49
+ SetForcedColorsModeThemeOverrideParameters = Serialization::Record.define(
50
+ theme: {wire_key: 'theme', nullable: true, enum: 'Emulation::FORCED_COLORS_MODE_THEME'},
51
+ contexts: {wire_key: 'contexts', required: false, list: true},
52
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
53
+ )
54
+
55
+ # @api private
56
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
57
+ class SetGeolocationOverrideParameters < Serialization::Union
58
+ presence(
59
+ 'Emulation::SetGeolocationOverrideParameters::Coordinates' => ['coordinates'],
60
+ 'Emulation::SetGeolocationOverrideParameters::Error' => ['error']
61
+ )
62
+
63
+ # @api private
64
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
65
+ Coordinates = Serialization::Record.define(
66
+ contexts: {wire_key: 'contexts', required: false, list: true},
67
+ user_contexts: {wire_key: 'userContexts', required: false, list: true},
68
+ coordinates: {wire_key: 'coordinates', nullable: true, ref: 'Emulation::GeolocationCoordinates'}
69
+ )
70
+
71
+ # @api private
72
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
73
+ Error = Serialization::Record.define(
74
+ contexts: {wire_key: 'contexts', required: false, list: true},
75
+ user_contexts: {wire_key: 'userContexts', required: false, list: true},
76
+ error: {wire_key: 'error', ref: 'Emulation::GeolocationPositionError'}
77
+ )
78
+ end
79
+
80
+ # @api private
81
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
82
+ GeolocationCoordinates = Serialization::Record.define(
83
+ latitude: {wire_key: 'latitude', primitive: 'integer'},
84
+ longitude: {wire_key: 'longitude', primitive: 'integer'},
85
+ accuracy: {wire_key: 'accuracy', required: false, primitive: 'number'},
86
+ altitude: {wire_key: 'altitude', required: false, nullable: true, primitive: 'number'},
87
+ altitude_accuracy: {wire_key: 'altitudeAccuracy', required: false, nullable: true, primitive: 'number'},
88
+ heading: {wire_key: 'heading', required: false, nullable: true, primitive: 'integer'},
89
+ speed: {wire_key: 'speed', required: false, nullable: true, primitive: 'number'}
90
+ )
91
+
92
+ # @api private
93
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
94
+ GeolocationPositionError = Serialization::Record.define(type: {fixed: 'positionUnavailable'})
95
+
96
+ # @api private
97
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
98
+ SetLocaleOverrideParameters = Serialization::Record.define(
99
+ locale: {wire_key: 'locale', nullable: true, primitive: 'string'},
100
+ contexts: {wire_key: 'contexts', required: false, list: true},
101
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
102
+ )
103
+
104
+ # @api private
105
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
106
+ SetNetworkConditionsParameters = Serialization::Record.define(
107
+ network_conditions: {
108
+ wire_key: 'networkConditions',
109
+ nullable: true,
110
+ ref: 'Emulation::NetworkConditionsOffline'
111
+ },
112
+ contexts: {wire_key: 'contexts', required: false, list: true},
113
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
114
+ )
115
+
116
+ # @api private
117
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
118
+ NetworkConditionsOffline = Serialization::Record.define(type: {fixed: 'offline'})
119
+
120
+ # @api private
121
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
122
+ ScreenArea = Serialization::Record.define(width: 'width', height: 'height')
123
+
124
+ # @api private
125
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
126
+ SetScreenSettingsOverrideParameters = Serialization::Record.define(
127
+ screen_area: {wire_key: 'screenArea', nullable: true, ref: 'Emulation::ScreenArea'},
128
+ contexts: {wire_key: 'contexts', required: false, list: true},
129
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
130
+ )
131
+
132
+ # @api private
133
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
134
+ ScreenOrientation = Serialization::Record.define(
135
+ natural: {wire_key: 'natural', enum: 'Emulation::SCREEN_ORIENTATION_NATURAL'},
136
+ type: {wire_key: 'type', enum: 'Emulation::SCREEN_ORIENTATION_TYPE'}
137
+ )
138
+
139
+ # @api private
140
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
141
+ SetScreenOrientationOverrideParameters = Serialization::Record.define(
142
+ screen_orientation: {wire_key: 'screenOrientation', nullable: true, ref: 'Emulation::ScreenOrientation'},
143
+ contexts: {wire_key: 'contexts', required: false, list: true},
144
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
145
+ )
146
+
147
+ # @api private
148
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
149
+ SetUserAgentOverrideParameters = Serialization::Record.define(
150
+ user_agent: {wire_key: 'userAgent', nullable: true, primitive: 'string'},
151
+ contexts: {wire_key: 'contexts', required: false, list: true},
152
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
153
+ )
154
+
155
+ # @api private
156
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
157
+ SetScriptingEnabledParameters = Serialization::Record.define(
158
+ enabled: {wire_key: 'enabled', nullable: true},
159
+ contexts: {wire_key: 'contexts', required: false, list: true},
160
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
161
+ )
162
+
163
+ # @api private
164
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
165
+ SetScrollbarTypeOverrideParameters = Serialization::Record.define(
166
+ scrollbar_type: {wire_key: 'scrollbarType', nullable: true},
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
+ SetTimezoneOverrideParameters = Serialization::Record.define(
174
+ timezone: {wire_key: 'timezone', nullable: true, primitive: 'string'},
175
+ contexts: {wire_key: 'contexts', required: false, list: true},
176
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
177
+ )
178
+
179
+ # @api private
180
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
181
+ SetTouchOverrideParameters = Serialization::Record.define(
182
+ max_touch_points: {wire_key: 'maxTouchPoints', nullable: true},
183
+ contexts: {wire_key: 'contexts', required: false, list: true},
184
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
185
+ )
186
+
187
+ # @api private
188
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
189
+ def set_forced_colors_mode_theme_override(
190
+ theme:,
191
+ contexts: Serialization::UNSET,
192
+ user_contexts: Serialization::UNSET
193
+ )
194
+ Serialization.validate!('theme', theme, Emulation::FORCED_COLORS_MODE_THEME)
195
+ params = SetForcedColorsModeThemeOverrideParameters.new(
196
+ theme: theme,
197
+ contexts: contexts,
198
+ user_contexts: user_contexts
199
+ )
200
+ execute(cmd: 'emulation.setForcedColorsModeThemeOverride', params: params)
201
+ end
202
+
203
+ # @api private
204
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
205
+ def set_geolocation_override(
206
+ contexts: Serialization::UNSET,
207
+ user_contexts: Serialization::UNSET,
208
+ coordinates: Serialization::UNSET,
209
+ error: Serialization::UNSET
210
+ )
211
+ params = SetGeolocationOverrideParameters.build(
212
+ contexts: contexts,
213
+ user_contexts: user_contexts,
214
+ coordinates: coordinates,
215
+ error: error
216
+ )
217
+ execute(cmd: 'emulation.setGeolocationOverride', params: params)
218
+ end
219
+
220
+ # @api private
221
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
222
+ def set_locale_override(locale:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
223
+ params = SetLocaleOverrideParameters.new(locale: locale, contexts: contexts, user_contexts: user_contexts)
224
+ execute(cmd: 'emulation.setLocaleOverride', params: params)
225
+ end
226
+
227
+ # @api private
228
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
229
+ def set_network_conditions(
230
+ network_conditions:,
231
+ contexts: Serialization::UNSET,
232
+ user_contexts: Serialization::UNSET
233
+ )
234
+ params = SetNetworkConditionsParameters.new(
235
+ network_conditions: network_conditions,
236
+ contexts: contexts,
237
+ user_contexts: user_contexts
238
+ )
239
+ execute(cmd: 'emulation.setNetworkConditions', params: params)
240
+ end
241
+
242
+ # @api private
243
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
244
+ def set_screen_orientation_override(
245
+ screen_orientation:,
246
+ contexts: Serialization::UNSET,
247
+ user_contexts: Serialization::UNSET
248
+ )
249
+ params = SetScreenOrientationOverrideParameters.new(
250
+ screen_orientation: screen_orientation,
251
+ contexts: contexts,
252
+ user_contexts: user_contexts
253
+ )
254
+ execute(cmd: 'emulation.setScreenOrientationOverride', params: params)
255
+ end
256
+
257
+ # @api private
258
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
259
+ def set_screen_settings_override(
260
+ screen_area:,
261
+ contexts: Serialization::UNSET,
262
+ user_contexts: Serialization::UNSET
263
+ )
264
+ params = SetScreenSettingsOverrideParameters.new(
265
+ screen_area: screen_area,
266
+ contexts: contexts,
267
+ user_contexts: user_contexts
268
+ )
269
+ execute(cmd: 'emulation.setScreenSettingsOverride', params: params)
270
+ end
271
+
272
+ # @api private
273
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
274
+ def set_scripting_enabled(enabled:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
275
+ params = SetScriptingEnabledParameters.new(
276
+ enabled: enabled,
277
+ contexts: contexts,
278
+ user_contexts: user_contexts
279
+ )
280
+ execute(cmd: 'emulation.setScriptingEnabled', params: params)
281
+ end
282
+
283
+ # @api private
284
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
285
+ def set_scrollbar_type_override(
286
+ scrollbar_type:,
287
+ contexts: Serialization::UNSET,
288
+ user_contexts: Serialization::UNSET
289
+ )
290
+ params = SetScrollbarTypeOverrideParameters.new(
291
+ scrollbar_type: scrollbar_type,
292
+ contexts: contexts,
293
+ user_contexts: user_contexts
294
+ )
295
+ execute(cmd: 'emulation.setScrollbarTypeOverride', params: params)
296
+ end
297
+
298
+ # @api private
299
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
300
+ def set_timezone_override(timezone:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
301
+ params = SetTimezoneOverrideParameters.new(
302
+ timezone: timezone,
303
+ contexts: contexts,
304
+ user_contexts: user_contexts
305
+ )
306
+ execute(cmd: 'emulation.setTimezoneOverride', params: params)
307
+ end
308
+
309
+ # @api private
310
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
311
+ def set_touch_override(max_touch_points:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
312
+ params = SetTouchOverrideParameters.new(
313
+ max_touch_points: max_touch_points,
314
+ contexts: contexts,
315
+ user_contexts: user_contexts
316
+ )
317
+ execute(cmd: 'emulation.setTouchOverride', params: params)
318
+ end
319
+
320
+ # @api private
321
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
322
+ def set_user_agent_override(user_agent:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
323
+ params = SetUserAgentOverrideParameters.new(
324
+ user_agent: user_agent,
325
+ contexts: contexts,
326
+ user_contexts: user_contexts
327
+ )
328
+ execute(cmd: 'emulation.setUserAgentOverride', params: params)
329
+ end
330
+ end # Emulation
331
+ end # Protocol
332
+ end # BiDi
333
+ end # WebDriver
334
+ end # Selenium
@@ -0,0 +1,281 @@
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 Input < Domain
30
+ EVENTS = {
31
+ file_dialog_opened: 'input.fileDialogOpened'
32
+ }.freeze
33
+
34
+ POINTER_TYPE = {
35
+ mouse: 'mouse',
36
+ pen: 'pen',
37
+ touch: 'touch'
38
+ }.freeze
39
+
40
+ # @api private
41
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
42
+ ElementOrigin = Serialization::Record.define(
43
+ type: {fixed: 'element'},
44
+ element: {wire_key: 'element', ref: 'Script::SharedReference'}
45
+ )
46
+
47
+ # @api private
48
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
49
+ PerformActionsParameters = Serialization::Record.define(
50
+ context: 'context',
51
+ actions: {wire_key: 'actions', ref: 'Input::SourceActions', list: true}
52
+ )
53
+
54
+ # @api private
55
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
56
+ class SourceActions < Serialization::Union
57
+ discriminator 'type', {none: 'none', key: 'key', pointer: 'pointer', wheel: 'wheel'}
58
+ variants(
59
+ none: 'Input::NoneSourceActions',
60
+ key: 'Input::KeySourceActions',
61
+ pointer: 'Input::PointerSourceActions',
62
+ wheel: 'Input::WheelSourceActions'
63
+ )
64
+ end
65
+
66
+ # @api private
67
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
68
+ NoneSourceActions = Serialization::Record.define(
69
+ type: {fixed: 'none'},
70
+ id: {wire_key: 'id', primitive: 'string'},
71
+ actions: {wire_key: 'actions', ref: 'Input::PauseAction', list: true}
72
+ )
73
+
74
+ # @api private
75
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
76
+ KeySourceActions = Serialization::Record.define(
77
+ type: {fixed: 'key'},
78
+ id: {wire_key: 'id', primitive: 'string'},
79
+ actions: {wire_key: 'actions', ref: 'Input::KeySourceAction', list: true}
80
+ )
81
+
82
+ # @api private
83
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
84
+ class KeySourceAction < Serialization::Union
85
+ discriminator 'type', {pause: 'pause', key_down: 'keyDown', key_up: 'keyUp'}
86
+ variants(
87
+ pause: 'Input::PauseAction',
88
+ key_down: 'Input::KeyDownAction',
89
+ key_up: 'Input::KeyUpAction'
90
+ )
91
+ end
92
+
93
+ # @api private
94
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
95
+ PointerSourceActions = Serialization::Record.define(
96
+ type: {fixed: 'pointer'},
97
+ id: {wire_key: 'id', primitive: 'string'},
98
+ parameters: {wire_key: 'parameters', required: false, ref: 'Input::PointerParameters'},
99
+ actions: {wire_key: 'actions', ref: 'Input::PointerSourceAction', list: true}
100
+ )
101
+
102
+ # @api private
103
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
104
+ PointerParameters = Serialization::Record.define(
105
+ pointer_type: {wire_key: 'pointerType', required: false, enum: 'Input::POINTER_TYPE'}
106
+ )
107
+
108
+ # @api private
109
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
110
+ class PointerSourceAction < Serialization::Union
111
+ discriminator 'type', {
112
+ pause: 'pause',
113
+ pointer_down: 'pointerDown',
114
+ pointer_up: 'pointerUp',
115
+ pointer_move: 'pointerMove'
116
+ }
117
+ variants(
118
+ pause: 'Input::PauseAction',
119
+ pointer_down: 'Input::PointerDownAction',
120
+ pointer_up: 'Input::PointerUpAction',
121
+ pointer_move: 'Input::PointerMoveAction'
122
+ )
123
+ end
124
+
125
+ # @api private
126
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
127
+ WheelSourceActions = Serialization::Record.define(
128
+ type: {fixed: 'wheel'},
129
+ id: {wire_key: 'id', primitive: 'string'},
130
+ actions: {wire_key: 'actions', ref: 'Input::WheelSourceAction', list: true}
131
+ )
132
+
133
+ # @api private
134
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
135
+ class WheelSourceAction < Serialization::Union
136
+ discriminator 'type', {pause: 'pause', scroll: 'scroll'}
137
+ variants(
138
+ pause: 'Input::PauseAction',
139
+ scroll: 'Input::WheelScrollAction'
140
+ )
141
+ end
142
+
143
+ # @api private
144
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
145
+ PauseAction = Serialization::Record.define(
146
+ type: {fixed: 'pause'},
147
+ duration: {wire_key: 'duration', required: false}
148
+ )
149
+
150
+ # @api private
151
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
152
+ KeyDownAction = Serialization::Record.define(
153
+ type: {fixed: 'keyDown'},
154
+ value: {wire_key: 'value', primitive: 'string'}
155
+ )
156
+
157
+ # @api private
158
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
159
+ KeyUpAction = Serialization::Record.define(
160
+ type: {fixed: 'keyUp'},
161
+ value: {wire_key: 'value', primitive: 'string'}
162
+ )
163
+
164
+ # @api private
165
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
166
+ PointerUpAction = Serialization::Record.define(type: {fixed: 'pointerUp'}, button: 'button')
167
+
168
+ # @api private
169
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
170
+ PointerDownAction = Serialization::Record.define(
171
+ type: {fixed: 'pointerDown'},
172
+ button: 'button',
173
+ width: {wire_key: 'width', required: false},
174
+ height: {wire_key: 'height', required: false},
175
+ pressure: {wire_key: 'pressure', required: false, primitive: 'integer'},
176
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'integer'},
177
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
178
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
179
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
180
+ )
181
+
182
+ # @api private
183
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
184
+ PointerMoveAction = Serialization::Record.define(
185
+ type: {fixed: 'pointerMove'},
186
+ x: {wire_key: 'x', primitive: 'number'},
187
+ y: {wire_key: 'y', primitive: 'number'},
188
+ duration: {wire_key: 'duration', required: false},
189
+ origin: {wire_key: 'origin', required: false, ref: 'Input::Origin'},
190
+ width: {wire_key: 'width', required: false},
191
+ height: {wire_key: 'height', required: false},
192
+ pressure: {wire_key: 'pressure', required: false, primitive: 'integer'},
193
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'integer'},
194
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
195
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
196
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
197
+ )
198
+
199
+ # @api private
200
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
201
+ WheelScrollAction = Serialization::Record.define(
202
+ type: {fixed: 'scroll'},
203
+ x: 'x',
204
+ y: 'y',
205
+ delta_x: 'deltaX',
206
+ delta_y: 'deltaY',
207
+ duration: {wire_key: 'duration', required: false},
208
+ origin: {wire_key: 'origin', required: false, ref: 'Input::Origin'}
209
+ )
210
+
211
+ # @api private
212
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
213
+ PointerCommonProperties = Serialization::Record.define(
214
+ width: {wire_key: 'width', required: false},
215
+ height: {wire_key: 'height', required: false},
216
+ pressure: {wire_key: 'pressure', required: false, primitive: 'integer'},
217
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'integer'},
218
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
219
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
220
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
221
+ )
222
+
223
+ # @api private
224
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
+ class Origin < Serialization::Union
226
+ discriminator 'type', {element: 'element'}
227
+ variants(
228
+ element: 'Input::ElementOrigin'
229
+ )
230
+ end
231
+
232
+ # @api private
233
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
234
+ ReleaseActionsParameters = Serialization::Record.define(context: 'context')
235
+
236
+ # @api private
237
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
238
+ SetFilesParameters = Serialization::Record.define(
239
+ context: 'context',
240
+ element: {wire_key: 'element', ref: 'Script::SharedReference'},
241
+ files: {wire_key: 'files', list: true}
242
+ )
243
+
244
+ # @api private
245
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
246
+ FileDialogInfo = Serialization::Record.define(
247
+ context: 'context',
248
+ user_context: {wire_key: 'userContext', required: false},
249
+ element: {wire_key: 'element', required: false, ref: 'Script::SharedReference'},
250
+ multiple: {wire_key: 'multiple', primitive: 'boolean'}
251
+ )
252
+
253
+ EVENT_TYPES = {
254
+ 'input.fileDialogOpened' => Input::FileDialogInfo
255
+ }.freeze
256
+
257
+ # @api private
258
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
259
+ def perform_actions(context:, actions:)
260
+ params = PerformActionsParameters.new(context: context, actions: actions)
261
+ execute(cmd: 'input.performActions', params: params)
262
+ end
263
+
264
+ # @api private
265
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
266
+ def release_actions(context:)
267
+ params = ReleaseActionsParameters.new(context: context)
268
+ execute(cmd: 'input.releaseActions', params: params)
269
+ end
270
+
271
+ # @api private
272
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
273
+ def set_files(context:, element:, files:)
274
+ params = SetFilesParameters.new(context: context, element: element, files: files)
275
+ execute(cmd: 'input.setFiles', params: params)
276
+ end
277
+ end # Input
278
+ end # Protocol
279
+ end # BiDi
280
+ end # WebDriver
281
+ end # Selenium