selenium-webdriver 4.48.0 → 4.49.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.
Binary file
@@ -209,7 +209,8 @@ module Selenium
209
209
  context: {wire_key: 'context', primitive: 'string'},
210
210
  origin: {wire_key: 'origin', required: false, enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'},
211
211
  format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
212
- clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'}
212
+ clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'},
213
+ image_size: {wire_key: 'imageSize', required: false, ref: 'BrowsingContext::ImageSize'}
213
214
  )
214
215
 
215
216
  # @api private
@@ -220,6 +221,14 @@ module Selenium
220
221
  quality: {wire_key: 'quality', required: false, primitive: 'number'}
221
222
  )
222
223
 
224
+ # @api private
225
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
226
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimagesize
227
+ ImageSize = Serialization::Record.define(
228
+ max_width: {wire_key: 'maxWidth', required: false, primitive: 'integer'},
229
+ max_height: {wire_key: 'maxHeight', required: false, primitive: 'integer'}
230
+ )
231
+
223
232
  # @api private
224
233
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
234
  # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcliprectangle
@@ -585,6 +594,7 @@ module Selenium
585
594
  def inner_text_locator(**) = InnerTextLocator.new(**)
586
595
  def x_path_locator(**) = XPathLocator.new(**)
587
596
  def image_format(**) = ImageFormat.new(**)
597
+ def image_size(**) = ImageSize.new(**)
588
598
  def clip_rectangle = ClipRectangle
589
599
  def element_clip_rectangle(**) = ElementClipRectangle.new(**)
590
600
  def box_clip_rectangle(**) = BoxClipRectangle.new(**)
@@ -610,10 +620,17 @@ module Selenium
610
620
  context:,
611
621
  origin: Serialization::UNSET,
612
622
  format: Serialization::UNSET,
613
- clip: Serialization::UNSET
623
+ clip: Serialization::UNSET,
624
+ image_size: Serialization::UNSET
614
625
  )
615
626
  Serialization.validate!('origin', origin, BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN)
616
- params = CaptureScreenshotParameters.new(context: context, origin: origin, format: format, clip: clip)
627
+ params = CaptureScreenshotParameters.new(
628
+ context: context,
629
+ origin: origin,
630
+ format: format,
631
+ clip: clip,
632
+ image_size: image_size
633
+ )
617
634
  execute(
618
635
  cmd: 'browsingContext.captureScreenshot',
619
636
  params: params,
@@ -48,6 +48,140 @@ module Selenium
48
48
  landscape_secondary: 'landscape-secondary'
49
49
  }.freeze
50
50
 
