selenium-webdriver 4.35.0 → 4.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +111 -0
  3. data/Gemfile +1 -4
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +43 -23
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
  10. data/bin/selenium-manager.cdx.json +11629 -0
  11. data/bin/windows/selenium-manager.exe +0 -0
  12. data/lib/selenium/server.rb +30 -5
  13. data/lib/selenium/webdriver/atoms/findElements.js +272 -54
  14. data/lib/selenium/webdriver/atoms/getAttribute.js +152 -6
  15. data/lib/selenium/webdriver/atoms/isDisplayed.js +385 -28
  16. data/lib/selenium/webdriver/bidi/browser.rb +71 -0
  17. data/lib/selenium/webdriver/bidi/browsing_context.rb +3 -2
  18. data/lib/selenium/webdriver/bidi/{log/filter_by.rb → error.rb} +20 -16
  19. data/lib/selenium/webdriver/bidi/log_handler.rb +5 -0
  20. data/lib/selenium/webdriver/bidi/network/cookies.rb +13 -9
  21. data/lib/selenium/webdriver/bidi/network/credentials.rb +4 -0
  22. data/lib/selenium/webdriver/bidi/network/headers.rb +4 -0
  23. data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +4 -0
  24. data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +4 -0
  25. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +20 -4
  26. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +24 -6
  27. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +4 -0
  28. data/lib/selenium/webdriver/bidi/network.rb +18 -9
  29. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
  30. data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
  31. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
  32. data/lib/selenium/webdriver/bidi/{log/base_log_entry.rb → protocol/domain.rb} +22 -11
  33. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
  34. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  35. data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
  36. data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
  37. data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
  38. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
  39. data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
  40. data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
  41. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
  42. data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
  43. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
  44. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
  45. data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
  46. data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
  47. data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
  48. data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
  49. data/lib/selenium/webdriver/bidi/session.rb +4 -0
  50. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
  51. data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
  52. data/lib/selenium/webdriver/bidi/transport.rb +57 -0
  53. data/lib/selenium/webdriver/bidi.rb +4 -1
  54. data/lib/selenium/webdriver/chrome/driver.rb +4 -3
  55. data/lib/selenium/webdriver/chrome/service.rb +13 -0
  56. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  57. data/lib/selenium/webdriver/chromium/options.rb +23 -1
  58. data/lib/selenium/webdriver/chromium/profile.rb +6 -0
  59. data/lib/selenium/webdriver/common/child_process.rb +2 -1
  60. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  61. data/lib/selenium/webdriver/common/driver.rb +13 -7
  62. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  63. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  64. data/lib/selenium/webdriver/common/driver_extensions/{has_bidi.rb → has_session_events.rb} +19 -7
  65. data/lib/selenium/webdriver/common/driver_finder.rb +35 -25
  66. data/lib/selenium/webdriver/common/error.rb +10 -3
  67. data/lib/selenium/webdriver/common/local_driver.rb +29 -12
  68. data/lib/selenium/webdriver/common/logger.rb +28 -0
  69. data/lib/selenium/webdriver/common/manager.rb +2 -0
  70. data/lib/selenium/webdriver/common/options.rb +41 -2
  71. data/lib/selenium/webdriver/common/platform.rb +1 -3
  72. data/lib/selenium/webdriver/common/proxy.rb +1 -9
  73. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  74. data/lib/selenium/webdriver/common/service.rb +4 -8
  75. data/lib/selenium/webdriver/common/service_manager.rb +36 -4
  76. data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
  77. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  78. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +1 -1
  79. data/lib/selenium/webdriver/common/wait.rb +4 -1
  80. data/lib/selenium/webdriver/common/websocket_connection.rb +73 -37
  81. data/lib/selenium/webdriver/common.rb +2 -1
  82. data/lib/selenium/webdriver/devtools/response.rb +3 -3
  83. data/lib/selenium/webdriver/devtools.rb +1 -1
  84. data/lib/selenium/webdriver/edge/driver.rb +4 -3
  85. data/lib/selenium/webdriver/edge/service.rb +14 -0
  86. data/lib/selenium/webdriver/firefox/driver.rb +4 -6
  87. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  88. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  89. data/lib/selenium/webdriver/firefox/service.rb +31 -2
  90. data/lib/selenium/webdriver/ie/driver.rb +4 -3
  91. data/lib/selenium/webdriver/ie/service.rb +10 -0
  92. data/lib/selenium/webdriver/remote/bidi_bridge.rb +44 -10
  93. data/lib/selenium/webdriver/remote/bridge.rb +20 -14
  94. data/lib/selenium/webdriver/remote/driver.rb +15 -4
  95. data/lib/selenium/webdriver/remote/features.rb +26 -1
  96. data/lib/selenium/webdriver/remote/http/common.rb +57 -12
  97. data/lib/selenium/webdriver/remote/http/curb.rb +6 -8
  98. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  99. data/lib/selenium/webdriver/safari/driver.rb +4 -3
  100. data/lib/selenium/webdriver/safari/options.rb +23 -4
  101. data/lib/selenium/webdriver/safari.rb +1 -6
  102. data/lib/selenium/webdriver/support/block_event_listener.rb +5 -1
  103. data/lib/selenium/webdriver/support/color.rb +14 -14
  104. data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -1
  105. data/lib/selenium/webdriver/support/guards/guard.rb +30 -14
  106. data/lib/selenium/webdriver/support/guards.rb +11 -4
  107. data/lib/selenium/webdriver/version.rb +1 -1
  108. data/lib/selenium/webdriver.rb +7 -2
  109. data/selenium-webdriver.gemspec +1 -1
  110. metadata +33 -11
  111. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
  112. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
  113. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
  114. data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
