Migrate Playwright suite to .NET UI tests and deprecate TS project
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using JdeScoping.Ui.Tests.Helpers;
|
||||
using JdeScoping.Ui.Tests.Support;
|
||||
namespace JdeScoping.Ui.Tests;
|
||||
|
||||
public sealed class SearchQueuePageTests(PlaywrightFixture fixture) : UiTestBase(fixture)
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", "RequiresDockerHost")]
|
||||
public async Task SearchQueue_Loads()
|
||||
{
|
||||
await RunAsync(async page =>
|
||||
{
|
||||
await UiNavigationHelper.NavigateToQueueAsync(page);
|
||||
var url = page.Url;
|
||||
var onQueue = url.EndsWith("/search/queue", StringComparison.OrdinalIgnoreCase);
|
||||
var redirectedToSearch = url.EndsWith("/search", StringComparison.OrdinalIgnoreCase);
|
||||
Assert.True(onQueue || redirectedToSearch, $"Unexpected URL: {url}");
|
||||
|
||||
if (onQueue)
|
||||
{
|
||||
await Assertions.Expect(page.GetByText("Search Queue")).ToBeVisibleAsync(new() { Timeout = 15_000 });
|
||||
var hasGrid = await page.Locator(".rz-data-grid").First.IsVisibleAsync();
|
||||
var hasAlert = await page.Locator(".rz-alert").First.IsVisibleAsync();
|
||||
var hasLoading = await page.GetByText("Loading queue").IsVisibleAsync();
|
||||
Assert.True(hasGrid || hasAlert || hasLoading, "Expected queue grid, alert, or loading indicator.");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Assertions.Expect(page.GetByText("Search Details")).ToBeVisibleAsync(new() { Timeout = 15_000 });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user