Skip to content

Commit

Permalink
Add support of legacy (non chromium) edge
Browse files Browse the repository at this point in the history
  • Loading branch information
rosolko committed Oct 24, 2019
1 parent a9ea3fa commit f2d61c2
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
25 changes: 25 additions & 0 deletions WebDriverManager.Tests/LegacyEdgeConfigTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Text.RegularExpressions;
using WebDriverManager.DriverConfigs.Impl;
using Xunit;

namespace WebDriverManager.Tests
{
public class LegacyEdgeConfigTests : LegacyEdgeConfig
{
[Fact]
public void VersionTest()
{
var version = GetLatestVersion();
var regex = new Regex(@"^\d+\.\d+$");
Assert.NotEmpty(version);
Assert.Matches(regex, version);
}

[Fact]
public void DriverDownloadTest()
{
new DriverManager().SetUpDriver(new LegacyEdgeConfig());
Assert.NotEmpty(WebDriverFinder.FindFile(GetBinaryName()));
}
}
}
31 changes: 31 additions & 0 deletions WebDriverManager/DriverConfigs/Impl/LegacyEdgeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace WebDriverManager.DriverConfigs.Impl
{
public class LegacyEdgeConfig : IDriverConfig
{
public virtual string GetName()
{
return "Edge";
}

public virtual string GetUrl32()
{
return
"https://download.microsoft.com/download/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe";
}

public virtual string GetUrl64()
{
return GetUrl32();
}

public virtual string GetBinaryName()
{
return "MicrosoftWebDriver.exe";
}

public virtual string GetLatestVersion()
{
return "6.17134";
}
}
}
11 changes: 8 additions & 3 deletions WebDriverManager/Services/Impl/BinaryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ public string SetupBinary(string url, string zipDestination, string binDestinati
FileHelper.CreateDestinationDirectory(zipDestination);
zipDestination = DownloadZip(url, zipDestination);
FileHelper.CreateDestinationDirectory(binDestination);
if (!zipDestination.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))

if (zipDestination.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{
File.Copy(zipDestination, binDestination);
}
else
{
binDestination = UnZip(zipDestination, binDestination, binaryName);
UnZip(zipDestination, binDestination, binaryName);
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Expand Down
4 changes: 2 additions & 2 deletions WebDriverManager/WebDriverManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.6.0</PackageVersion>
<PackageVersion>2.7.0</PackageVersion>
<Title>WebDriverManager.Net</Title>
<Description>Automatic Selenium WebDriver binaries management for .Net</Description>
<Copyright>© 2016-2019, Aliaksandr Rasolka. All Rights Reserved.</Copyright>
Expand All @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/rosolko/WebDriverManager.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Selenium WebDriver ChromeDriver EdgeDriver InternetExplorerDriver MarionetteDriver OperaDriver PhantomJsDriver</PackageTags>
<PackageReleaseNotes>Correctly get lavetst edge version </PackageReleaseNotes>
<PackageReleaseNotes>Add support of legacy (non chromium) edge</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '{build}'
image: Visual Studio 2017

environment:
LIBRARY_VERSION: '2.6.0'
LIBRARY_VERSION: '2.7.0'
SONAR_LOGIN:
secure: JNopXLZtkO5PD8yEj2+W1BZnbhq9oegXmTFgvVWQw67z5PtWwd+ngjv5O7xFetCZ

Expand Down

0 comments on commit f2d61c2

Please sign in to comment.