27 lines
704 B
C#
27 lines
704 B
C#
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);
|
|
}
|
|
} |