@@ -0,0 +1,286 @@
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-session
30
+ class Session < Domain
31
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UserPromptHandlerType
32
+ USER_PROMPT_HANDLER_TYPE = {
33
+ accept: 'accept',
34
+ dismiss: 'dismiss',
35
+ ignore: 'ignore'
36
+ }.freeze
37
+
38
+ # @api private
39
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
40
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-CapabilitiesRequest
41
+ CapabilitiesRequest = Serialization::Record.define(
42
+ always_match: {wire_key: 'alwaysMatch', required: false, ref: 'Session::CapabilityRequest'},
43
+ first_match: {wire_key: 'firstMatch', required: false, ref: 'Session::CapabilityRequest', list: true}
44
+ )
45
+
46
+ # @api private
47
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
48
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-CapabilityRequest
49
+ CapabilityRequest = Serialization::Record.define(
50
+ accept_insecure_certs: {wire_key: 'acceptInsecureCerts', required: false, primitive: 'boolean'},
51
+ browser_name: {wire_key: 'browserName', required: false, primitive: 'string'},
52
+ browser_version: {wire_key: 'browserVersion', required: false, primitive: 'string'},
53
+ platform_name: {wire_key: 'platformName', required: false, primitive: 'string'},
54
+ proxy: {wire_key: 'proxy', required: false, ref: 'Session::ProxyConfiguration'},
55
+ unhandled_prompt_behavior: {
56
+ wire_key: 'unhandledPromptBehavior',
57
+ required: false,
58
+ ref: 'Session::UserPromptHandler'
59
+ },
60
+ extensible: true
61
+ )
62
+
63
+ # @api private
64
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
65
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-ProxyConfiguration
66
+ class ProxyConfiguration < Serialization::Union
67
+ discriminator 'proxyType', {
68
+ autodetect: 'autodetect',
69
+ direct: 'direct',
70
+ manual: 'manual',
71
+ pac: 'pac',
72
+ system: 'system'
73
+ }
74
+ variants(
75
+ autodetect: 'Session::AutodetectProxyConfiguration',
76
+ direct: 'Session::DirectProxyConfiguration',
77
+ manual: 'Session::ManualProxyConfiguration',
78
+ pac: 'Session::PacProxyConfiguration',
79
+ system: 'Session::SystemProxyConfiguration'
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(**)
88
+ end
89
+
90
+ # @api private
91
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
92
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionautodetectproxyconfiguration
93
+ AutodetectProxyConfiguration = Serialization::Record.define(
94
+ proxy_type: {wire_key: 'proxyType', fixed: 'autodetect'},
95
+ extensible: true
96
+ )
97
+
98
+ # @api private
99
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
100
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessiondirectproxyconfiguration
101
+ DirectProxyConfiguration = Serialization::Record.define(
102
+ proxy_type: {wire_key: 'proxyType', fixed: 'direct'},
103
+ extensible: true
104
+ )
105
+
106
+ # @api private
107
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
108
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionmanualproxyconfiguration
109
+ ManualProxyConfiguration = Serialization::Record.define(
110
+ proxy_type: {wire_key: 'proxyType', fixed: 'manual'},
111
+ http_proxy: {wire_key: 'httpProxy', required: false, primitive: 'string'},
112
+ ssl_proxy: {wire_key: 'sslProxy', required: false, primitive: 'string'},
113
+ socks_proxy: {wire_key: 'socksProxy', primitive: 'string'},
114
+ socks_version: {wire_key: 'socksVersion', primitive: 'integer'},
115
+ no_proxy: {wire_key: 'noProxy', required: false, list: true},
116
+ extensible: 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-sessionsocksproxyconfiguration
122
+ SocksProxyConfiguration = Serialization::Record.define(
123
+ socks_proxy: {wire_key: 'socksProxy', primitive: 'string'},
124
+ socks_version: {wire_key: 'socksVersion', primitive: 'integer'}
125
+ )
126
+
127
+ # @api private
128
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
129
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionpacproxyconfiguration
130
+ PacProxyConfiguration = Serialization::Record.define(
131
+ proxy_type: {wire_key: 'proxyType', fixed: 'pac'},
132
+ proxy_autoconfig_url: {wire_key: 'proxyAutoconfigUrl', primitive: 'string'},
133
+ extensible: true
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-sessionsystemproxyconfiguration
139
+ SystemProxyConfiguration = Serialization::Record.define(
140
+ proxy_type: {wire_key: 'proxyType', fixed: 'system'},
141
+ extensible: true
142
+ )
143
+
144
+ # @api private
145
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
146
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UserPromptHandler
147
+ UserPromptHandler = Serialization::Record.define(
148
+ alert: {wire_key: 'alert', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
149
+ before_unload: {wire_key: 'beforeUnload', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
150
+ confirm: {wire_key: 'confirm', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
151
+ default: {wire_key: 'default', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
152
+ file: {wire_key: 'file', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
153
+ prompt: {wire_key: 'prompt', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'}
154
+ )
155
+
156
+ # @api private
157
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
158
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsubscribeparameters
159
+ SubscribeParameters = Serialization::Record.define(
160
+ events: {wire_key: 'events', list: true},
161
+ contexts: {wire_key: 'contexts', required: false, list: true},
162
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
163
+ )
164
+
165
+ # @api private
166
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
167
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByIDRequest
168
+ UnsubscribeByIDRequest = Serialization::Record.define(subscriptions: {wire_key: 'subscriptions', list: true})
169
+
170
+ # @api private
171
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
172
+ # @see https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByAttributesRequest
173
+ UnsubscribeByAttributesRequest = Serialization::Record.define(events: {wire_key: 'events', list: true})
174
+
175
+ # @api private
176
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
177
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionstatusresult
178
+ StatusResult = Serialization::Record.define(
179
+ ready: {wire_key: 'ready', primitive: 'boolean'},
180
+ message: {wire_key: 'message', primitive: 'string'}
181
+ )
182
+
183
+ # @api private
184
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
185
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionnewparameters
186
+ NewParameters = Serialization::Record.define(
187
+ capabilities: {wire_key: 'capabilities', ref: 'Session::CapabilitiesRequest'}
188
+ )
189
+
190
+ # @api private
191
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
192
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionnewresult
193
+ NewResult = Serialization::Record.define(
194
+ session_id: {wire_key: 'sessionId', primitive: 'string'},
195
+ capabilities: {wire_key: 'capabilities', ref: 'Session::NewResult::Capabilities'}
196
+ )
197
+
198
+ # @api private
199
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
200
+ NewResult::Capabilities = Serialization::Record.define(
201
+ accept_insecure_certs: {wire_key: 'acceptInsecureCerts', primitive: 'boolean'},
202
+ browser_name: {wire_key: 'browserName', primitive: 'string'},
203
+ browser_version: {wire_key: 'browserVersion', primitive: 'string'},
204
+ platform_name: {wire_key: 'platformName', primitive: 'string'},
205
+ set_window_rect: {wire_key: 'setWindowRect', primitive: 'boolean'},
206
+ user_agent: {wire_key: 'userAgent', primitive: 'string'},
207
+ proxy: {wire_key: 'proxy', required: false, ref: 'Session::ProxyConfiguration'},
208
+ unhandled_prompt_behavior: {
209
+ wire_key: 'unhandledPromptBehavior',
210
+ required: false,
211
+ ref: 'Session::UserPromptHandler'
212
+ },
213
+ web_socket_url: {wire_key: 'webSocketUrl', required: false, primitive: 'string'},
214
+ extensible: true
215
+ )
216
+
217
+ # @api private
218
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
219
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionsubscriberesult
220
+ SubscribeResult = Serialization::Record.define(subscription: {wire_key: 'subscription', primitive: 'string'})
221
+
222
+ # @api private
223
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
224
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-sessionunsubscribeparameters
225
+ class UnsubscribeParameters < Serialization::Union
226
+ presence(
227
+ 'Session::UnsubscribeByAttributesRequest' => ['events'],
228
+ 'Session::UnsubscribeByIDRequest' => ['subscriptions']
229
+ )
230
+ object_only
231
+ end
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
+
245
+ # @api private
246
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
247
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-end
248
+ def end_
249
+ execute(cmd: 'session.end')
250
+ end
251
+
252
+ # @api private
253
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
254
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-new
255
+ def new(capabilities:)
256
+ params = NewParameters.new(capabilities: capabilities)
257
+ execute(cmd: 'session.new', params: params, result: Session::NewResult)
258
+ end
259
+
260
+ # @api private
261
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
262
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-status
263
+ def status
264
+ execute(cmd: 'session.status', result: Session::StatusResult)
265
+ end
266
+
267
+ # @api private
268
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
269
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-subscribe
270
+ def subscribe(events:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
271
+ params = SubscribeParameters.new(events: events, contexts: contexts, user_contexts: user_contexts)
272
+ execute(cmd: 'session.subscribe', params: params, result: Session::SubscribeResult)
273
+ end
274
+
275
+ # @api private
276
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
277
+ # @see https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe
278
+ def unsubscribe(events: Serialization::UNSET, subscriptions: Serialization::UNSET)
279
+ params = UnsubscribeParameters.build(events: events, subscriptions: subscriptions)
280
+ execute(cmd: 'session.unsubscribe', params: params)
281
+ end
282
+ end # Session
283
+ end # Protocol
284
+ end # BiDi
285
+ end # WebDriver
286
+ end # Selenium
@@ -0,0 +1,58 @@
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
+ class Speculation < Domain
30
+ EVENTS = {
31
+ prefetch_status_updated: 'speculation.prefetchStatusUpdated'
32
+ }.freeze
33
+
34
+ # @see https://wicg.github.io/nav-speculation/prefetch.html#cddl-type-speculationpreloadingstatus
35
+ PRELOADING_STATUS = {
36
+ pending: 'pending',
37
+ ready: 'ready',
38
+ success: 'success',
39
+ failure: 'failure'
40
+ }.freeze
41
+
42
+ # @api private
43
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
44
+ # @see https://wicg.github.io/nav-speculation/prefetch.html#cddl-type-speculationprefetchstatusupdatedparameters
45
+ PrefetchStatusUpdatedParameters = Serialization::Record.define(
46
+ context: {wire_key: 'context', primitive: 'string'},
47
+ url: {wire_key: 'url', primitive: 'string'},
48
+ status: {wire_key: 'status', enum: 'Speculation::PRELOADING_STATUS'}
49
+ )
50
+
51
+ EVENT_TYPES = {
52
+ 'speculation.prefetchStatusUpdated' => Speculation::PrefetchStatusUpdatedParameters
53
+ }.freeze
54
+ end # Speculation
55
+ end # Protocol
56
+ end # BiDi
57
+ end # WebDriver
58
+ end # Selenium
@@ -0,0 +1,183 @@
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-storage
30
+ class Storage < Domain
31
+ # @api private
32
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
33
+ # @see https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey
34
+ PartitionKey = Serialization::Record.define(
35
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
36
+ source_origin: {wire_key: 'sourceOrigin', required: false, primitive: 'string'},
37
+ extensible: true
38
+ )
39
+
40
+ # @api private
41
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
42
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagecookiefilter
43
+ CookieFilter = Serialization::Record.define(
44
+ name: {wire_key: 'name', required: false, primitive: 'string'},
45
+ value: {wire_key: 'value', required: false, ref: 'Network::BytesValue'},
46
+ domain: {wire_key: 'domain', required: false, primitive: 'string'},
47
+ path: {wire_key: 'path', required: false, primitive: 'string'},
48
+ size: {wire_key: 'size', required: false, primitive: 'integer'},
49
+ http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
50
+ secure: {wire_key: 'secure', required: false, primitive: 'boolean'},
51
+ same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
52
+ expiry: {wire_key: 'expiry', required: false, primitive: 'integer'},
53
+ extensible: true
54
+ )
55
+
56
+ # @api private
57
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
58
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagebrowsingcontextpartitiondescriptor
59
+ BrowsingContextPartitionDescriptor = Serialization::Record.define(
60
+ type: {fixed: 'context'},
61
+ context: {wire_key: 'context', primitive: 'string'}
62
+ )
63
+
64
+ # @api private
65
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
66
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagestoragekeypartitiondescriptor
67
+ StorageKeyPartitionDescriptor = Serialization::Record.define(
68
+ type: {fixed: 'storageKey'},
69
+ user_context: {wire_key: 'userContext', required: false, primitive: 'string'},
70
+ source_origin: {wire_key: 'sourceOrigin', required: false, primitive: 'string'},
71
+ extensible: true
72
+ )
73
+
74
+ # @api private
75
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
76
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagepartitiondescriptor
77
+ class PartitionDescriptor < Serialization::Union
78
+ discriminator 'type', {context: 'context', storage_key: 'storageKey'}
79
+ variants(
80
+ context: 'Storage::BrowsingContextPartitionDescriptor',
81
+ storage_key: 'Storage::StorageKeyPartitionDescriptor'
82
+ )
83
+ object_only
84
+
85
+ def self.context(**) = Storage::BrowsingContextPartitionDescriptor.new(**)
86
+ def self.storage_key(**) = Storage::StorageKeyPartitionDescriptor.new(**)
87
+ end
88
+
89
+ # @api private
90
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
91
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagegetcookiesparameters
92
+ GetCookiesParameters = Serialization::Record.define(
93
+ filter: {wire_key: 'filter', required: false, ref: 'Storage::CookieFilter'},
94
+ partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
95
+ )
96
+
97
+ # @api private
98
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
99
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagegetcookiesresult
100
+ GetCookiesResult = Serialization::Record.define(
101
+ cookies: {wire_key: 'cookies', ref: 'Network::Cookie', list: true},
102
+ partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
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-storagepartialcookie
108
+ PartialCookie = Serialization::Record.define(
109
+ name: {wire_key: 'name', primitive: 'string'},
110
+ value: {wire_key: 'value', ref: 'Network::BytesValue'},
111
+ domain: {wire_key: 'domain', primitive: 'string'},
112
+ path: {wire_key: 'path', required: false, primitive: 'string'},
113
+ http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
114
+ secure: {wire_key: 'secure', required: false, primitive: 'boolean'},
115
+ same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
116
+ expiry: {wire_key: 'expiry', required: false, primitive: 'integer'},
117
+ extensible: true
118
+ )
119
+
120
+ # @api private
121
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
122
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagesetcookieparameters
123
+ SetCookieParameters = Serialization::Record.define(
124
+ cookie: {wire_key: 'cookie', ref: 'Storage::PartialCookie'},
125
+ partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
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-storagesetcookieresult
131
+ SetCookieResult = Serialization::Record.define(
132
+ partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
133
+ )
134
+
135
+ # @api private
136
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
137
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagedeletecookiesparameters
138
+ DeleteCookiesParameters = Serialization::Record.define(
139
+ filter: {wire_key: 'filter', required: false, ref: 'Storage::CookieFilter'},
140
+ partition: {wire_key: 'partition', required: false, ref: 'Storage::PartitionDescriptor'}
141
+ )
142
+
143
+ # @api private
144
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
145
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-storagedeletecookiesresult
146
+ DeleteCookiesResult = Serialization::Record.define(
147
+ partition_key: {wire_key: 'partitionKey', ref: 'Storage::PartitionKey'}
148
+ )
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
+
156
+ # @api private
157
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
158
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-deleteCookies
159
+ def delete_cookies(filter: Serialization::UNSET, partition: Serialization::UNSET)
160
+ params = DeleteCookiesParameters.new(filter: filter, partition: partition)
161
+ execute(cmd: 'storage.deleteCookies', params: params, result: Storage::DeleteCookiesResult)
162
+ end
163
+
164
+ # @api private
165
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
166
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-getCookies
167
+ def get_cookies(filter: Serialization::UNSET, partition: Serialization::UNSET)
168
+ params = GetCookiesParameters.new(filter: filter, partition: partition)
169
+ execute(cmd: 'storage.getCookies', params: params, result: Storage::GetCookiesResult)
170
+ end
171
+
172
+ # @api private
173
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
174
+ # @see https://w3c.github.io/webdriver-bidi/#command-storage-setCookie
175
+ def set_cookie(cookie:, partition: Serialization::UNSET)
176
+ params = SetCookieParameters.new(cookie: cookie, partition: partition)
177
+ execute(cmd: 'storage.setCookie', params: params, result: Storage::SetCookieResult)
178
+ end
179
+ end # Storage
180
+ end # Protocol
181
+ end # BiDi
182
+ end # WebDriver
183
+ end # Selenium
@@ -0,0 +1,88 @@
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
+ class UserAgentClientHints < Domain
30
+ # @api private
31
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
32
+ # @see https://wicg.github.io/ua-client-hints/#cddl-type-useragentclienthintsclienthintsmetadata
33
+ ClientHintsMetadata = Serialization::Record.define(
34
+ brands: {wire_key: 'brands', required: false, ref: 'UserAgentClientHints::BrandVersion', list: true},
35
+ full_version_list: {
36
+ wire_key: 'fullVersionList',
37
+ required: false,
38
+ ref: 'UserAgentClientHints::BrandVersion',
39
+ list: true
40
+ },
41
+ platform: {wire_key: 'platform', required: false, primitive: 'string'},
42
+ platform_version: {wire_key: 'platformVersion', required: false, primitive: 'string'},
43
+ architecture: {wire_key: 'architecture', required: false, primitive: 'string'},
44
+ model: {wire_key: 'model', required: false, primitive: 'string'},
45
+ mobile: {wire_key: 'mobile', required: false, primitive: 'boolean'},
46
+ bitness: {wire_key: 'bitness', required: false, primitive: 'string'},
47
+ wow64: {wire_key: 'wow64', required: false, primitive: 'boolean'},
48
+ form_factors: {wire_key: 'formFactors', required: false, list: true}
49
+ )
50
+
51
+ # @api private
52
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
53
+ # @see https://wicg.github.io/ua-client-hints/#cddl-type-useragentclienthintsbrandversion
54
+ BrandVersion = Serialization::Record.define(
55
+ brand: {wire_key: 'brand', primitive: 'string'},
56
+ version: {wire_key: 'version', primitive: 'string'}
57
+ )
58
+
59
+ # @api private
60
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
61
+ SetClientHintsOverrideCommandParams = Serialization::Record.define(
62
+ client_hints: {wire_key: 'clientHints', nullable: true, ref: 'UserAgentClientHints::ClientHintsMetadata'},
63
+ contexts: {wire_key: 'contexts', required: false, list: true},
64
+ user_contexts: {wire_key: 'userContexts', required: false, list: true}
65
+ )
66
+
67
+ def client_hints_metadata(**) = ClientHintsMetadata.new(**)
68
+ def brand_version(**) = BrandVersion.new(**)
69
+
70
+ # @api private
71
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
72
+ def set_client_hints_override(
73
+ client_hints:,
74
+ contexts: Serialization::UNSET,
75
+ user_contexts: Serialization::UNSET
76
+ )
77
+ params = SetClientHintsOverrideCommandParams.new(
78
+ client_hints: client_hints,
79
+ contexts: contexts,
80
+ user_contexts: user_contexts
81
+ )
82
+ execute(cmd: 'userAgentClientHints.setClientHintsOverride', params: params)
83
+ end
84
+ end # UserAgentClientHints
85
+ end # Protocol
86
+ end # BiDi
87
+ end # WebDriver
88
+ end # Selenium