Skip to content

Commit 78bf7d8

Browse files
committed
Revert "Revert "[Blazor] Update selenium versions (#50511)" (#50556)"
This reverts commit 564a94d.
1 parent a34d9fe commit 78bf7d8

File tree

8 files changed

+638
-183
lines changed

8 files changed

+638
-183
lines changed

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@
310310
<MicrosoftPlaywrightVersion>1.28.0</MicrosoftPlaywrightVersion>
311311
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
312312
<PollyVersion>7.2.4</PollyVersion>
313-
<SeleniumSupportVersion>4.10.0</SeleniumSupportVersion>
314-
<SeleniumWebDriverChromeDriverVersion>114.0.5735.9000</SeleniumWebDriverChromeDriverVersion>
315-
<SeleniumWebDriverVersion>4.10.0</SeleniumWebDriverVersion>
313+
<SeleniumSupportVersion>4.12.2</SeleniumSupportVersion>
314+
<SeleniumWebDriverChromeDriverVersion>116.0.5845.9600</SeleniumWebDriverChromeDriverVersion>
315+
<SeleniumWebDriverVersion>4.12.2</SeleniumWebDriverVersion>
316316
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
317317
<SerilogSinksFileVersion>4.0.0</SerilogSinksFileVersion>
318318
<StackExchangeRedisVersion>2.6.122</StackExchangeRedisVersion>

src/Components/test/E2ETest/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
},
1212
"author": "",
1313
"license": "MIT",
14-
"dependencies": {
15-
"sauce-connect-launcher": "^1.3.1",
16-
"selenium-standalone": "^7.1.0"
17-
},
1814
"devDependencies": {
15+
"sauce-connect-launcher": "^1.3.1",
16+
"selenium-standalone": "^9.1.1",
1917
"@types/node": "^13.1.7",
2018
"ts-node": "^8.6.2",
2119
"typescript": "^3.7.5"

src/Components/test/E2ETest/yarn.lock

Lines changed: 313 additions & 84 deletions
Large diffs are not rendered by default.

src/ProjectTemplates/test/Templates.Tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"author": "",
1212
"license": "MIT",
13-
"dependencies": {
14-
"selenium-standalone": "^7.1.0"
13+
"devDependencies": {
14+
"selenium-standalone": "^9.1.1"
1515
}
1616
}

src/ProjectTemplates/test/Templates.Tests/yarn.lock

Lines changed: 308 additions & 84 deletions
Large diffs are not rendered by default.

src/Shared/E2ETesting/E2ETesting.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<PropertyGroup>
5353
<_PackageJsonLinesContent>@(_PackageJsonLines)</_PackageJsonLinesContent>
54-
<_PackageJsonSeleniumPackage>&quot;selenium-standalone&quot;: &quot;^7.1.0&quot;</_PackageJsonSeleniumPackage>
54+
<_PackageJsonSeleniumPackage>&quot;selenium-standalone&quot;: &quot;^9.1.1&quot;</_PackageJsonSeleniumPackage>
5555
</PropertyGroup>
5656

5757
<Error

src/Shared/E2ETesting/SeleniumStandaloneServer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static async Task<SeleniumStandaloneServer> GetInstanceAsync(ITestOutputH
8585
private static async Task InitializeInstance(ITestOutputHelper output)
8686
{
8787
var port = FindAvailablePort();
88-
var uri = new UriBuilder("http", SeleniumHost, port, "/wd/hub").Uri;
88+
var uri = new UriBuilder("http", SeleniumHost, port).Uri;
8989

9090
var seleniumConfigPath = typeof(SeleniumStandaloneServer).Assembly
9191
.GetCustomAttributes<AssemblyMetadataAttribute>()
@@ -100,22 +100,25 @@ private static async Task InitializeInstance(ITestOutputHelper output)
100100
// In AzDO, the path to the system chromedriver is in an env var called CHROMEWEBDRIVER
101101
// We want to use this because it should match the installed browser version
102102
// If the env var is not set, then we fall back on using whatever is in the Selenium config file
103-
var chromeDriverArg = string.Empty;
104103
var chromeDriverPathEnvVar = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
105104
if (!string.IsNullOrEmpty(chromeDriverPathEnvVar))
106105
{
107-
chromeDriverArg = $"--javaArgs=-Dwebdriver.chrome.driver={chromeDriverPathEnvVar}/chromedriver";
108106
output.WriteLine($"Using chromedriver at path {chromeDriverPathEnvVar}");
109107
}
110108

111109
var psi = new ProcessStartInfo
112110
{
113111
FileName = "npm",
114-
Arguments = $"run selenium-standalone start -- --config \"{seleniumConfigPath}\" {chromeDriverArg} -- -host {SeleniumHost} -port {port}",
112+
Arguments = $"run selenium-standalone start -- --config \"{seleniumConfigPath}\" -- --host {SeleniumHost} --port {port}",
115113
RedirectStandardOutput = true,
116114
RedirectStandardError = true,
117115
};
118116

117+
if (!string.IsNullOrEmpty(chromeDriverPathEnvVar))
118+
{
119+
psi.EnvironmentVariables["PATH"] = $"{psi.EnvironmentVariables["PATH"]}{Path.PathSeparator}{chromeDriverPathEnvVar}";
120+
}
121+
119122
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
120123
{
121124
psi.FileName = "cmd";

src/Shared/E2ETesting/selenium-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2+
"version": "4.12.0",
23
"drivers": {
34
"chrome": {
4-
"version" : "114.0.5735.90"
5+
"version" : "116.0.5845.96"
56
}
67
},
78
"ignoreExtraDrivers": true

0 commit comments

Comments
 (0)