tests(apphost.tests): added support for end to end testing using playwright
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
namespace FiscalOS.AppHost.Tests.Infra;
|
||||
|
||||
public sealed class PlaywrightFixture : IAsyncLifetime
|
||||
{
|
||||
private IPlaywright? _playwright;
|
||||
|
||||
internal IBrowser Browser { get; set; } = null!;
|
||||
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_playwright = await Playwright.CreateAsync();
|
||||
|
||||
Browser = await _playwright.Chromium.LaunchAsync(new()
|
||||
{
|
||||
Headless = false,
|
||||
});
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await Browser.CloseAsync();
|
||||
await Browser.DisposeAsync();
|
||||
|
||||
_playwright?.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user