Skip to content

Commit

Permalink
Merge pull request Nfactor26#86 from Nfactor26/fix-random-failure-in-…
Browse files Browse the repository at this point in the history
…test-case

Test_That_Can_NavigateToPrevious_If_Not_On_First_Page random failures
  • Loading branch information
Nfactor26 authored Apr 4, 2023
2 parents 730b992 + 46a0c41 commit 4211080
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace Pixel.Identity.UI.Tests.PageModels.Applications;

internal class ListApplicationsPage : ListPage
{
private readonly string requestUrl = "api/applications";

/// <summary>
/// constructor
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
namespace Pixel.Identity.UI.Tests.PageModels.Roles;

internal class ListRolesPage : ListPage
{
private readonly string requestUrl = "api/roles";

{
/// <summary>
/// constructor
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions src/Pixel.Identity.UI.Tests/Pixel.Identity.UI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
11 changes: 6 additions & 5 deletions src/Pixel.Identity.UI.Tests/Tests/ApplicationsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ public async Task Test_That_Can_NavigateToNext_When_Multiple_Pages_Are_Available
public async Task Test_That_Can_NavigateToPrevious_If_Not_On_First_Page()
{
var listApplicationsPage = new ListApplicationsPage(this.Page);
await listApplicationsPage.GoToAsync();
await listApplicationsPage.NavigateToNextAsync();
await listApplicationsPage.GoToAsync();
Assert.AreEqual(10, await listApplicationsPage.GetCountAsync());
await listApplicationsPage.NavigateToNextAsync();
Assert.AreEqual(2, await listApplicationsPage.GetCountAsync());
var canNavigateToPrevious = await listApplicationsPage.CanNavigateToPrevious();
Assert.IsTrue(canNavigateToPrevious);
await listApplicationsPage.NavigateToPreviousAsync();
int scopesCount = await listApplicationsPage.GetCountAsync();
Assert.AreEqual(10, scopesCount);
await listApplicationsPage.NavigateToPreviousAsync();
Assert.AreEqual(10, await listApplicationsPage.GetCountAsync());
await Expect(this.Page).ToHaveURLAsync(new Regex(".*/applications/list"));
}

Expand Down

0 comments on commit 4211080

Please sign in to comment.