Files
jdescopingtool/NEW/tests/JdeScoping.Ui.Tests/SearchPageTests.cs
T
2026-02-10 07:47:48 -05:00

38 lines
1.5 KiB
C#

using JdeScoping.Ui.Tests.Helpers;
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()
{
await RunAsync(async page =>
{
await UiNavigationHelper.NavigateToSearchPageAsync(page);
await Assertions.Expect(page.GetByText("Search Details")).ToBeVisibleAsync();
await Assertions.Expect(page.GetByRole(AriaRole.Button, new PageGetByRoleOptions { Name = "Submit" }).First)
.ToBeVisibleAsync();
await UiSearchFormHelper.AssertNoErrorNotificationAsync(page);
});
}
}