selenium-webdriver 4.46.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +29 -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 +53 -23
  10. data/lib/selenium/webdriver/bidi/protocol/browser.rb +43 -15
  11. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +172 -68
  12. data/lib/selenium/webdriver/bidi/protocol/domain.rb +8 -2
  13. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +123 -9
  14. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  15. data/lib/selenium/webdriver/bidi/protocol/input.rb +101 -28
  16. data/lib/selenium/webdriver/bidi/protocol/log.rb +17 -6
  17. data/lib/selenium/webdriver/bidi/protocol/network.rb +146 -63
  18. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +4 -2
  19. data/lib/selenium/webdriver/bidi/protocol/script.rb +264 -86
  20. data/lib/selenium/webdriver/bidi/protocol/session.rb +48 -3
  21. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +4 -2
  22. data/lib/selenium/webdriver/bidi/protocol/storage.rb +32 -6
  23. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +7 -2
  24. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +49 -10
  25. data/lib/selenium/webdriver/bidi/protocol.rb +3 -0
  26. data/lib/selenium/webdriver/bidi/serialization/record.rb +194 -18
  27. data/lib/selenium/webdriver/bidi/serialization/union.rb +45 -3
  28. data/lib/selenium/webdriver/bidi/serialization.rb +13 -1
  29. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +529 -45
  30. data/lib/selenium/webdriver/bidi/support/check_generated.rb +12 -4
  31. data/lib/selenium/webdriver/bidi/transport.rb +8 -3
  32. data/lib/selenium/webdriver/chrome/service.rb +4 -1
  33. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  34. data/lib/selenium/webdriver/chromium/options.rb +20 -0
  35. data/lib/selenium/webdriver/common/driver.rb +11 -0
  36. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  37. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  38. data/lib/selenium/webdriver/common/driver_finder.rb +4 -3
  39. data/lib/selenium/webdriver/common/options.rb +21 -1
  40. data/lib/selenium/webdriver/common/proxy.rb +0 -8
  41. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  42. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  43. data/lib/selenium/webdriver/common.rb +0 -1
  44. data/lib/selenium/webdriver/edge/service.rb +4 -1
  45. data/lib/selenium/webdriver/firefox/driver.rb +0 -3
  46. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  47. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  48. data/lib/selenium/webdriver/remote/bidi_bridge.rb +39 -12
  49. data/lib/selenium/webdriver/remote/bridge.rb +1 -1
  50. data/lib/selenium/webdriver/remote/driver.rb +3 -1
  51. data/lib/selenium/webdriver/remote/http/default.rb +1 -1
  52. data/lib/selenium/webdriver/safari/options.rb +16 -1
  53. data/lib/selenium/webdriver/support/guards/guard.rb +20 -3
  54. data/lib/selenium/webdriver/support/guards.rb +9 -3
  55. data/lib/selenium/webdriver/version.rb +1 -1
  56. metadata +6 -3
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
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
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -26,7 +26,9 @@ module Selenium
26
26
  module Protocol
27
27
  # @api private
28
28
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ # @see https://w3c.github.io/webdriver-bidi/#module-session
29
30
  class Session < Domain
