Skip to content

Commit

Permalink
Revert "Revert "[Blazor] Update selenium versions (#50511)" (#50556)"
Browse files Browse the repository at this point in the history
This reverts commit 564a94d.
  • Loading branch information
captainsafia committed Sep 14, 2023
1 parent a34d9fe commit 78bf7d8
Show file tree
Hide file tree
Showing 8 changed files with 638 additions and 183 deletions.
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@
<MicrosoftPlaywrightVersion>1.28.0</MicrosoftPlaywrightVersion>
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
<PollyVersion>7.2.4</PollyVersion>
<SeleniumSupportVersion>4.10.0</SeleniumSupportVersion>
<SeleniumWebDriverChromeDriverVersion>114.0.5735.9000</SeleniumWebDriverChromeDriverVersion>
<SeleniumWebDriverVersion>4.10.0</SeleniumWebDriverVersion>
<SeleniumSupportVersion>4.12.2</SeleniumSupportVersion>
<SeleniumWebDriverChromeDriverVersion>116.0.5845.9600</SeleniumWebDriverChromeDriverVersion>
<SeleniumWebDriverVersion>4.12.2</SeleniumWebDriverVersion>
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
<SerilogSinksFileVersion>4.0.0</SerilogSinksFileVersion>
<StackExchangeRedisVersion>2.6.122</StackExchangeRedisVersion>
Expand Down
6 changes: 2 additions & 4 deletions src/Components/test/E2ETest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
},
"author": "",
"license": "MIT",
"dependencies": {
"sauce-connect-launcher": "^1.3.1",
"selenium-standalone": "^7.1.0"
},
"devDependencies": {
"sauce-connect-launcher": "^1.3.1",
"selenium-standalone": "^9.1.1",
"@types/node": "^13.1.7",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
Expand Down
397 changes: 313 additions & 84 deletions src/Components/test/E2ETest/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/ProjectTemplates/test/Templates.Tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"author": "",
"license": "MIT",
"dependencies": {
"selenium-standalone": "^7.1.0"
"devDependencies": {
"selenium-standalone": "^9.1.1"
}
}
392 changes: 308 additions & 84 deletions src/ProjectTemplates/test/Templates.Tests/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Shared/E2ETesting/E2ETesting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<PropertyGroup>
<_PackageJsonLinesContent>@(_PackageJsonLines)</_PackageJsonLinesContent>
<_PackageJsonSeleniumPackage>&quot;selenium-standalone&quot;: &quot;^7.1.0&quot;</_PackageJsonSeleniumPackage>
<_PackageJsonSeleniumPackage>&quot;selenium-standalone&quot;: &quot;^9.1.1&quot;</_PackageJsonSeleniumPackage>
</PropertyGroup>

<Error
Expand Down
11 changes: 7 additions & 4 deletions src/Shared/E2ETesting/SeleniumStandaloneServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static async Task<SeleniumStandaloneServer> GetInstanceAsync(ITestOutputH
private static async Task InitializeInstance(ITestOutputHelper output)
{
var port = FindAvailablePort();
var uri = new UriBuilder("http", SeleniumHost, port, "/wd/hub").Uri;
var uri = new UriBuilder("http", SeleniumHost, port).Uri;

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

var psi = new ProcessStartInfo
{
FileName = "npm",
Arguments = $"run selenium-standalone start -- --config \"{seleniumConfigPath}\" {chromeDriverArg} -- -host {SeleniumHost} -port {port}",
Arguments = $"run selenium-standalone start -- --config \"{seleniumConfigPath}\" -- --host {SeleniumHost} --port {port}",
RedirectStandardOutput = true,
RedirectStandardError = true,
};

if (!string.IsNullOrEmpty(chromeDriverPathEnvVar))
{
psi.EnvironmentVariables["PATH"] = $"{psi.EnvironmentVariables["PATH"]}{Path.PathSeparator}{chromeDriverPathEnvVar}";
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
psi.FileName = "cmd";
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/E2ETesting/selenium-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"version": "4.12.0",
"drivers": {
"chrome": {
"version" : "114.0.5735.90"
"version" : "116.0.5845.96"
}
},
"ignoreExtraDrivers": true
Expand Down

0 comments on commit 78bf7d8

Please sign in to comment.