44 lines
1.8 KiB
C#
44 lines
1.8 KiB
C#
using JdeScoping.Ui.Tests.Helpers;
|
|
using JdeScoping.Ui.Tests.Support;
|
|
|
|
namespace JdeScoping.Ui.Tests;
|
|
|
|
/// <summary>
|
|
/// Playwright UI smoke tests for the Searches Dashboard page.
|
|
/// Validates that the dashboard loads at the expected URL and shows a heading or data grid.
|
|
/// Requires a running Docker host (Category: RequiresDockerHost).
|
|
/// </summary>
|
|
public sealed class SearchesDashboardPageTests(PlaywrightFixture fixture) : UiTestBase(fixture)
|
|
{
|
|
/// <summary>
|
|
/// Verifies the Searches Dashboard page loads at /searches and displays a heading or data grid.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Steps:
|
|
/// <list type="number">
|
|
/// <item>Navigate to the Searches Dashboard page.</item>
|
|
/// <item>Assert the URL ends with /searches, /search, or /.</item>
|
|
/// <item>Assert that "Searches Dashboard", "Search Details", or the Radzen data grid is visible.</item>
|
|
/// </list>
|
|
/// </remarks>
|
|
[Fact]
|
|
[Trait("Category", "RequiresDockerHost")]
|
|
public async Task SearchesDashboard_Loads()
|
|
{
|
|
await RunAsync(async page =>
|
|
{
|
|
await UiNavigationHelper.NavigateToSearchesDashboardAsync(page);
|
|
string url = page.Url;
|
|
Assert.True(
|
|
url.EndsWith("/searches", StringComparison.OrdinalIgnoreCase) ||
|
|
url.EndsWith("/search", StringComparison.OrdinalIgnoreCase) ||
|
|
url.EndsWith("/", StringComparison.OrdinalIgnoreCase),
|
|
$"Unexpected URL: {url}");
|
|
|
|
bool hasSearchesHeading = await page.GetByText("Searches Dashboard").IsVisibleAsync();
|
|
bool hasSearchDetails = await page.GetByText("Search Details").IsVisibleAsync();
|
|
bool hasGrid = await page.Locator(".rz-data-grid").First.IsVisibleAsync();
|
|
Assert.True(hasSearchesHeading || hasSearchDetails || hasGrid);
|
|
});
|
|
}
|
|
} |