Migrate UI tests to Playwright dotta
This commit is contained in:
@@ -3,8 +3,24 @@ 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()
|
||||
@@ -12,17 +28,17 @@ public sealed class SearchesDashboardPageTests(PlaywrightFixture fixture) : UiTe
|
||||
await RunAsync(async page =>
|
||||
{
|
||||
await UiNavigationHelper.NavigateToSearchesDashboardAsync(page);
|
||||
var url = page.Url;
|
||||
string url = page.Url;
|
||||
Assert.True(
|
||||
url.EndsWith("/searches", StringComparison.OrdinalIgnoreCase) ||
|
||||
url.EndsWith("/search", StringComparison.OrdinalIgnoreCase) ||
|
||||
url.EndsWith("/", StringComparison.OrdinalIgnoreCase),
|
||||
$"Unexpected URL: {url}");
|
||||
|
||||
var hasSearchesHeading = await page.GetByText("Searches Dashboard").IsVisibleAsync();
|
||||
var hasSearchDetails = await page.GetByText("Search Details").IsVisibleAsync();
|
||||
var hasGrid = await page.Locator(".rz-data-grid").First.IsVisibleAsync();
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user