selenium-webdriver 4.24.0 → 4.25.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2161a57f3d5748a982e14296e5b2c75a436e575ec55cee48cc01a30c67b59b53
4
- data.tar.gz: af9fcd5320f83492e41ab6b5f16350e828752b209028b7a4bf308aa82bc33b97
3
+ metadata.gz: 933e4204f7292ea54294b360eb588ee5ce965af527555629de203f11f6535931
4
+ data.tar.gz: fb8f77b1b744c4e3f7922e66d9e956e41f4eba67181f0aa306ae8362730c1159
5
5
  SHA512:
6
- metadata.gz: 0a7767af8bf0c7826e7c8aff74f9e860d3ca57766792cf3a030283ddaca423e999c18a1ee6eccbf32da8f21b197a95dc9bd51c0030b8635f2eb67bde48f02882
7
- data.tar.gz: 81ee8d16f4f9ffbfbde921d2d2b71cfcc189f9e3062eb2602b01f7c9de90eff3b7a6855eb114c06a78b66412164d90a7fc80a2eaf5141da1d27e7478605e104f
6
+ metadata.gz: 1c4ca19d4a8dca6fb0dc25e4ebae8aea5e3d7dd5797977b53048b5a460e1d08c65b11e335789e43d93ff64d2ac2a31c077a2631cf01041874bb0e82845509c4a
7
+ data.tar.gz: 1b3074dac91a3a612c64573218fb4accdc708dce7b78c31bfd8162575616da9c1cf9434463d45ef8d007fda7d28eee1d99d416f506a2c47e445f850e7a85a46d
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ 4.25.0 (2024-09-19)
2
+ =========================
3
+ * Add CDP for Chrome 129 and remove 126
4
+ * Fix add_cause method not being able to process an array of hashes (#14433)
5
+ * replace `fedcm` links with new ones (#14478)
6
+ * Allow driver path to be set using ENV variables (#14287)
7
+
1
8
  4.24.0 (2024-08-23)
2
9
  =========================
3
10
  * Deprecate WebStorage JS methods (#14276)
Binary file
Binary file
Binary file
@@ -24,6 +24,7 @@ module Selenium
24
24
  DEFAULT_PORT = 9515
25
25
  EXECUTABLE = 'chromedriver'
26
26
  SHUTDOWN_SUPPORTED = true
27
+ DRIVER_PATH_ENV_KEY = 'SE_CHROMEDRIVER'
27
28
 
28
29
  def log
29
30
  return @log unless @log.is_a? String
@@ -21,8 +21,8 @@ module Selenium
21
21
  module WebDriver
22
22
  module FedCM
23
23
  # Represents an account displayed in a FedCm account list.
24
- # See: https://fedidcg.github.io/FedCM/#dictdef-identityprovideraccount
25
- # https://fedidcg.github.io/FedCM/#webdriver-accountlist
24
+ # See: https://w3c-fedid.github.io/FedCM/#dictdef-identityprovideraccount
25
+ # https://w3c-fedid.github.io/FedCM/#webdriver-accountlist
26
26
  class Account
27
27
  LOGIN_STATE_SIGNIN = 'SignIn'
28
28
  LOGIN_STATE_SIGNUP = 'SignUp'
@@ -167,7 +167,7 @@ module Selenium
167
167
 
168
168
  id << :deprecations if @allowed.include?(:deprecations)
169
169
 
170
- message = +"[DEPRECATION] #{old} is deprecated"
170
+ message = "[DEPRECATION] #{old} is deprecated"
171
171
  message << if new
172
172
  ". Use #{new} instead."
173
173
  else
@@ -69,6 +69,7 @@ module Selenium
69
69
  def initialize(path: nil, port: nil, log: nil, args: nil)
70
70
  port ||= self.class::DEFAULT_PORT
71
71
  args ||= []
72
+ path ||= env_path
72
73
 
73
74
  @executable_path = path
74
75
  @host = Platform.localhost
@@ -87,16 +88,22 @@ module Selenium
87
88
  end
88
89
 
89
90
  def launch
90
- @executable_path ||= begin
91
- default_options = WebDriver.const_get("#{self.class.name&.split('::')&.[](2)}::Options").new
92
- DriverFinder.new(default_options, self).driver_path
93
- end
91
+ @executable_path ||= env_path || find_driver_path
94
92
  ServiceManager.new(self).tap(&:start)
95
93
  end
96
94
 
97
95
  def shutdown_supported
98
96
  self.class::SHUTDOWN_SUPPORTED
99
97
  end
98
+
99
+ def find_driver_path
100
+ default_options = WebDriver.const_get("#{self.class.name&.split('::')&.[](2)}::Options").new
101
+ DriverFinder.new(default_options, self).driver_path
102
+ end
103
+
104
+ def env_path
105
+ ENV.fetch(self.class::DRIVER_PATH_ENV_KEY, nil)
106
+ end
100
107
  end # Service
101
108
  end # WebDriver
102
109
  end # Selenium
@@ -96,12 +96,11 @@ module Selenium
96
96
  @bridge.switch_to_window id
97
97
 
98
98
  begin
99
- returned = yield
99
+ yield
100
100
  ensure
101
101
  current_handles = @bridge.window_handles
102
102
  original = current_handles.first unless current_handles.include? original
103
103
  @bridge.switch_to_window original
104
- returned
105
104
  end
106
105
  else
107
106
  @bridge.switch_to_window id
@@ -65,7 +65,7 @@ module Selenium
65
65
  msg = if @message
66
66
  @message.dup
67
67
  else
68
- +"timed out after #{@timeout} seconds"
68
+ "timed out after #{@timeout} seconds"
69
69
  end
70
70
 
71
71
  msg << " (#{last_error.message})" if last_error
@@ -24,7 +24,7 @@ module Selenium
24
24
  DEFAULT_PORT = 9515
25
25
  EXECUTABLE = 'msedgedriver'
26
26
  SHUTDOWN_SUPPORTED = true
27
-
27
+ DRIVER_PATH_ENV_KEY = 'SE_EDGEDRIVER'
28
28
  def log
29
29
  return @log unless @log.is_a? String
30
30
 
@@ -24,6 +24,7 @@ module Selenium
24
24
  DEFAULT_PORT = 4444
25
25
  EXECUTABLE = 'geckodriver'
26
26
  SHUTDOWN_SUPPORTED = false
27
+ DRIVER_PATH_ENV_KEY = 'SE_GECKODRIVER'
27
28
  end # Service
28
29
  end # Firefox
29
30
  end # WebDriver
@@ -24,6 +24,7 @@ module Selenium
24
24
  DEFAULT_PORT = 5555
25
25
  EXECUTABLE = 'IEDriverServer'
26
26
  SHUTDOWN_SUPPORTED = true
27
+ DRIVER_PATH_ENV_KEY = 'SE_IEDRIVER'
27
28
  end # Server
28
29
  end # IE
29
30
  end # WebDriver
@@ -58,12 +58,30 @@ module Selenium
58
58
 
59
59
  def add_cause(ex, error, backtrace)
60
60
  cause = Error::WebDriverError.new
61
+ backtrace = backtrace_from_remote(backtrace) if backtrace.is_a?(Array)
61
62
  cause.set_backtrace(backtrace)
62
63
  raise ex, cause: cause
63
64
  rescue Error.for_error(error)
64
65
  ex
65
66
  end
66
67
 
68
+ def backtrace_from_remote(server_trace)
69
+ server_trace.filter_map do |frame|
70
+ next unless frame.is_a?(Hash)
71
+
72
+ file = frame['fileName']
73
+ line = frame['lineNumber']
74
+ method = frame['methodName']
75
+
76
+ class_name = frame['className']
77
+ file = "#{class_name}(#{file})" if class_name
78
+
79
+ method = 'unknown' if method.nil? || method.empty?
80
+
81
+ "[remote server] #{file}:#{line}:in `#{method}'"
82
+ end
83
+ end
84
+
67
85
  def process_error
68
86
  return unless self['value'].is_a?(Hash)
69
87
 
@@ -24,7 +24,7 @@ module Selenium
24
24
  DEFAULT_PORT = 7050
25
25
  EXECUTABLE = 'safaridriver'
26
26
  SHUTDOWN_SUPPORTED = false
27
-
27
+ DRIVER_PATH_ENV_KEY = 'SE_SAFARIDRIVER'
28
28
  def initialize(path: nil, port: nil, log: nil, args: nil)
29
29
  raise Error::WebDriverError, 'Safari Service does not support setting log output' if log
30
30
 
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.24.0'
22
+ VERSION = '4.25.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.24.0
4
+ version: 4.25.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: 2024-08-28 00:00:00.000000000 Z
13
+ date: 2024-09-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64