Skip to content

Commit

Permalink
Improve fallback functionality for Edge driver that in case of failur…
Browse files Browse the repository at this point in the history
…e of downloading auto/latest driver tries to download driver of the closest version
  • Loading branch information
YevgeniyShunevych committed Aug 4, 2024
1 parent ade4e25 commit d5300aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Atata.WebDriverSetup/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1204:Static elements should appear before instance elements", Justification = "<Pending>", Scope = "member", Target = "~M:Atata.WebDriverSetup.DriverSetupExecutor.ExtractDownloadedFile(System.String,System.String)")]
[assembly: SuppressMessage("Major Code Smell", "S2971:\"IEnumerable\" LINQs should be simplified", Justification = "<Pending>", Scope = "member", Target = "~M:Atata.WebDriverSetup.DriverSetup.SetUpPendingConfigurationsAsync~System.Threading.Tasks.Task{Atata.WebDriverSetup.DriverSetupResult[]}")]
[assembly: SuppressMessage("Security", "CA5400:Ensure HttpClient certificate revocation list check is not disabled", Justification = "<Pending>", Scope = "member", Target = "~M:Atata.WebDriverSetup.HttpRequestExecutor.CreateHttpClientWithAutoRedirect(System.Boolean)~System.Net.Http.HttpClient")]
[assembly: SuppressMessage("Major Bug", "S1764:Identical expressions should not be used on both sides of operators", Justification = "<Pending>", Scope = "member", Target = "~M:Atata.WebDriverSetup.EdgeDriverSetupStrategy.TryGetDriverClosestVersion(System.String,Atata.WebDriverSetup.Architecture,System.String@)~System.Boolean")]

#pragma warning restore S103 // Lines should not be too long
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ public string GetDriverVersionCorrespondingToBrowserVersion(string browserVersio
browserVersion;

/// <inheritdoc/>
public bool TryGetDriverClosestVersion(string version, Architecture architecture, out string closestVersion)
public bool TryGetDriverClosestVersion(string version, Architecture architecture, out string closestVersion) =>
TryAttemptToGetDriverClosestVersion(version, architecture, out closestVersion)
|| TryAttemptToGetDriverClosestVersion(version, architecture, out closestVersion);

private bool TryAttemptToGetDriverClosestVersion(string version, Architecture architecture, out string closestVersion)
{
string originalVersionUrlVersionPart = GetDriverDownloadUrlVersionPart(version);

Expand Down

0 comments on commit d5300aa

Please sign in to comment.