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
@@ -5,7 +5,8 @@ namespace JdeScoping.Ui.Tests.Support;
public abstract class SearchFlowTestBase(PlaywrightFixture fixture) : UiTestBase(fixture)
{
private static bool StrictMode =>
string.Equals(Environment.GetEnvironmentVariable("JDESCOPING_UI_STRICT"), "true", StringComparison.OrdinalIgnoreCase);
string.Equals(Environment.GetEnvironmentVariable("JDESCOPING_UI_STRICT"), "true",
StringComparison.OrdinalIgnoreCase);
protected Task RunSearchSubmissionAsync(
string searchType,
@@ -23,34 +24,23 @@ public abstract class SearchFlowTestBase(PlaywrightFixture fixture) : UiTestBase
await Assertions.Expect(page.Locator(".rz-dropdown-label").First).ToContainTextAsync(searchType);
if (!StrictMode)
{
// Default mode is smoke-only against local docker where source systems can be offline.
return;
}
if (!string.IsNullOrWhiteSpace(minDate) && !string.IsNullOrWhiteSpace(maxDate))
{
await UiSearchFormHelper.SetDateRangeAsync(page, minDate, maxDate);
}
if (autocompleteItems is not null)
{
foreach (var item in autocompleteItems)
{
await UiSearchFormHelper.AddAutocompleteItemAsync(page, item.PanelHeader, item.Value);
}
}
if (uploads is not null)
{
foreach (var upload in uploads)
{
await UiSearchFormHelper.UploadFileAsync(page, upload.PanelHeader, TestDataPaths.Get(upload.FileName));
}
}
await UiSearchFormHelper.UploadFileAsync(page, upload.PanelHeader,
TestDataPaths.Get(upload.FileName));
await UiSearchFormHelper.SubmitSearchAsync(page);
await UiSearchFormHelper.AssertNoErrorNotificationAsync(page);
});
}
}
}