selenium-webdriver 4.46.0 → 4.48.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +39 -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 +5940 -0
  6. data/bin/selenium-manager.cdx.json +11708 -0
  7. data/bin/windows/selenium-manager.exe +0 -0
  8. data/lib/selenium/webdriver/bidi/error.rb +48 -0
  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 +206 -33
  27. data/lib/selenium/webdriver/bidi/serialization/union.rb +50 -4
  28. data/lib/selenium/webdriver/bidi/serialization.rb +1 -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/websocket_connection.rb +64 -26
  44. data/lib/selenium/webdriver/common.rb +0 -1
  45. data/lib/selenium/webdriver/edge/service.rb +4 -1
  46. data/lib/selenium/webdriver/firefox/driver.rb +0 -3
  47. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  48. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  49. data/lib/selenium/webdriver/remote/bidi_bridge.rb +39 -12
  50. data/lib/selenium/webdriver/remote/bridge.rb +1 -1
  51. data/lib/selenium/webdriver/remote/driver.rb +3 -1
  52. data/lib/selenium/webdriver/remote/http/default.rb +1 -1
  53. data/lib/selenium/webdriver/safari/options.rb +16 -1
  54. data/lib/selenium/webdriver/support/guards/guard.rb +20 -3
  55. data/lib/selenium/webdriver/support/guards.rb +9 -3
  56. data/lib/selenium/webdriver/version.rb +1 -1
  57. metadata +6 -3
  58. data/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb +0 -36
@@ -37,7 +37,9 @@ module Selenium
37
37
 
38
38
  caps = process_options(options, capabilities)
39
39
  http_client ||= Remote::Http::Default.new(client_config: client_config)
40
- http_client.server_url = url || client_config&.server_url || "http://#{Platform.localhost}:4444/wd/hub"
40
+ server_url = url || client_config&.server_url || "http://#{Platform.localhost}:4444/wd/hub"
41
+ http_client.server_url = server_url
42
+ caps['se:remoteUrl'] = server_url.to_s.chomp('/')
41
43
  super(caps: caps, http_client: http_client, **)
42
44
  @bridge.file_detector = ->((filename, *)) { File.exist?(filename) && filename.to_s }
43
45
  command_list = @bridge.command_list
@@ -124,7 +124,7 @@ module Selenium
124
124
  end
125
125
 
126
126
  def follow_redirect(response, redirects)
127
- WebDriver.logger.debug("Redirect to #{response['Location']}; times: #{redirects}")
127
+ WebDriver.logger.debug("Redirect to #{response['Location']}; times: #{redirects}", id: :redirect)
128
128
  raise Error::WebDriverError, 'too many redirects' if redirects >= client_config.max_redirects
129
129
 
130
130
  request(:get, URI.parse(response['Location']), DEFAULT_HEADERS.dup, nil, redirects + 1)
@@ -25,7 +25,8 @@ module Selenium
25
25
 
26
26
  # @see https://developer.apple.com/documentation/webkit/about_webdriver_for_safari
27
27
  CAPABILITIES = {automatic_inspection: 'safari:automaticInspection',
28
- automatic_profiling: 'safari:automaticProfiling'}.freeze
28
+ automatic_profiling: 'safari:automaticProfiling',
29
+ experimental_web_socket_url: 'safari:experimentalWebSocketUrl'}.freeze
29
30
  BROWSER = 'safari'
30
31
  TECHNOLOGY_PREVIEW = 'Safari Technology Preview'
31
32
 
@@ -43,6 +44,20 @@ module Selenium
43
44
  def browser_name
44
45
  @options[:browser_name] = Safari.technology_preview? ? TECHNOLOGY_PREVIEW : BROWSER
45
46
  end
47
+
48
+ #
49
+ # Enables WebDriver BiDi for Safari, which also requires the experimental capability, and
50
+ # warns that Safari's BiDi support is experimental.
51
+ #
52
+ # @return [Boolean]
53
+ #
54
+
55
+ def enable_bidi!
56
+ super
57
+ WebDriver.logger.warn("Safari's WebDriver BiDi support is experimental and may be incomplete",
58
+ id: :safari_bidi)
59
+ @options[:experimental_web_socket_url] = true
60
+ end
46
61
  end # Options
47
62
  end # Safari
48
63
  end # WebDriver
@@ -30,7 +30,7 @@ module Selenium
30
30
  attr_reader :guarded, :type, :messages, :reason, :tracker
31
31
 
32
32
  def initialize(guarded, type, guards = nil)
33
- @guarded = guarded
33
+ @guarded = guarded.dup
34
34
  @tracker = guards&.bug_tracker || ''
35
35
  @messages = guards&.messages || {}
36
36
  @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report'
@@ -47,7 +47,7 @@ module Selenium
47
47
  when Symbol
48
48
  messages[reason]
49
49
  else
50
- "Guarded by #{guarded};"
50
+ "#{type.to_s.tr('_', ' ')} #{guarded};"
51
51
  end
52
52
 
53
53
  case type
@@ -57,8 +57,10 @@ module Selenium
57
57
  "Test skipped because it is unreliable in this configuration; #{details}"
58
58
  when :skip_unless, :exclusive
59
59
  "Test does not apply to this configuration; #{details}"
60
- else
60
+ when :pending_if, :pending_unless, :except, :only
61
61
  "Test guarded; #{details}"