31
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UserPromptHandlerType
30
32
  USER_PROMPT_HANDLER_TYPE = {
31
33
  accept: 'accept',
32
34
  dismiss: 'dismiss',
@@ -35,6 +37,7 @@ module Selenium
35
37
 
36
38
  # @api private
37
39
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
40
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-CapabilitiesRequest
38
41
  CapabilitiesRequest = Serialization::Record.define(
39
42
  always_match: {wire_key: 'alwaysMatch', required: false, ref: 'Session::CapabilityRequest'},
40
43
  first_match: {wire_key: 'firstMatch', required: false, ref: 'Session::CapabilityRequest', list: true}
@@ -42,6 +45,7 @@ module Selenium
42
45
 
43
46
  # @api private
44
47
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
48
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-CapabilityRequest
45
49
  CapabilityRequest = Serialization::Record.define(
46
50
  accept_insecure_certs: {wire_key: 'acceptInsecureCerts', required: false, primitive: 'boolean'},
47
51
  browser_name: {wire_key: 'browserName', required: false, primitive: 'string'},
@@ -58,6 +62,7 @@ module Selenium
58
62
 
59
63
  # @api private
60
64
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
65
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-ProxyConfiguration
61
66
  class ProxyConfiguration < Serialization::Union
62
67
  discriminator 'proxyType', {
63
68
  autodetect: 'autodetect',
@@ -73,10 +78,18 @@ module Selenium
73
78
  pac: 'Session::PacProxyConfiguration',
74
79
  system: 'Session::SystemProxyConfiguration'
75
80
  )
81
+ object_only
82
+
83
+ def self.autodetect(**) = Session::AutodetectProxyConfiguration.new(**)
84
+ def self.direct(**) = Session::DirectProxyConfiguration.new(**)
85
+ def self.manual(**) = Session::ManualProxyConfiguration.new(**)
86
+ def self.pac(**) = Session::PacProxyConfiguration.new(**)
87
+ def self.system(**) = Session::SystemProxyConfiguration.new(**)
76
88
  end
77
89
 
78
90
  # @api private
79
91
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
92
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionautodetectproxyconfiguration
80
93
  AutodetectProxyConfiguration = Serialization::Record.define(
81
94
  proxy_type: {wire_key: 'proxyType', fixed: 'autodetect'},
82
95
  extensible: true
@@ -84,6 +97,7 @@ module Selenium
84
97
 
85
98
  # @api private
86
99
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
100
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessiondirectproxyconfiguration
87
101
  DirectProxyConfiguration = Serialization::Record.define(
88
102
  proxy_type: {wire_key: 'proxyType', fixed: 'direct'},
89
103
  extensible: true
@@ -91,6 +105,7 @@ module Selenium
91
105
 
92
106
  # @api private
93
107
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
108
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionmanualproxyconfiguration
94
109
  ManualProxyConfiguration = Serialization::Record.define(
95
110
  proxy_type: {wire_key: 'proxyType', fixed: 'manual'},
96
111
  http_proxy: {wire_key: 'httpProxy', required: false, primitive: 'string'},
@@ -103,6 +118,7 @@ module Selenium
103
118
 
104
119
  # @api private
105
120
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
121
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsocksproxyconfiguration
106
122
  SocksProxyConfiguration = Serialization::Record.define(
107
123
  socks_proxy: {wire_key: 'socksProxy', primitive: 'string'},
108
124
  socks_version: {wire_key: 'socksVersion', primitive: 'integer'}
@@ -110,6 +126,7 @@ module Selenium
110
126
 
111
127
  # @api private
112
128
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
129
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionpacproxyconfiguration
113
130
  PacProxyConfiguration = Serialization::Record.define(
114
131
  proxy_type: {wire_key: 'proxyType', fixed: 'pac'},
115
132
  proxy_autoconfig_url: {wire_key: 'proxyAutoconfigUrl', primitive: 'string'},
@@ -118,6 +135,7 @@ module Selenium
118
135
 
119
136
  # @api private
120
137
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
138
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsystemproxyconfiguration
121
139
  SystemProxyConfiguration = Serialization::Record.define(
122
140
  proxy_type: {wire_key: 'proxyType', fixed: 'system'},
123
141
  extensible: true
@@ -125,6 +143,7 @@ module Selenium
125
143
 
126
144
  # @api private
127
145
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
146
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UserPromptHandler
128
147
  UserPromptHandler = Serialization::Record.define(
129
148
  alert: {wire_key: 'alert', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
130
149
  before_unload: {wire_key: 'beforeUnload', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
@@ -136,6 +155,7 @@ module Selenium
136
155
 
137
156
  # @api private
138
157
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
158
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsubscribeparameters
139
159
  SubscribeParameters = Serialization::Record.define(
140
160
  events: {wire_key: 'events', list: true},
141
161
  contexts: {wire_key: 'contexts', required: false, list: true},
@@ -144,14 +164,17 @@ module Selenium
144
164
 
145
165
  # @api private
146
166
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
167
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByIDRequest
147
168
  UnsubscribeByIDRequest = Serialization::Record.define(subscriptions: {wire_key: 'subscriptions', list: true})
148
169
 
149
170
  # @api private
150
171
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
172
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByAttributesRequest
151
173
  UnsubscribeByAttributesRequest = Serialization::Record.define(events: {wire_key: 'events', list: true})
152
174
 
153
175
  # @api private
154
176
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
177
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionstatusresult
155
178
  StatusResult = Serialization::Record.define(
156
179
  ready: {wire_key: 'ready', primitive: 'boolean'},
157
180
  message: {wire_key: 'message', primitive: 'string'}
@@ -159,12 +182,14 @@ module Selenium
159
182
 
160
183
  # @api private
161
184
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
185
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionnewparameters
162
186
  NewParameters = Serialization::Record.define(
163
187
  capabilities: {wire_key: 'capabilities', ref: 'Session::CapabilitiesRequest'}
164
188
  )
165
189
 
166
190
  # @api private
167
191
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
192
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionnewresult
168
193
  NewResult = Serialization::Record.define(
169
194
  session_id: {wire_key: 'sessionId', primitive: 'string'},
170
195
  capabilities: {wire_key: 'capabilities', ref: 'Session::NewResult::Capabilities'}
@@ -191,25 +216,42 @@ module Selenium
191
216
 
192
217
  # @api private
193
218
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
194
- SubscribeResult = Serialization::Record.define(subscription: 'subscription')
219
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsubscriberesult
220
+ SubscribeResult = Serialization::Record.define(subscription: {wire_key: 'subscription', primitive: 'string'})
195
221
 
196
222
  # @api private
197
223
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
224
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionunsubscribeparameters
198
225
  class UnsubscribeParameters < Serialization::Union
199
226
  presence(
200
227
  'Session::UnsubscribeByAttributesRequest' => ['events'],
201
228
  'Session::UnsubscribeByIDRequest' => ['subscriptions']
202
229
  )
230
+ object_only
203
231
  end
204
232
 
233
+ def capabilities_request(**) = CapabilitiesRequest.new(**)
234
+ def capability_request(**) = CapabilityRequest.new(**)
235
+ def proxy_configuration = ProxyConfiguration
236
+ def autodetect_proxy_configuration(**) = AutodetectProxyConfiguration.new(**)
237
+ def direct_proxy_configuration(**) = DirectProxyConfiguration.new(**)
238
+ def manual_proxy_configuration(**) = ManualProxyConfiguration.new(**)
239
+ def pac_proxy_configuration(**) = PacProxyConfiguration.new(**)
240
+ def system_proxy_configuration(**) = SystemProxyConfiguration.new(**)
241
+ def user_prompt_handler(**) = UserPromptHandler.new(**)
242
+ def unsubscribe_by_id_request(**) = UnsubscribeByIDRequest.new(**)
243
+ def unsubscribe_by_attributes_request(**) = UnsubscribeByAttributesRequest.new(**)
244
+
205
245
  # @api private
206
246
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
247
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-end
207
248
  def end_
208
249
  execute(cmd: 'session.end')
209
250
  end
210
251
 
211
252
  # @api private
212
253
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
254
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-new
213
255
  def new(capabilities:)
214
256
  params = NewParameters.new(capabilities: capabilities)
215
257
  execute(cmd: 'session.new', params: params, result: Session::NewResult)
@@ -217,12 +259,14 @@ module Selenium
217
259
 
218
260
  # @api private
219
261
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
262
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-status
220
263
  def status
221
264
  execute(cmd: 'session.status', result: Session::StatusResult)
222
265
  end
223
266
 
224
267
  # @api private
225
268
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
269
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-subscribe
226
270
  def subscribe(events:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
227
271
  params = SubscribeParameters.new(events: events, contexts: contexts, user_contexts: user_contexts)
228
272
  execute(cmd: 'session.subscribe', params: params, result: Session::SubscribeResult)
@@ -230,6 +274,7 @@ module Selenium
230
274
 
231
275
  # @api private
232
276
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
277
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe
233
278
  def unsubscribe(events: Serialization::UNSET, subscriptions: Serialization::UNSET)
234
279
  params = UnsubscribeParameters.build(events: events, subscriptions: subscriptions)
235
280
  execute(cmd: 'session.unsubscribe', params: params)
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
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
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -31,6 +31,7 @@ module Selenium
31
31
  prefetch_status_updated: 'speculation.prefetchStatusUpdated'
32
32
  }.freeze
33
33
 
34
+ # @see https://wicg.github.io/nav-speculation/prefetch.html#cddl-type-speculationpreloadingstatus
34
35
  PRELOADING_STATUS = {
35
36
  pending: 'pending',
36
37
  ready: 'ready',
@@ -40,6 +41,7 @@ module Selenium
40
41
 
41
42
  # @api private
42
43
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
44
+ # @see https://wicg.github.io/nav-speculation/prefetch.html#cddl-type-speculationprefetchstatusupdatedparameters
43
45
  PrefetchStatusUpdatedParameters = Serialization::Record.define(
44
46
  context: {wire_key: 'context', primitive: 'string'},
45
47
  url: {wire_key: 'url', primitive: 'string'},
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
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
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -26,9 +26,11 @@ module Selenium
26
26
  module Protocol
27
27
  # @api private
28
28
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ # @see https://w3c.github.io/webdriver-bidi/#module-storage
29
30
  class Storage < Domain
30
31
  # @api private
31
32
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
33
+ # @see https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey
32
34
  PartitionKey = Serialization::Record.define(
33
35
  user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
34
36
  source_origin: {wire_key: 'sourceOrigin', required: false, primitive: 'string'},
@@ -37,28 +39,31 @@ module Selenium
37
39
 
38
40
  # @api private
39
41
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
42
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagecookiefilter
40
43
  CookieFilter = Serialization::Record.define(
41
44
  name: {wire_key: 'name', required: false, primitive: 'string'},
42
45
  value: {wire_key: 'value', required: false, ref: 'Network::BytesValue'},
43
46
  domain: {wire_key: 'domain', required: false, primitive: 'string'},
44
47
  path: {wire_key: 'path', required: false, primitive: 'string'},
45
- size: {wire_key: 'size', required: false},
48
+ size: {wire_key: 'size', required: false, primitive: 'integer'},
46
49
  http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
47
50
  secure: {wire_key: 'secure', required: false, primitive: 'boolean'},
48
51
  same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
49
- expiry: {wire_key: 'expiry', required: false},
52
+ expiry: {wire_key: 'expiry', required: false, primitive: 'integer'},
50
53
  extensible: true
51
54
  )
52
55
 
53
56
  # @api private
54
57
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
58
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagebrowsingcontextpartitiondescriptor
55
59
  BrowsingContextPartitionDescriptor = Serialization::Record.define(
56
60
  type: {fixed: 'context'},
57
- context: 'context'
61
+ context: {wire_key: 'context', primitive: 'string'}
58
62
  )
59
63
 
60
64
  # @api private
61
65
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
66
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagestoragekeypartitiondescriptor
62
67
  StorageKeyPartitionDescriptor = Serialization::Record.define(
63
68
  type: {fixed: 'storageKey'},
64
69
  user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
@@ -68,16 +73,22 @@ module Selenium
68
73
 
69
74
  # @api private
70
75
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
76
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagepartitiondescriptor
71
77
  class PartitionDescriptor < Serialization::Union
72
78
  discriminator 'type', {context: 'context', storage_key: 'storageKey'}
73
79
  variants(
74
80
  context: 'Storage::BrowsingContextPartitionDescriptor',
75
81
  storage_key: 'Storage::StorageKeyPartitionDescriptor'
76
82
  )
83
+ object_only
84
+
85
+ def self.context(**) = Storage::BrowsingContextPartitionDescriptor.new(**)
86
+ def self.storage_key(**) = Storage::StorageKeyPartitionDescriptor.new(**)
77
87
  end
78
88
 
79
89
  # @api private
80
90
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
91
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagegetcookiesparameters
81
92
  GetCookiesParameters = Serialization::Record.define(
82
93
  filter: {wire_key: 'filter', required: false, ref: 'Storage::CookieFilter'},
83
94
  partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
@@ -85,6 +96,7 @@ module Selenium
85
96
 
86
97
  # @api private
87
98
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
99
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagegetcookiesresult
88
100
  GetCookiesResult = Serialization::Record.define(
89
101
  cookies: {wire_key: 'cookies', ref: 'Network::Cookie', list: true},
90
102
  partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
@@ -92,6 +104,7 @@ module Selenium
92
104
 
93
105
  # @api private
94
106
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
107
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagepartialcookie
95
108
  PartialCookie = Serialization::Record.define(
96
109
  name: {wire_key: 'name', primitive: 'string'},
97
110
  value: {wire_key: 'value', ref: 'Network::BytesValue'},
@@ -100,12 +113,13 @@ module Selenium
100
113
  http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
101
114
  secure: {wire_key: 'secure', required: false, primitive: 'boolean'},
102
115
  same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
103
- expiry: {wire_key: 'expiry', required: false},
116
+ expiry: {wire_key: 'expiry', required: false, primitive: 'integer'},
104
117
  extensible: true
105
118
  )
106
119
 
107
120
  # @api private
108
121
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
122
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagesetcookieparameters
109
123
  SetCookieParameters = Serialization::Record.define(
110
124
  cookie: {wire_key: 'cookie', ref: 'Storage::PartialCookie'},
111
125
  partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
@@ -113,12 +127,14 @@ module Selenium
113
127
 
114
128
  # @api private
115
129
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
130
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagesetcookieresult
116
131
  SetCookieResult = Serialization::Record.define(
117
132
  partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
118
133
  )
119
134
 
120
135
  # @api private
121
136
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
137
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagedeletecookiesparameters
122
138
  DeleteCookiesParameters = Serialization::Record.define(
123
139
  filter: {wire_key: 'filter', required: false, ref: 'Storage::CookieFilter'},
124
140
  partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
@@ -126,12 +142,20 @@ module Selenium
126
142
 
127
143
  # @api private
128
144
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
145
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagedeletecookiesresult
129
146
  DeleteCookiesResult = Serialization::Record.define(
130
147
  partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
131
148
  )
132
149
 
150
+ def cookie_filter(**) = CookieFilter.new(**)
151
+ def browsing_context_partition_descriptor(**) = BrowsingContextPartitionDescriptor.new(**)
152
+ def storage_key_partition_descriptor(**) = StorageKeyPartitionDescriptor.new(**)
153
+ def partition_descriptor = PartitionDescriptor
154
+ def partial_cookie(**) = PartialCookie.new(**)
155
+
133
156
  # @api private
134
157
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
158
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-deleteCookies
135
159
  def delete_cookies(filter: Serialization::UNSET, partition: Serialization::UNSET)
136
160
  params = DeleteCookiesParameters.new(filter: filter, partition: partition)
137
161
  execute(cmd: 'storage.deleteCookies', params: params, result: Storage::DeleteCookiesResult)
@@ -139,6 +163,7 @@ module Selenium
139
163
 
140
164
  # @api private
141
165
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
166
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-getCookies
142
167
  def get_cookies(filter: Serialization::UNSET, partition: Serialization::UNSET)
143
168
  params = GetCookiesParameters.new(filter: filter, partition: partition)
144
169
  execute(cmd: 'storage.getCookies', params: params, result: Storage::GetCookiesResult)
@@ -146,6 +171,7 @@ module Selenium
146
171
 
147
172
  # @api private
148
173
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
174
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-setCookie
149
175
  def set_cookie(cookie:, partition: Serialization::UNSET)
150
176
  params = SetCookieParameters.new(cookie: cookie, partition: partition)
151
177
  execute(cmd: 'storage.setCookie', params: params, result: Storage::SetCookieResult)
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
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
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -29,6 +29,7 @@ module Selenium
29
29
  class UserAgentClientHints < Domain
30
30
  # @api private
31
31
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
32
+ # @see https://wicg.github.io/ua-client-hints/#cddl-type-useragentclienthintsclienthintsmetadata
32
33
  ClientHintsMetadata = Serialization::Record.define(
33
34
  brands: {wire_key: 'brands', required: false, ref: 'UserAgentClientHints::BrandVersion', list: true},
34
35
  full_version_list: {
@@ -49,6 +50,7 @@ module Selenium
49
50
 
50
51
  # @api private
51
52
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
53
+ # @see https://wicg.github.io/ua-client-hints/#cddl-type-useragentclienthintsbrandversion
52
54
  BrandVersion = Serialization::Record.define(
53
55
  brand: {wire_key: 'brand', primitive: 'string'},
54
56
  version: {wire_key: 'version', primitive: 'string'}
@@ -62,6 +64,9 @@ module Selenium
62
64
  user_contexts: {wire_key: 'userContexts', required: false, list: true}
63
65
  )
64
66
 
67
+ def client_hints_metadata(**) = ClientHintsMetadata.new(**)
68
+ def brand_version(**) = BrandVersion.new(**)
69
+
65
70
  # @api private
66
71
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
67
72
  def set_client_hints_override(
@@ -17,8 +17,8 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- # This file is automatically generated. DO NOT EDIT!
21
- # Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate
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
22
 
23
23
  module Selenium
24
24
  module WebDriver
@@ -26,15 +26,11 @@ module Selenium
26
26
  module Protocol
27
27
  # @api private
28
28
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ # @see https://w3c.github.io/webdriver-bidi/#module-webExtension
29
30
  class WebExtension < Domain
30
31
  # @api private
31
32
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
32
- InstallParameters = Serialization::Record.define(
33
- extension_data: {wire_key: 'extensionData', ref: 'WebExtension::ExtensionData'}
34
- )
35
-
36
- # @api private
37
- # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
33
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensionextensiondata
38
34
  class ExtensionData < Serialization::Union
39
35
  discriminator 'type', {archive_path: 'archivePath', base64: 'base64', path: 'path'}
40
36
  variants(
@@ -42,10 +38,16 @@ module Selenium
42
38
  base64: 'WebExtension::ExtensionBase64Encoded',
43
39
  path: 'WebExtension::ExtensionPath'
44
40
  )
41
+ object_only
42
+
43
+ def self.archive_path(**) = WebExtension::ExtensionArchivePath.new(**)
44
+ def self.base64(**) = WebExtension::ExtensionBase64Encoded.new(**)
45
+ def self.path(**) = WebExtension::ExtensionPath.new(**)
45
46
  end
46
47
 
47
48
  # @api private
48
49
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
50
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensionextensionpath
49
51
  ExtensionPath = Serialization::Record.define(
50
52
  type: {fixed: 'path'},
51
53
  path: {wire_key: 'path', primitive: 'string'}
@@ -53,6 +55,7 @@ module Selenium
53
55
 
54
56
  # @api private
55
57
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
58
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensionextensionarchivepath
56
59
  ExtensionArchivePath = Serialization::Record.define(
57
60
  type: {fixed: 'archivePath'},
58
61
  path: {wire_key: 'path', primitive: 'string'}
@@ -60,6 +63,7 @@ module Selenium
60
63
 
61
64
  # @api private
62
65
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
66
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensionextensionbase64encoded
63
67
  ExtensionBase64Encoded = Serialization::Record.define(
64
68
  type: {fixed: 'base64'},
65
69
  value: {wire_key: 'value', primitive: 'string'}
@@ -67,14 +71,31 @@ module Selenium
67
71
 
68
72
  # @api private
69
73
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
70
- InstallResult = Serialization::Record.define(extension: 'extension')
74
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensioninstallresult
75
+ InstallResult = Serialization::Record.define(extension: {wire_key: 'extension', primitive: 'string'})
71
76
 
72
77
  # @api private
73
78
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
74
- UninstallParameters = Serialization::Record.define(extension: 'extension')
79
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensionuninstallparameters
80
+ UninstallParameters = Serialization::Record.define(extension: {wire_key: 'extension', primitive: 'string'})
75
81
 
76
82
  # @api private
77
83
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
84
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-webextensioninstallparameters
85
+ InstallParameters = Serialization::Record.define(
86
+ extension_data: {wire_key: 'extensionData', ref: 'WebExtension::ExtensionData'},
87
+ extensible: true
88
+ )
89
+
90
+ def extension_data = ExtensionData
91
+ def extension_path(**) = ExtensionPath.new(**)
92
+ def extension_archive_path(**) = ExtensionArchivePath.new(**)
93
+ def extension_base64_encoded(**) = ExtensionBase64Encoded.new(**)
94
+ def moz = Moz.new(connection)
95
+
96
+ # @api private
97
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
98
+ # @see https://w3c.github.io/webdriver-bidi/#command-webExtension-install
78
99
  def install(extension_data:)
79
100
  params = InstallParameters.new(extension_data: extension_data)
80
101
  execute(cmd: 'webExtension.install', params: params, result: WebExtension::InstallResult)
@@ -82,10 +103,28 @@ module Selenium
82
103
 
83
104
  # @api private
84
105
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
106
+ # @see https://w3c.github.io/webdriver-bidi/#command-webExtension-uninstall
85
107
  def uninstall(extension:)
86
108
  params = UninstallParameters.new(extension: extension)
87
109
  execute(cmd: 'webExtension.uninstall', params: params)
88
110
  end
111
+
112
+ # @api private
113
+ # moz: vendor variant of WebExtension, overriding commands with browser-specific params.
114
+ # Construct Moz.new(source) for a matching session; other sessions use WebExtension.
115
+ class Moz < WebExtension
116
+ # @api private
117
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
118
+ # @see https://w3c.github.io/webdriver-bidi/#command-webExtension-install
119
+ def install(extension_data:, allow_private_browsing: Serialization::UNSET, permanent: Serialization::UNSET)
120
+ extensions = {
121
+ 'moz:allowPrivateBrowsing' => allow_private_browsing,
122
+ 'moz:permanent' => permanent
123
+ }.reject { |_, value| Serialization::UNSET.equal?(value) }
124
+ params = InstallParameters.new(extension_data: extension_data, extensions: extensions)
125
+ execute(cmd: 'webExtension.install', params: params, result: WebExtension::InstallResult)
126
+ end
127
+ end
89
128
  end # WebExtension
90
129
  end # Protocol
91
130
  end # BiDi
@@ -20,9 +20,12 @@
20
20
  # serialization must load first (it defines the Serialization runtime the generated
21
21
  # classes build on), then the Domain base the generated classes subclass. Add a require
22
22
  # below when a new BiDi domain is generated.
23
+ require 'selenium/webdriver/common/error'
23
24
  require 'selenium/webdriver/bidi/serialization'
24
25
  require 'selenium/webdriver/bidi/transport'
25
26
  require 'selenium/webdriver/bidi/protocol/domain'
27
+ require 'selenium/webdriver/bidi/protocol/error_code'
28
+ require 'selenium/webdriver/bidi/error'
26
29
  require 'selenium/webdriver/bidi/protocol/bluetooth'
27
30
  require 'selenium/webdriver/bidi/protocol/browser'
28
31
  require 'selenium/webdriver/bidi/protocol/browsing_context'