Migrate UI tests to Playwright dotta

This commit is contained in:
Joseph Doherty
2026-02-10 07:47:48 -05:00
parent c3a9a6b19c
commit 78e67c2aab
37 changed files with 842 additions and 230 deletions
@@ -3,8 +3,25 @@ using JdeScoping.Ui.Tests.Support;
namespace JdeScoping.Ui.Tests;
/// <summary>
/// Playwright UI smoke tests for the Search page.
/// Validates that the search form loads with primary controls visible and no error notifications.
/// Requires a running Docker host (Category: RequiresDockerHost).
/// </summary>
public sealed class SearchPageTests(PlaywrightFixture fixture) : UiTestBase(fixture)
{
/// <summary>
/// Verifies the search page loads and displays the "Search Details" heading, Submit button, and no errors.
/// </summary>
/// <remarks>
/// Steps:
/// <list type="number">
/// <item>Navigate to the search page.</item>
/// <item>Assert the "Search Details" text is visible.</item>
/// <item>Assert the Submit button is visible.</item>
/// <item>Assert no error notification is present.</item>
/// </list>
/// </remarks>
[Fact]
[Trait("Category", "RequiresDockerHost")]
public async Task SearchPage_LoadsAndShowsPrimaryControls()
@@ -13,8 +30,9 @@ public sealed class SearchPageTests(PlaywrightFixture fixture) : UiTestBase(fixt
{
await UiNavigationHelper.NavigateToSearchPageAsync(page);
await Assertions.Expect(page.GetByText("Search Details")).ToBeVisibleAsync();
await Assertions.Expect(page.GetByRole(Microsoft.Playwright.AriaRole.Button, new() { Name = "Submit" }).First).ToBeVisibleAsync();
await Assertions.Expect(page.GetByRole(AriaRole.Button, new PageGetByRoleOptions { Name = "Submit" }).First)
.ToBeVisibleAsync();
await UiSearchFormHelper.AssertNoErrorNotificationAsync(page);
});
}
}
}