selenium-webdriver 4.24.0 → 4.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2161a57f3d5748a982e14296e5b2c75a436e575ec55cee48cc01a30c67b59b53
4
- data.tar.gz: af9fcd5320f83492e41ab6b5f16350e828752b209028b7a4bf308aa82bc33b97
3
+ metadata.gz: 7edc3571bd28b32bf23d755dc8386057ce7ee1072b70a3a2c673b3519acf5ee4
4
+ data.tar.gz: ab849ea6ba3a5033ab1e33f2c241274cb892cdd33236e52f12ed8be7c6f2623f
5
5
  SHA512:
6
- metadata.gz: 0a7767af8bf0c7826e7c8aff74f9e860d3ca57766792cf3a030283ddaca423e999c18a1ee6eccbf32da8f21b197a95dc9bd51c0030b8635f2eb67bde48f02882
7
- data.tar.gz: 81ee8d16f4f9ffbfbde921d2d2b71cfcc189f9e3062eb2602b01f7c9de90eff3b7a6855eb114c06a78b66412164d90a7fc80a2eaf5141da1d27e7478605e104f
6
+ metadata.gz: c16d56af44cf4aea7a7988b975a8e7f23f04de2c1e81acf2593d6cc391deae93ca8501bb5523fb5b0df0781dc2e72be9667f4fd0b0bb90af52e9605959f2277b
7
+ data.tar.gz: 16f14b892bb1e9578b7ba61c6fc049e2a27ec3ae8a728fbce2b212e51a0b85b29e741866acd8db6cfcc9e97e401f0d7af3aba78dec66628fab3ba9d3547e278d
data/CHANGES CHANGED
@@ -1,3 +1,17 @@
1
+ 4.26.0 (2024-10-28)
2
+ =========================
3
+ * Add CDP for Chrome 130 and remove 127
4
+ * Add missing RBS methods (#14621)
5
+ * Update Ruby BiDi script structs to match spec
6
+ * Add RBS type support for BiDi related classes (#14611)
7
+
8
+ 4.25.0 (2024-09-19)
9
+ =========================
10
+ * Add CDP for Chrome 129 and remove 126
11
+ * Fix add_cause method not being able to process an array of hashes (#14433)
12
+ * replace `fedcm` links with new ones (#14478)
13
+ * Allow driver path to be set using ENV variables (#14287)
14
+
1
15
  4.24.0 (2024-08-23)
2
16
  =========================
3
17
  * Deprecate WebStorage JS methods (#14276)
Binary file
Binary file
Binary file
@@ -21,8 +21,8 @@ module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
23
  class LogHandler
24
- ConsoleLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :method, :args, :type)
25
- JavaScriptLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :stack_trace, :type)
24
+ ConsoleLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :stack_trace, :type, :source, :method, :args)
25
+ JavaScriptLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :stack_trace, :type, :source)
26
26
 
27
27
  def initialize(bidi)
28
28
  @bidi = bidi
@@ -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.26.0'
23
23
  end # WebDriver
24
24
  end # Selenium
metadata CHANGED
@@ -1,16 +1,16 @@
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.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
8
8
  - Titus Fortner
9
9
  - Thomas Walpole
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-08-28 00:00:00.000000000 Z
13
+ date: 2024-10-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64
@@ -466,7 +466,7 @@ metadata:
466
466
  github_repo: ssh://github.com/SeleniumHQ/selenium
467
467
  source_code_uri: https://github.com/SeleniumHQ/selenium/tree/trunk/rb
468
468
  rubygems_mfa_required: 'true'
469
- post_install_message:
469
+ post_install_message:
470
470
  rdoc_options: []
471
471
  require_paths:
472
472
  - lib
@@ -482,7 +482,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
482
  version: 1.3.1
483
483
  requirements: []
484
484
  rubygems_version: 3.2.33
485
- signing_key:
485
+ signing_key:
486
486
  specification_version: 4
487
487
  summary: Selenium is a browser automation tool for automated testing of webapps and
488
488
  more