Skip to content

Commit

Permalink
Updated WebAppManagerOptions with Chromium Edge and updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcroft committed Sep 25, 2021
1 parent f4813f2 commit e3bc97a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 19 deletions.
3 changes: 1 addition & 2 deletions samples/W3SchoolsWebTests/BaseTestClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public abstract class BaseTestClass
public virtual void Initialize()
{
AppManager.StartApp(
new WebAppManagerOptions(WebAppDriverType.Edge,
Path.Combine(Environment.CurrentDirectory, "Tools\\Edge"))
new WebAppManagerOptions(WebAppDriverType.EdgeChromium, Environment.CurrentDirectory)
{
Maximize = true,
Url = this.Url
Expand Down
Binary file not shown.
7 changes: 1 addition & 6 deletions samples/W3SchoolsWebTests/W3SchoolsWebTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Selenium.WebDriver.MSEdgeDriver" Version="94.0.986" />
<PackageReference Include="Shouldly" Version="4.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Legerity.Web\Legerity.Web.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Tools\Edge\MicrosoftWebDriver.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
4 changes: 1 addition & 3 deletions samples/WebTests/EdgeBaseTestClass.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace WebTests
{
using System;
using System.IO;
using Legerity;
using Legerity.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -12,8 +11,7 @@ public abstract class EdgeBaseTestClass
public virtual void Initialize()
{
AppManager.StartApp(
new WebAppManagerOptions(WebAppDriverType.Edge,
Path.Combine(Environment.CurrentDirectory, "Tools\\Edge"))
new WebAppManagerOptions(WebAppDriverType.EdgeChromium, Environment.CurrentDirectory)
{
Maximize = true,
Url = "https://www.jamescroft.co.uk"
Expand Down
Binary file removed samples/WebTests/Tools/Edge/MicrosoftWebDriver.exe
Binary file not shown.
7 changes: 1 addition & 6 deletions samples/WebTests/WebTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="Selenium.WebDriver.MSEdgeDriver" Version="94.0.986" />
<PackageReference Include="Shouldly" Version="4.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Legerity\Legerity.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Tools\Edge\MicrosoftWebDriver.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Legerity.Core/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static void StartApp(AppManagerOptions opts)
WebAppDriverType.Safari => new SafariDriver(webOpts.DriverUri),
WebAppDriverType.Edge => new EdgeDriver(webOpts.DriverUri),
WebAppDriverType.InternetExplorer => new InternetExplorerDriver(webOpts.DriverUri),
WebAppDriverType.EdgeChromium => new Microsoft.Edge.SeleniumTools.EdgeDriver(webOpts.DriverUri, new Microsoft.Edge.SeleniumTools.EdgeOptions { UseChromium = true }),
_ => App
};

Expand Down
1 change: 1 addition & 0 deletions src/Legerity.Core/Legerity.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="4.3.1" />
<PackageReference Include="Microsoft.Edge.SeleniumTools" Version="3.141.2" />
</ItemGroup>

</Project>
9 changes: 7 additions & 2 deletions src/Legerity.Core/Web/WebAppManagerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,18 @@ public enum WebAppDriverType
Safari,

/// <summary>
/// Edge. Setting this will cause the application driver to launch for Microsoft's Edge.
/// Edge. Setting this will cause the application driver to launch for Microsoft's Legacy Edge.
/// </summary>
Edge,

/// <summary>
/// Internet Explorer. This will cause the application driver to launch for Microsoft's Internet Explorer.
/// </summary>
InternetExplorer
InternetExplorer,

/// <summary>
/// Edge Chromium. Setting this will cause the application driver to launch for Microsoft's Chromium Edge.
/// </summary>
EdgeChromium,
}
}

0 comments on commit e3bc97a

Please sign in to comment.