Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Selenium 4 upgrade #271

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more test cases for browser types
jamesmcroft committed Mar 14, 2024
commit f32288e5fe8c1f5471dcfd634e7429c0089fe843
2 changes: 2 additions & 0 deletions tests/Legerity.Core.Tests/Legerity.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.18.1" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="122.0.6261.11100" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.34.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
</ItemGroup>

15 changes: 8 additions & 7 deletions tests/Legerity.Core.Tests/Tests/WebAppManagerOptionsTests.cs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
using System.Drawing;
using System.IO;
using Legerity.Web;
using OpenQA.Selenium.Chrome;
using Shouldly;

namespace Legerity.Core.Tests.Tests;
@@ -11,24 +10,26 @@ namespace Legerity.Core.Tests.Tests;
[Parallelizable(ParallelScope.All)]
internal class WebAppManagerOptionsTests : BaseTestClass
{
[Test]
public void ShouldLaunchBrowserAtDesiredSize()
[TestCase(WebAppDriverType.Chrome)]
[TestCase(WebAppDriverType.Firefox)]
[TestCase(WebAppDriverType.Opera)]
public void ShouldLaunchBrowserAtDesiredSize(WebAppDriverType driverType)
{
// Arrange
var options = new WebAppManagerOptions(
WebAppDriverType.Chrome,
driverType,
Path.Combine(Environment.CurrentDirectory))
{
DesiredSize = new Size(1280, 800),
Url = "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_radio",
ImplicitWait = ImplicitWait,
DriverOptions = new ChromeOptions()
ImplicitWait = ImplicitWait
};

// Act
var app = StartApp(options);

// Assert
app.Manage().Window.Size.ShouldBe(options.DesiredSize);
var size = app.Manage().Window.Size;
size.ShouldBe(options.DesiredSize);
}
}