51
+ MEDIA_FEATURES_ANY_HOVER = {
52
+ none: 'none',
53
+ hover: 'hover'
54
+ }.freeze
55
+
56
+ MEDIA_FEATURES_ANY_POINTER = {
57
+ none: 'none',
58
+ coarse: 'coarse',
59
+ fine: 'fine'
60
+ }.freeze
61
+
62
+ MEDIA_FEATURES_COLOR_GAMUT = {
63
+ srgb: 'srgb',
64
+ p3: 'p3',
65
+ rec2020: 'rec2020'
66
+ }.freeze
67
+
68
+ MEDIA_FEATURES_DISPLAY_MODE = {
69
+ fullscreen: 'fullscreen',
70
+ standalone: 'standalone',
71
+ minimal_ui: 'minimal-ui',
72
+ browser: 'browser',
73
+ picture_in_picture: 'picture-in-picture'
74
+ }.freeze
75
+
76
+ MEDIA_FEATURES_DYNAMIC_RANGE = {
77
+ standard: 'standard',
78
+ high: 'high'
79
+ }.freeze
80
+
81
+ MEDIA_FEATURES_ENVIRONMENT_BLENDING = {
82
+ opaque: 'opaque',
83
+ additive: 'additive',
84
+ subtractive: 'subtractive'
85
+ }.freeze
86
+
87
+ MEDIA_FEATURES_FORCED_COLORS = {
88
+ none: 'none',
89
+ active: 'active'
90
+ }.freeze
91
+
92
+ MEDIA_FEATURES_GRID = {
93
+ _0: 0,
94
+ _1: 1
95
+ }.freeze
96
+
97
+ MEDIA_FEATURES_HOVER = {
98
+ none: 'none',
99
+ hover: 'hover'
100
+ }.freeze
101
+
102
+ MEDIA_FEATURES_INVERTED_COLORS = {
103
+ none: 'none',
104
+ inverted: 'inverted'
105
+ }.freeze
106
+
107
+ MEDIA_FEATURES_NAV_CONTROLS = {
108
+ none: 'none',
109
+ back: 'back'
110
+ }.freeze
111
+
112
+ MEDIA_FEATURES_OVERFLOW_BLOCK = {
113
+ none: 'none',
114
+ scroll: 'scroll',
115
+ optional_paged: 'optional-paged',
116
+ paged: 'paged'
117
+ }.freeze
118
+
119
+ MEDIA_FEATURES_OVERFLOW_INLINE = {
120
+ none: 'none',
121
+ scroll: 'scroll'
122
+ }.freeze
123
+
124
+ MEDIA_FEATURES_POINTER = {
125
+ none: 'none',
126
+ coarse: 'coarse',
127
+ fine: 'fine'
128
+ }.freeze
129
+
130
+ MEDIA_FEATURES_PREFERS_COLOR_SCHEME = {
131
+ light: 'light',
132
+ dark: 'dark'
133
+ }.freeze
134
+
135
+ MEDIA_FEATURES_PREFERS_CONTRAST = {
136
+ no_preference: 'no-preference',
137
+ more: 'more',
138
+ less: 'less',
139
+ custom: 'custom'
140
+ }.freeze
141
+
142
+ MEDIA_FEATURES_PREFERS_REDUCED_DATA = {
143
+ no_preference: 'no-preference',
144
+ reduce: 'reduce'
145
+ }.freeze
146
+
147
+ MEDIA_FEATURES_PREFERS_REDUCED_MOTION = {
148
+ no_preference: 'no-preference',
149
+ reduce: 'reduce'
150
+ }.freeze
151
+
152
+ MEDIA_FEATURES_PREFERS_REDUCED_TRANSPARENCY = {
153
+ no_preference: 'no-preference',
154
+ reduce: 'reduce'
155
+ }.freeze
156
+
157
+ MEDIA_FEATURES_SCAN = {
158
+ interlace: 'interlace',
159
+ progressive: 'progressive'
160
+ }.freeze
161
+
162
+ MEDIA_FEATURES_SCRIPTING = {
163
+ none: 'none',
164
+ initial_only: 'initial-only',
165
+ enabled: 'enabled'
166
+ }.freeze
167
+
168
+ MEDIA_FEATURES_UPDATE = {
169
+ none: 'none',
170
+ slow: 'slow',
171
+ fast: 'fast'
172
+ }.freeze
173
+
174
+ MEDIA_FEATURES_VIDEO_COLOR_GAMUT = {
175
+ srgb: 'srgb',
176
+ p3: 'p3',
177
+ rec2020: 'rec2020'
178
+ }.freeze
179
+
180
+ MEDIA_FEATURES_VIDEO_DYNAMIC_RANGE = {
181
+ standard: 'standard',
182
+ high: 'high'
183
+ }.freeze
184
+
51
185
  SET_SCROLLBAR_TYPE_OVERRIDE_PARAMETERS_SCROLLBAR_TYPE = {
52
186
  classic: 'classic',
53
187
  overlay: 'overlay'
@@ -120,17 +254,149 @@ module Selenium
120
254
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
121
255
  # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationsetmediafeaturesoverrideparameters
122
256
  SetMediaFeaturesOverrideParameters = Serialization::Record.define(
123
- features: {wire_key: 'features', nullable: true, ref: 'Emulation::MediaFeature', list: true},
257
+ features: {wire_key: 'features', nullable: true, ref: 'Emulation::MediaFeatures'},
124
258
  contexts: {wire_key: 'contexts', required: false, list: true},
125
259
  user_contexts: {wire_key: 'userContexts', required: false, list: true}
126
260
  )
127
261
 
128
262
  # @api private
129
263
  # @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'}
264
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-emulationmediafeatures
265
+ MediaFeatures = Serialization::Record.define(
266
+ any_hover: {
267
+ wire_key: 'any-hover',
268
+ required: false,
269
+ nullable: true,
270
+ enum: 'Emulation::MEDIA_FEATURES_ANY_HOVER'
271
+ },
272
+ any_pointer: {
273
+ wire_key: 'any-pointer',
274
+ required: false,
275
+ nullable: true,
276
+ enum: 'Emulation::MEDIA_FEATURES_ANY_POINTER'
277
+ },
278
+ color: {wire_key: 'color', required: false, nullable: true, primitive: 'integer'},
279
+ color_gamut: {
280
+ wire_key: 'color-gamut',
281
+ required: false,
282
+ nullable: true,
283
+ enum: 'Emulation::MEDIA_FEATURES_COLOR_GAMUT'
284
+ },
285
+ color_index: {wire_key: 'color-index', required: false, nullable: true, primitive: 'integer'},
286
+ display_mode: {
287
+ wire_key: 'display-mode',
288
+ required: false,
289
+ nullable: true,
290
+ enum: 'Emulation::MEDIA_FEATURES_DISPLAY_MODE'
291
+ },
292
+ dynamic_range: {
293
+ wire_key: 'dynamic-range',
294
+ required: false,
295
+ nullable: true,
296
+ enum: 'Emulation::MEDIA_FEATURES_DYNAMIC_RANGE'
297
+ },
298
+ environment_blending: {
299
+ wire_key: 'environment-blending',
300
+ required: false,
301
+ nullable: true,
302
+ enum: 'Emulation::MEDIA_FEATURES_ENVIRONMENT_BLENDING'
303
+ },
304
+ forced_colors: {
305
+ wire_key: 'forced-colors',
306
+ required: false,
307
+ nullable: true,
308
+ enum: 'Emulation::MEDIA_FEATURES_FORCED_COLORS'
309
+ },
310
+ grid: {wire_key: 'grid', required: false, nullable: true, enum: 'Emulation::MEDIA_FEATURES_GRID'},
311
+ horizontal_viewport_segments: {
312
+ wire_key: 'horizontal-viewport-segments',
313
+ required: false,
314
+ nullable: true,
315
+ primitive: 'integer'
316
+ },
317
+ hover: {wire_key: 'hover', required: false, nullable: true, enum: 'Emulation::MEDIA_FEATURES_HOVER'},
318
+ inverted_colors: {
319
+ wire_key: 'inverted-colors',
320
+ required: false,
321
+ nullable: true,
322
+ enum: 'Emulation::MEDIA_FEATURES_INVERTED_COLORS'
323
+ },
324
+ monochrome: {wire_key: 'monochrome', required: false, nullable: true, primitive: 'integer'},
325
+ nav_controls: {
326
+ wire_key: 'nav-controls',
327
+ required: false,
328
+ nullable: true,
329
+ enum: 'Emulation::MEDIA_FEATURES_NAV_CONTROLS'
330
+ },
331
+ overflow_block: {
332
+ wire_key: 'overflow-block',
333
+ required: false,
334
+ nullable: true,
335
+ enum: 'Emulation::MEDIA_FEATURES_OVERFLOW_BLOCK'
336
+ },
337
+ overflow_inline: {
338
+ wire_key: 'overflow-inline',
339
+ required: false,
340
+ nullable: true,
341
+ enum: 'Emulation::MEDIA_FEATURES_OVERFLOW_INLINE'
342
+ },
343
+ pointer: {wire_key: 'pointer', required: false, nullable: true, enum: 'Emulation::MEDIA_FEATURES_POINTER'},
344
+ prefers_color_scheme: {
345
+ wire_key: 'prefers-color-scheme',
346
+ required: false,
347
+ nullable: true,
348
+ enum: 'Emulation::MEDIA_FEATURES_PREFERS_COLOR_SCHEME'
349
+ },
350
+ prefers_contrast: {
351
+ wire_key: 'prefers-contrast',
352
+ required: false,
353
+ nullable: true,
354
+ enum: 'Emulation::MEDIA_FEATURES_PREFERS_CONTRAST'
355
+ },
356
+ prefers_reduced_data: {
357
+ wire_key: 'prefers-reduced-data',
358
+ required: false,
359
+ nullable: true,
360
+ enum: 'Emulation::MEDIA_FEATURES_PREFERS_REDUCED_DATA'
361
+ },
362
+ prefers_reduced_motion: {
363
+ wire_key: 'prefers-reduced-motion',
364
+ required: false,
365
+ nullable: true,
366
+ enum: 'Emulation::MEDIA_FEATURES_PREFERS_REDUCED_MOTION'
367
+ },
368
+ prefers_reduced_transparency: {
369
+ wire_key: 'prefers-reduced-transparency',
370
+ required: false,
371
+ nullable: true,
372
+ enum: 'Emulation::MEDIA_FEATURES_PREFERS_REDUCED_TRANSPARENCY'
373
+ },
374
+ scan: {wire_key: 'scan', required: false, nullable: true, enum: 'Emulation::MEDIA_FEATURES_SCAN'},
375
+ scripting: {
376
+ wire_key: 'scripting',
377
+ required: false,
378
+ nullable: true,
379
+ enum: 'Emulation::MEDIA_FEATURES_SCRIPTING'
380
+ },
381
+ update: {wire_key: 'update', required: false, nullable: true, enum: 'Emulation::MEDIA_FEATURES_UPDATE'},
382
+ vertical_viewport_segments: {
383
+ wire_key: 'vertical-viewport-segments',
384
+ required: false,
385
+ nullable: true,
386
+ primitive: 'integer'
387
+ },
388
+ video_color_gamut: {
389
+ wire_key: 'video-color-gamut',
390
+ required: false,
391
+ nullable: true,
392
+ enum: 'Emulation::MEDIA_FEATURES_VIDEO_COLOR_GAMUT'
393
+ },
394
+ video_dynamic_range: {
395
+ wire_key: 'video-dynamic-range',
396
+ required: false,
397
+ nullable: true,
398
+ enum: 'Emulation::MEDIA_FEATURES_VIDEO_DYNAMIC_RANGE'
399
+ }
134
400
  )
135
401
 
136
402
  # @api private
@@ -245,7 +511,7 @@ module Selenium
245
511
 
246
512
  def geolocation_coordinates(**) = GeolocationCoordinates.new(**)
247
513
  def geolocation_position_error(**) = GeolocationPositionError.new(**)
248
- def media_feature(**) = MediaFeature.new(**)
514
+ def media_features(**) = MediaFeatures.new(**)
249
515
  def network_conditions_offline(**) = NetworkConditionsOffline.new(**)
250
516
  def screen_area(**) = ScreenArea.new(**)
251
517
  def screen_orientation(**) = ScreenOrientation.new(**)
@@ -137,14 +137,16 @@ module BiDiGenerate
137
137
  # snake_case hash key for an enum value (only a label for the wire value it maps to).
138
138
  # Preserves camelCase word boundaries (beforeRequestSent → before_request_sent), maps a
139
139
  # leading minus to "neg" (-0 → neg0, -Infinity → neg_infinity; no underscore before a
140
- # digit, so the key stays normalcase), and collapses other punctuation
141
- # (dedicated-worker → dedicated_worker).
140
+ # digit, so the key stays normalcase), collapses other punctuation
141
+ # (dedicated-worker → dedicated_worker), and prefixes a numeric value so the key
142
+ # is still a valid symbol (0 → _0).
142
143
  def self.enum_key(value)
143
- camel_to_snake(value.to_s)
144
- .sub(/\A-(?=\d)/, 'neg')
145
- .sub(/\A-/, 'neg_')
146
- .gsub(/[^a-z0-9]+/, '_')
147
- .gsub(/\A_+|_+\z/, '')
144
+ token = camel_to_snake(value.to_s)
145
+ .sub(/\A-(?=\d)/, 'neg')
146
+ .sub(/\A-/, 'neg_')
147
+ .gsub(/[^a-z0-9]+/, '_')
148
+ .gsub(/\A_+|_+\z/, '')
149
+ token.empty? || token.match?(/\A\d/) ? "_#{token}" : token
148
150
  end
149
151
 
150
152
  # ruby_name is the snake_case keyword argument; wire_name is the exact key the
@@ -308,9 +310,16 @@ module BiDiGenerate
308
310
  def type_entry = "'#{wire_name}' => #{payload_ref || 'nil'}"
309
311
  end
310
312
 
311
- # constant_name is the SCREAMING_SNAKE hash name; pairs are [symbol_key, wire_value] tuples.
312
- # spec_href links to the type's definition in the live spec (nil when the schema has none).
313
- Enum = Struct.new(:constant_name, :pairs, :spec_href, keyword_init: true)
313
+ # The RBS type a schema value primitive maps to; an unrecognized one is untyped.
314
+ RBS_VALUE_TYPES = {'string' => 'String', 'integer' => 'Integer', 'number' => 'Float',
315
+ 'boolean' => 'bool'}.freeze
316
+
317
+ # constant_name is the SCREAMING_SNAKE hash name; pairs are [symbol_key, wire_value] tuples;
318
+ # primitive is the schema's declared value type. spec_href links to the type's definition in
319
+ # the live spec (nil when the schema has none).
320
+ Enum = Struct.new(:constant_name, :pairs, :primitive, :spec_href, keyword_init: true) do
321
+ def rbs_value_type = RBS_VALUE_TYPES.fetch(primitive, 'untyped')
322
+ end
314
323
 
315
324
  # The generated Protocol::ErrorCode module (filename 'error_code'): `codes` is the [wire, class_name]
316
325
  # pairs in schema order (the full map); `new_classes` is the subset of class names the classic
@@ -694,9 +703,9 @@ module BiDiGenerate
694
703
  next unless type['kind'] == 'enum'
695
704
  next unless name.start_with?("#{domain}.")
696
705
 
697
- pairs = type['values'].map { |v| [BiDiGenerate.enum_key(v), v.to_s] }
706
+ pairs = type['values'].map { |v| [BiDiGenerate.enum_key(v), v] }
698
707
  Enum.new(constant_name: BiDiGenerate.screaming_snake(name.sub("#{domain}.", '')), pairs: pairs,
699
- spec_href: type['specHref'])
708
+ primitive: type['primitive'], spec_href: type['specHref'])
700
709
  end
