Skip to content

Commit d58e611

Browse files
authored
Merge branch 'SeleniumHQ:trunk' into py-remove-global-timeout-env
2 parents aeedba1 + 479d197 commit d58e611

File tree

3 files changed

+73
-34
lines changed

3 files changed

+73
-34
lines changed

common/repositories.bzl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/b405fb02-0c71-4762-be7f-08a88b17c176/MicrosoftEdge-135.0.3179.85.pkg",
127-
sha256 = "292b4794bc9452908d67971e04f5184c167316b2e0fcead3f5739c3738a358b6",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/784d0da7-3b50-4888-8a30-159d8af03e55/MicrosoftEdge-135.0.3179.98.pkg",
127+
sha256 = "fda91427e9172b704228f01a35f9a426479e9f5f592f6ff2de85e75ade0b25c8",
128128
move = {
129-
"MicrosoftEdge-135.0.3179.85.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-135.0.3179.98.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_135.0.3179.85-1_amd64.deb",
147-
sha256 = "c756292acbe3d89c75fd5135dde13f68292ff9beeb18e428e3171162ed864060",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_135.0.3179.98-1_amd64.deb",
147+
sha256 = "0291339ce51e66b2987f6e5fc76c310b9a5c54c0d05c3f70b3cdda2743f6774e",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/135.0.3179.85/edgedriver_linux64.zip",
169-
sha256 = "d05ef36fc3c6fdc4bc0b0c96a9fffc0ce0afd2289f08dfe2cd141d41e8dea195",
168+
url = "https://msedgedriver.azureedge.net/135.0.3179.98/edgedriver_linux64.zip",
169+
sha256 = "ea89d43034f86c70f37b9f580cd7bc5f18cb9537697af55e113b94c9dc766336",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.azureedge.net/135.0.3179.85/edgedriver_mac64.zip",
186-
sha256 = "9f9c59099b664c9c4a8f59d501e9fcf0dec3e4bfd860635669730a6e59d55ca9",
185+
url = "https://msedgedriver.azureedge.net/135.0.3179.98/edgedriver_mac64.zip",
186+
sha256 = "5b8b5e019e432b86e49a4e1d8f3a312373a0c7ad88b84ae2419419d100f99fdb",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.97/linux64/chrome-linux64.zip",
203-
sha256 = "dca0a86931162c85fbd054cc037519fcf855dca912c7fd2dc2e2e48fb7d59961",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.114/linux64/chrome-linux64.zip",
203+
sha256 = "dd86dbac5d1a362bf9d46818e21e4afe2e8b1b419e0810573d298842eef88b82",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -221,8 +221,8 @@ js_library(
221221

222222
http_archive(
223223
name = "mac_chrome",
224-
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.97/mac-x64/chrome-mac-x64.zip",
225-
sha256 = "53880ac98a04490c647d1a5649eb0ebd8001741bb17501df34908e8826fe516f",
224+
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.114/mac-x64/chrome-mac-x64.zip",
225+
sha256 = "e7deb29034368567bab7f5b24a7c09d329ef2023f61e6ed349b714abb80292c2",
226226
strip_prefix = "chrome-mac-x64",
227227
patch_cmds = [
228228
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -243,8 +243,8 @@ js_library(
243243

244244
http_archive(
245245
name = "linux_chromedriver",
246-
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.97/linux64/chromedriver-linux64.zip",
247-
sha256 = "12a0e6e8035b3671a7a884e33949f1f5154d2d2ca68593715851f6f3a5e836ec",
246+
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.114/linux64/chromedriver-linux64.zip",
247+
sha256 = "28ef94323503f927f8fca4650d5acf6325e69829720900cc696c3d8179ce855c",
248248
strip_prefix = "chromedriver-linux64",
249249
build_file_content = """
250250
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +261,8 @@ js_library(
261261

262262
http_archive(
263263
name = "mac_chromedriver",
264-
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.97/mac-x64/chromedriver-mac-x64.zip",
265-
sha256 = "2eedf6406ca4e9f11a4c196ce56e8d25c15dc68bd8ea07c7da8423d2327e9aa1",
264+
url = "https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.114/mac-x64/chromedriver-mac-x64.zip",
265+
sha256 = "a1da3421971762c4d6f258fb8e49dfd3aa855387f0b82d0333a59e972feb21d9",
266266
strip_prefix = "chromedriver-mac-x64",
267267
build_file_content = """
268268
load("@aspect_rules_js//js:defs.bzl", "js_library")

rb/lib/selenium/webdriver/common/selenium_manager.rb

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,12 @@ def binary
6161
end
6262

6363
def run(*command)
64-
WebDriver.logger.debug("Executing Process #{command}", id: :selenium_manager)
65-
66-
begin
67-
stdout, stderr, status = Open3.capture3(*command)
68-
rescue StandardError => e
69-
raise Error::WebDriverError, "Unsuccessful command executed: #{command}; #{e.message}"
70-
end
64+
stdout, stderr, status = execute_command(*command)
65+
result = parse_result_and_log(stdout)
7166

72-
json_output = stdout.empty? ? {'logs' => [], 'result' => {}} : JSON.parse(stdout)
73-
json_output['logs'].each do |log|
74-
level = log['level'].casecmp('info').zero? ? 'debug' : log['level'].downcase
75-
WebDriver.logger.send(level, log['message'], id: :selenium_manager)
76-
end
67+
validate_command_result(command, status, result, stderr)
7768

78-
result = json_output['result']
79-
return result unless status.exitstatus.positive? || result.nil?
80-
81-
raise Error::WebDriverError,
82-
"Unsuccessful command executed: #{command} - Code #{status.exitstatus}\n#{result}\n#{stderr}"
69+
result
8370
end
8471

8572
def platform_location
@@ -98,6 +85,38 @@ def platform_location
9885
raise Error::WebDriverError, "unsupported platform: #{Platform.os}"
9986
end
10087
end
88+
89+
def execute_command(*command)
90+
WebDriver.logger.debug("Executing Process #{command}", id: :selenium_manager)
91+
92+
Open3.capture3(*command)
93+
rescue StandardError => e
94+
raise Error::WebDriverError, "Unsuccessful command executed: #{command}; #{e.message}"
95+
end
96+
97+
def parse_result_and_log(stdout)
98+
json_output = stdout.empty? ? {'logs' => [], 'result' => {}} : JSON.parse(stdout)
99+
100+
json_output['logs'].each do |log|
101+
level = log['level'].casecmp('info').zero? ? 'debug' : log['level'].downcase
102+
WebDriver.logger.send(level, log['message'], id: :selenium_manager)
103+
end
104+
105+
json_output['result']
106+
end
107+
108+
def validate_command_result(command, status, result, stderr)
109+
if status.nil? || status.exitstatus.nil?
110+
WebDriver.logger.info("No exit status for: #{command}. Assuming success if result is present.",
111+
id: :selenium_manager)
112+
end
113+
114+
return unless status&.exitstatus&.positive? || result.nil?
115+
116+
code = status&.exitstatus || 'exit status not available'
117+
raise Error::WebDriverError,
118+
"Unsuccessful command executed: #{command} - Code #{code}\n#{result}\n#{stderr}"
119+
end
101120
end
102121
end # SeleniumManager
103122
end # WebDriver

rb/spec/unit/selenium/webdriver/common/selenium_manager_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,26 @@ module WebDriver
9292
described_class.send(:run, 'anything')
9393
}.to raise_error(Error::WebDriverError, msg)
9494
end
95+
96+
it 'succeeds when exitstatus is nil and result is present' do
97+
status = instance_double(Process::Status, exitstatus: nil)
98+
stdout = '{"result": "value", "logs": []}'
99+
allow(Open3).to receive(:capture3).and_return([stdout, 'stderr', status])
100+
101+
expect {
102+
expect(described_class.send(:run, 'anything')).to eq 'value'
103+
}.to have_info(:selenium_manager)
104+
end
105+
106+
it 'raises if result is nil even with successful exitstatus' do
107+
status = instance_double(Process::Status, exitstatus: 0)
108+
stdout = '{"logs": []}'
109+
allow(Open3).to receive(:capture3).and_return([stdout, 'stderr', status])
110+
111+
expect {
112+
described_class.send(:run, 'anything')
113+
}.to raise_error(Error::WebDriverError, /Unsuccessful command executed/)
114+
end
95115
end
96116

97117
describe '.binary_paths' do

0 commit comments

Comments
 (0)