Migrate Playwright suite to .NET UI tests and deprecate TS project
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Microsoft.Playwright;
|
||||
|
||||
namespace JdeScoping.Ui.Tests.Support;
|
||||
|
||||
[Collection(UiTestCollection.Name)]
|
||||
public abstract class UiTestBase
|
||||
{
|
||||
private readonly PlaywrightFixture _fixture;
|
||||
|
||||
protected UiTestBase(PlaywrightFixture fixture)
|
||||
{
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
protected async Task RunAsync(Func<IPage, Task> action)
|
||||
{
|
||||
await using var context = await _fixture.Browser.NewContextAsync(new BrowserNewContextOptions
|
||||
{
|
||||
BaseURL = UiTestSettings.BaseUrl,
|
||||
IgnoreHTTPSErrors = true
|
||||
});
|
||||
|
||||
var page = await context.NewPageAsync();
|
||||
page.SetDefaultTimeout(30_000);
|
||||
page.SetDefaultNavigationTimeout(120_000);
|
||||
|
||||
await action(page);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user