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