Migrate UI tests to Playwright dotta
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user