Skip to content

Commit

Permalink
📦 Upgrade Acceptance Tests to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontaylordev committed Jun 27, 2023
1 parent d44b68c commit 98d505a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 46 deletions.
3 changes: 3 additions & 0 deletions tests/WebUI.AcceptanceTests/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public static string GetBaseUrl()
if (_baseUrl == null)
{
_baseUrl = _configuration["BaseUrl"];

ArgumentNullException.ThrowIfNull(_baseUrl);

_baseUrl = _baseUrl.TrimEnd('/');
}

Expand Down
47 changes: 13 additions & 34 deletions tests/WebUI.AcceptanceTests/Features/Login.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/WebUI.AcceptanceTests/Pages/LoginPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public LoginPage(IBrowser browser, IPage page)
Page = page;
}

public override string PagePath => $"{BaseUrl}/authentication/login";
public override string PagePath => $"{BaseUrl}/Identity/Account/Login";

public override IBrowser Browser { get; }

Expand All @@ -24,7 +24,7 @@ public Task ClickLogin()
=> Page.Locator("#login-submit").ClickAsync();

public Task<string?> ProfileLinkText()
=> Page.Locator("a[href='/authentication/profile']").TextContentAsync();
=> Page.Locator("a[href='/Identity/Account/Manage']").TextContentAsync();

public Task<bool> InvalidLoginAttemptMessageVisible()
=> Page.Locator("text=Invalid login attempt.").IsVisibleAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task TheyLogInSuccessfully()
var profileLinkText = await _loginPage.ProfileLinkText();

profileLinkText.Should().NotBeNull();
profileLinkText.Should().Be("Hello administrator@localhost");
profileLinkText.Should().Be("Account");
}

[When("the user logs in with invalid credentials")]
Expand Down
18 changes: 9 additions & 9 deletions tests/WebUI.AcceptanceTests/WebUI.AcceptanceTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>CleanArchitecture.WebUI.AcceptanceTests</RootNamespace>
<AssemblyName>CleanArchitecture.WebUI.AcceptanceTests</AssemblyName>
<Nullable>enable</Nullable>
Expand All @@ -19,16 +19,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0-preview.5.23280.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-preview.5.23280.8" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.22.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.Playwright" Version="1.35.0" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
<PackageReference Include="SpecFlow.NUnit" Version="3.9.40" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
</ItemGroup>

</Project>

0 comments on commit 98d505a

Please sign in to comment.