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,354 @@
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-input
30
+ class Input < Domain
31
+ EVENTS = {
32
+ file_dialog_opened: 'input.fileDialogOpened'
33
+ }.freeze
34
+
35
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointertype
36
+ POINTER_TYPE = {
37
+ mouse: 'mouse',
38
+ pen: 'pen',
39
+ touch: 'touch'
40
+ }.freeze
41
+
42
+ # @api private
43
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
44
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputelementorigin
45
+ ElementOrigin = Serialization::Record.define(
46
+ type: {fixed: 'element'},
47
+ element: {wire_key: 'element', ref: 'Script::SharedReference'}
48
+ )
49
+
50
+ # @api private
51
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
52
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputperformactionsparameters
53
+ PerformActionsParameters = Serialization::Record.define(
54
+ context: {wire_key: 'context', primitive: 'string'},
55
+ actions: {wire_key: 'actions', ref: 'Input::SourceActions', list: true}
56
+ )
57
+
58
+ # @api private
59
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
60
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputsourceactions
61
+ class SourceActions < Serialization::Union
62
+ discriminator 'type', {none: 'none', key: 'key', pointer: 'pointer', wheel: 'wheel'}
63
+ variants(
64
+ none: 'Input::NoneSourceActions',
65
+ key: 'Input::KeySourceActions',
66
+ pointer: 'Input::PointerSourceActions',
67
+ wheel: 'Input::WheelSourceActions'
68
+ )
69
+ object_only
70
+
71
+ def self.none(**) = Input::NoneSourceActions.new(**)
72
+ def self.key(**) = Input::KeySourceActions.new(**)
73
+ def self.pointer(**) = Input::PointerSourceActions.new(**)
74
+ def self.wheel(**) = Input::WheelSourceActions.new(**)
75
+ end
76
+
77
+ # @api private
78
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
79
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputnonesourceactions
80
+ NoneSourceActions = Serialization::Record.define(
81
+ type: {fixed: 'none'},
82
+ id: {wire_key: 'id', primitive: 'string'},
83
+ actions: {wire_key: 'actions', ref: 'Input::PauseAction', list: true}
84
+ )
85
+
86
+ # @api private
87
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
88
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputkeysourceactions
89
+ KeySourceActions = Serialization::Record.define(
90
+ type: {fixed: 'key'},
91
+ id: {wire_key: 'id', primitive: 'string'},
92
+ actions: {wire_key: 'actions', ref: 'Input::KeySourceAction', list: true}
93
+ )
94
+
95
+ # @api private
96
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
97
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputkeysourceaction
98
+ class KeySourceAction < Serialization::Union
99
+ discriminator 'type', {pause: 'pause', key_down: 'keyDown', key_up: 'keyUp'}
100
+ variants(
101
+ pause: 'Input::PauseAction',
102
+ key_down: 'Input::KeyDownAction',
103
+ key_up: 'Input::KeyUpAction'
104
+ )
105
+ object_only
106
+
107
+ def self.pause(**) = Input::PauseAction.new(**)
108
+ def self.key_down(**) = Input::KeyDownAction.new(**)
109
+ def self.key_up(**) = Input::KeyUpAction.new(**)
110
+ end
111
+
112
+ # @api private
113
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
114
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointersourceactions
115
+ PointerSourceActions = Serialization::Record.define(
116
+ type: {fixed: 'pointer'},
117
+ id: {wire_key: 'id', primitive: 'string'},
118
+ parameters: {wire_key: 'parameters', required: false, ref: 'Input::PointerParameters'},
119
+ actions: {wire_key: 'actions', ref: 'Input::PointerSourceAction', list: true}
120
+ )
121
+
122
+ # @api private
123
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
124
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointerparameters
125
+ PointerParameters = Serialization::Record.define(
126
+ pointer_type: {wire_key: 'pointerType', required: false, enum: 'Input::POINTER_TYPE'}
127
+ )
128
+
129
+ # @api private
130
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
131
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointersourceaction
132
+ class PointerSourceAction < Serialization::Union
133
+ discriminator 'type', {
134
+ pause: 'pause',
135
+ pointer_down: 'pointerDown',
136
+ pointer_up: 'pointerUp',
137
+ pointer_move: 'pointerMove'
138
+ }
139
+ variants(
140
+ pause: 'Input::PauseAction',
141
+ pointer_down: 'Input::PointerDownAction',
142
+ pointer_up: 'Input::PointerUpAction',
143
+ pointer_move: 'Input::PointerMoveAction'
144
+ )
145
+ object_only
146
+
147
+ def self.pause(**) = Input::PauseAction.new(**)
148
+ def self.pointer_down(**) = Input::PointerDownAction.new(**)
149
+ def self.pointer_up(**) = Input::PointerUpAction.new(**)
150
+ def self.pointer_move(**) = Input::PointerMoveAction.new(**)
151
+ end
152
+
153
+ # @api private
154
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
155
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputwheelsourceactions
156
+ WheelSourceActions = Serialization::Record.define(
157
+ type: {fixed: 'wheel'},
158
+ id: {wire_key: 'id', primitive: 'string'},
159
+ actions: {wire_key: 'actions', ref: 'Input::WheelSourceAction', list: true}
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-inputwheelsourceaction
165
+ class WheelSourceAction < Serialization::Union
166
+ discriminator 'type', {pause: 'pause', scroll: 'scroll'}
167
+ variants(
168
+ pause: 'Input::PauseAction',
169
+ scroll: 'Input::WheelScrollAction'
170
+ )
171
+ object_only
172
+
173
+ def self.pause(**) = Input::PauseAction.new(**)
174
+ def self.scroll(**) = Input::WheelScrollAction.new(**)
175
+ end
176
+
177
+ # @api private
178
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
179
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpauseaction
180
+ PauseAction = Serialization::Record.define(
181
+ type: {fixed: 'pause'},
182
+ duration: {wire_key: 'duration', required: false, primitive: 'integer'}
183
+ )
184
+
185
+ # @api private
186
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
187
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputkeydownaction
188
+ KeyDownAction = Serialization::Record.define(
189
+ type: {fixed: 'keyDown'},
190
+ value: {wire_key: 'value', primitive: 'string'}
191
+ )
192
+
193
+ # @api private
194
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
195
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputkeyupaction
196
+ KeyUpAction = Serialization::Record.define(
197
+ type: {fixed: 'keyUp'},
198
+ value: {wire_key: 'value', primitive: 'string'}
199
+ )
200
+
201
+ # @api private
202
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
203
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointerupaction
204
+ PointerUpAction = Serialization::Record.define(
205
+ type: {fixed: 'pointerUp'},
206
+ button: {wire_key: 'button', primitive: 'integer'}
207
+ )
208
+
209
+ # @api private
210
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
211
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointerdownaction
212
+ PointerDownAction = Serialization::Record.define(
213
+ type: {fixed: 'pointerDown'},
214
+ button: {wire_key: 'button', primitive: 'integer'},
215
+ width: {wire_key: 'width', required: false, primitive: 'integer'},
216
+ height: {wire_key: 'height', required: false, primitive: 'integer'},
217
+ pressure: {wire_key: 'pressure', required: false, primitive: 'number'},
218
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'number'},
219
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
220
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
221
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
222
+ )
223
+
224
+ # @api private
225
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
226
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointermoveaction
227
+ PointerMoveAction = Serialization::Record.define(
228
+ type: {fixed: 'pointerMove'},
229
+ x: {wire_key: 'x', primitive: 'number'},
230
+ y: {wire_key: 'y', primitive: 'number'},
231
+ duration: {wire_key: 'duration', required: false, primitive: 'integer'},
232
+ origin: {wire_key: 'origin', required: false, ref: 'Input::Origin'},
233
+ width: {wire_key: 'width', required: false, primitive: 'integer'},
234
+ height: {wire_key: 'height', required: false, primitive: 'integer'},
235
+ pressure: {wire_key: 'pressure', required: false, primitive: 'number'},
236
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'number'},
237
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
238
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
239
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
240
+ )
241
+
242
+ # @api private
243
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
244
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputwheelscrollaction
245
+ WheelScrollAction = Serialization::Record.define(
246
+ type: {fixed: 'scroll'},
247
+ x: {wire_key: 'x', primitive: 'integer'},
248
+ y: {wire_key: 'y', primitive: 'integer'},
249
+ delta_x: {wire_key: 'deltaX', primitive: 'integer'},
250
+ delta_y: {wire_key: 'deltaY', primitive: 'integer'},
251
+ duration: {wire_key: 'duration', required: false, primitive: 'integer'},
252
+ origin: {wire_key: 'origin', required: false, ref: 'Input::Origin'}
253
+ )
254
+
255
+ # @api private
256
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
257
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputpointercommonproperties
258
+ PointerCommonProperties = Serialization::Record.define(
259
+ width: {wire_key: 'width', required: false, primitive: 'integer'},
260
+ height: {wire_key: 'height', required: false, primitive: 'integer'},
261
+ pressure: {wire_key: 'pressure', required: false, primitive: 'number'},
262
+ tangential_pressure: {wire_key: 'tangentialPressure', required: false, primitive: 'number'},
263
+ twist: {wire_key: 'twist', required: false, primitive: 'integer'},
264
+ altitude_angle: {wire_key: 'altitudeAngle', required: false, primitive: 'number'},
265
+ azimuth_angle: {wire_key: 'azimuthAngle', required: false, primitive: 'number'}
266
+ )
267
+
268
+ # @api private
269
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
270
+ # @see https://w3c.github.io/webdriver-bidi/#type-input-origin
271
+ class Origin < Serialization::Union
272
+ discriminator 'type', {element: 'element'}
273
+ variants(
274
+ element: 'Input::ElementOrigin'
275
+ )
276
+ scalar_values 'viewport', 'pointer'
277
+
278
+ def self.element(**) = Input::ElementOrigin.new(**)
279
+ end
280
+
281
+ # @api private
282
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
283
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputreleaseactionsparameters
284
+ ReleaseActionsParameters = Serialization::Record.define(context: {wire_key: 'context', primitive: 'string'})
285
+
286
+ # @api private
287
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
288
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputsetfilesparameters
289
+ SetFilesParameters = Serialization::Record.define(
290
+ context: {wire_key: 'context', primitive: 'string'},
291
+ element: {wire_key: 'element', ref: 'Script::SharedReference'},
292
+ files: {wire_key: 'files', list: true}
293
+ )
294
+
295
+ # @api private
296
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
297
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-inputfiledialoginfo
298
+ FileDialogInfo = Serialization::Record.define(
299
+ context: {wire_key: 'context', primitive: 'string'},
300
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
301
+ element: {wire_key: 'element', required: false, ref: 'Script::SharedReference'},
302
+ multiple: {wire_key: 'multiple', primitive: 'boolean'}
303
+ )
304
+
305
+ EVENT_TYPES = {
306
+ 'input.fileDialogOpened' => Input::FileDialogInfo
307
+ }.freeze
308
+
309
+ def element_origin(**) = ElementOrigin.new(**)
310
+ def source_actions = SourceActions
311
+ def none_source_actions(**) = NoneSourceActions.new(**)
312
+ def key_source_actions(**) = KeySourceActions.new(**)
313
+ def key_source_action = KeySourceAction
314
+ def pointer_source_actions(**) = PointerSourceActions.new(**)
315
+ def pointer_parameters(**) = PointerParameters.new(**)
316
+ def pointer_source_action = PointerSourceAction
317
+ def wheel_source_actions(**) = WheelSourceActions.new(**)
318
+ def wheel_source_action = WheelSourceAction
319
+ def pause_action(**) = PauseAction.new(**)
320
+ def key_down_action(**) = KeyDownAction.new(**)
321
+ def key_up_action(**) = KeyUpAction.new(**)
322
+ def pointer_up_action(**) = PointerUpAction.new(**)
323
+ def pointer_down_action(**) = PointerDownAction.new(**)
324
+ def pointer_move_action(**) = PointerMoveAction.new(**)
325
+ def wheel_scroll_action(**) = WheelScrollAction.new(**)
326
+
327
+ # @api private
328
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
329
+ # @see https://w3c.github.io/webdriver-bidi/#command-input-performActions
330
+ def perform_actions(context:, actions:)
331
+ params = PerformActionsParameters.new(context: context, actions: actions)
332
+ execute(cmd: 'input.performActions', params: params)
333
+ end
334
+
335
+ # @api private
336
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
337
+ # @see https://w3c.github.io/webdriver-bidi/#command-input-releaseActions
338
+ def release_actions(context:)
339
+ params = ReleaseActionsParameters.new(context: context)
340
+ execute(cmd: 'input.releaseActions', params: params)
341
+ end
342
+
343
+ # @api private
344
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
345
+ # @see https://w3c.github.io/webdriver-bidi/#command-input-setFiles
346
+ def set_files(context:, element:, files:)
347
+ params = SetFilesParameters.new(context: context, element: element, files: files)
348
+ execute(cmd: 'input.setFiles', params: params)
349
+ end
350
+ end # Input
351
+ end # Protocol
352
+ end # BiDi
353
+ end # WebDriver
354
+ end # Selenium
@@ -0,0 +1,115 @@
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-log
30
+ class Log < Domain
31
+ EVENTS = {
32
+ entry_added: 'log.entryAdded'
33
+ }.freeze
34
+
35
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-loglevel
36
+ LEVEL = {
37
+ debug: 'debug',
38
+ info: 'info',
39
+ warn: 'warn',
40
+ error: 'error'
41
+ }.freeze
42
+
43
+ # @api private
44
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
45
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-logentry
46
+ class Entry < Serialization::Union
47
+ discriminator 'type', {console: 'console', javascript: 'javascript'}
48
+ variants(
49
+ console: 'Log::ConsoleLogEntry',
50
+ javascript: 'Log::JavascriptLogEntry'
51
+ )
52
+ fallback 'Log::GenericLogEntry'
53
+ object_only
54
+
55
+ def self.console(**) = Log::ConsoleLogEntry.new(**)
56
+ def self.javascript(**) = Log::JavascriptLogEntry.new(**)
57
+ end
58
+
59
+ # @api private
60
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
61
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-logbaselogentry
62
+ BaseLogEntry = Serialization::Record.define(
63
+ level: {wire_key: 'level', enum: 'Log::LEVEL'},
64
+ source: {wire_key: 'source', ref: 'Script::Source'},
65
+ text: {wire_key: 'text', nullable: true, primitive: 'string'},
66
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
67
+ stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'}
68
+ )
69
+
70
+ # @api private
71
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
72
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-loggenericlogentry
73
+ GenericLogEntry = Serialization::Record.define(
74
+ level: {wire_key: 'level', enum: 'Log::LEVEL'},
75
+ source: {wire_key: 'source', ref: 'Script::Source'},
76
+ text: {wire_key: 'text', nullable: true, primitive: 'string'},
77
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
78
+ stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'},
79
+ type: {wire_key: 'type', primitive: 'string'}
80
+ )
81
+
82
+ # @api private
83
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
84
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-logconsolelogentry
85
+ ConsoleLogEntry = Serialization::Record.define(
86
+ type: {fixed: 'console'},
87
+ level: {wire_key: 'level', enum: 'Log::LEVEL'},
88
+ source: {wire_key: 'source', ref: 'Script::Source'},
89
+ text: {wire_key: 'text', nullable: true, primitive: 'string'},
90
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
91
+ stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'},
92
+ method_: {wire_key: 'method', primitive: 'string'},
93
+ args: {wire_key: 'args', ref: 'Script::RemoteValue', list: true}
94
+ )
95
+
96
+ # @api private
97
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
98
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-logjavascriptlogentry
99
+ JavascriptLogEntry = Serialization::Record.define(
100
+ type: {fixed: 'javascript'},
101
+ level: {wire_key: 'level', enum: 'Log::LEVEL'},
102
+ source: {wire_key: 'source', ref: 'Script::Source'},
103
+ text: {wire_key: 'text', nullable: true, primitive: 'string'},
104
+ timestamp: {wire_key: 'timestamp', primitive: 'integer'},
105
+ stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'}
106
+ )
107
+
108
+ EVENT_TYPES = {
109
+ 'log.entryAdded' => Log::Entry
110
+ }.freeze
111
+ end # Log
112
+ end # Protocol
113
+ end # BiDi
114
+ end # WebDriver
115
+ end # Selenium