701
710
  end
702
711
 
@@ -77,16 +77,20 @@ module Selenium
77
77
  elsif Platform.mac?
78
78
  "#{directory}/macos/selenium-manager"
79
79
  elsif Platform.linux?
80
- "#{directory}/linux/selenium-manager"
80
+ "#{directory}/#{linux_directory}/selenium-manager"
81
81
  elsif Platform.unix?
82
82
  WebDriver.logger.warn('Selenium Manager binary may not be compatible with Unix',
83
83
  id: %i[selenium_manager unix_binary])
84
- "#{directory}/linux/selenium-manager"
84
+ "#{directory}/#{linux_directory}/selenium-manager"
85
85
  else
86
86
  raise Error::WebDriverError, "unsupported platform: #{Platform.os}"
87
87
  end
88
88
  end
89
89
 
90
+ def linux_directory
91
+ RbConfig::CONFIG['host_cpu'].to_s.downcase == 'aarch64' ? 'linux-arm64' : 'linux-x86_64'
92
+ end
93
+
90
94
  def execute_command(*command)
91
95
  WebDriver.logger.debug("Executing Process #{command}", id: :selenium_manager)
92
96
 
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.48.0'
22
+ VERSION = '4.49.0'
23
23
  end # WebDriver
24
24
  end # Selenium
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.48.0
4
+ version: 4.49.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-08-27 00:00:00.000000000 Z
13
+ date: 2026-09-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64
@@ -271,7 +271,8 @@ files:
271
271
  - LICENSE
272
272
  - NOTICE
273
273
  - README.md
274
- - bin/linux/selenium-manager
274
+ - bin/linux-arm64/selenium-manager
275
+ - bin/linux-x86_64/selenium-manager
275
276
  - bin/macos/selenium-manager
276
277
  - bin/selenium-manager-THIRD-PARTY-NOTICES.txt
277
278
  - bin/selenium-manager.cdx.json