62
+ else
63
+ raise ArgumentError, "unknown guard type: #{type}"
62
64
  end
63
65
  end
64
66
 
@@ -81,6 +83,21 @@ module Selenium
81
83
  def exclusive?
82
84
  @type == :skip_unless || @type == :exclusive
83
85
  end
86
+
87
+ # A pending guard that only applies when the failure matches an expected exception.
88
+ def exception?
89
+ (except? || only?) && !@guarded[:exception].nil?
90
+ end
91
+
92
+ # Whether the exception is the guard's `exception:` class and matches its optional `message:`
93
+ # (Regexp pattern or exact String), following RSpec's `raise_error` semantics.
94
+ def matches_exception?(exception)
95
+ spec = @guarded[:exception]
96
+ return false unless spec && exception.is_a?(spec[:class])
97
+
98
+ message = spec[:message]
99
+ message.nil? || (message.is_a?(Regexp) ? message.match?(exception.message) : message == exception.message)
100
+ end
84
101
  end # Guard
85
102
  end # Guards
86
103
  end # Support
@@ -41,7 +41,7 @@ module Selenium
41
41
  def add_condition(name, condition = false, &block)
42
42
  condition = false if condition.nil?
43
43
  @guard_conditions << GuardCondition.new(name, condition, &block)
44
- WebDriver.logger.debug "Running with Guard '#{name}' set to: #{condition}"
44
+ WebDriver.logger.debug "Running with Guard '#{name}' set to: #{condition}", id: :guard
45
45
  end
46
46
 
47
47
  def add_message(name, message)
@@ -52,12 +52,18 @@ module Selenium
52
52
  if !skipping_guard.nil?
53
53
  [:skip, skipping_guard.message]
54
54
  elsif !pending_guard.nil? && ENV.fetch('SKIP_PENDING', nil)
55
- [:skip, pending_guard.message]
56
- elsif !pending_guard.nil?
55
+ [:skip, "(skipped by SKIP_PENDING) #{pending_guard.message}"]
56
+ elsif !pending_guard.nil? && !pending_guard.exception?
57
57
  [:pending, pending_guard.message]
58
58
  end
59
59
  end
60
60
 
61
+ # The deferred `exception:` pending guard, evaluated against the failure after the run, else nil.
62
+ def pending_exception_guard
63
+ guard = pending_guard
64
+ guard if disposition.nil? && guard&.exception?
65
+ end
66
+
61
67
  def satisfied?(guard)
62
68
  @guard_conditions.all? { |condition| condition.satisfied?(guard) }
63
69
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.46.0'
22
+ VERSION = '4.48.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.46.0
4
+ version: 4.48.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-07-11 00:00:00.000000000 Z
13
+ date: 2026-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64
@@ -273,6 +273,8 @@ files:
273
273
  - README.md
274
274
  - bin/linux/selenium-manager
275
275
  - bin/macos/selenium-manager
276
+ - bin/selenium-manager-THIRD-PARTY-NOTICES.txt
277
+ - bin/selenium-manager.cdx.json
276
278
  - bin/windows/selenium-manager.exe
277
279
  - lib/selenium-webdriver.rb
278
280
  - lib/selenium/server.rb
@@ -285,6 +287,7 @@ files:
285
287
  - lib/selenium/webdriver/bidi.rb
286
288
  - lib/selenium/webdriver/bidi/browser.rb
287
289
  - lib/selenium/webdriver/bidi/browsing_context.rb
290
+ - lib/selenium/webdriver/bidi/error.rb
288
291
  - lib/selenium/webdriver/bidi/log_handler.rb
289
292
  - lib/selenium/webdriver/bidi/network.rb
290
293
  - lib/selenium/webdriver/bidi/network/cookies.rb
@@ -301,6 +304,7 @@ files:
301
304
  - lib/selenium/webdriver/bidi/protocol/browsing_context.rb
302
305
  - lib/selenium/webdriver/bidi/protocol/domain.rb
303
306
  - lib/selenium/webdriver/bidi/protocol/emulation.rb
307
+ - lib/selenium/webdriver/bidi/protocol/error_code.rb
304
308
  - lib/selenium/webdriver/bidi/protocol/input.rb
305
309
  - lib/selenium/webdriver/bidi/protocol/log.rb
306
310
  - lib/selenium/webdriver/bidi/protocol/network.rb
@@ -341,7 +345,6 @@ files:
341
345
  - lib/selenium/webdriver/common/driver_extensions/has_addons.rb
342
346
  - lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb
343
347
  - lib/selenium/webdriver/common/driver_extensions/has_authentication.rb
344
- - lib/selenium/webdriver/common/driver_extensions/has_bidi.rb
345
348
  - lib/selenium/webdriver/common/driver_extensions/has_casting.rb
346
349
  - lib/selenium/webdriver/common/driver_extensions/has_cdp.rb
347
350
  - lib/selenium/webdriver/common/driver_extensions/has_context.rb
@@ -1,36 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- module DriverExtensions
23
- module HasBiDi
24
- #
25
- # Retrieves WebDriver BiDi connection.
26
- #
27
- # @return [BiDi]
28
- #
29
-
30
- def bidi
31
- @bridge.bidi
32
- end
33
- end # HasBiDi
34
- end # DriverExtensions
35
- end # WebDriver
36
- end # Selenium