Files

39 lines
941 B
C#
Raw Permalink Normal View History

2024-04-08 23:34:32 -05:00
namespace Blog.Tests.EndToEnd;
[TestFixture]
2025-11-22 07:23:23 -06:00
public abstract class BlogTest : PageTest
2024-04-08 23:34:32 -05:00
{
private readonly BlogHostFactory<Program> _factory = new();
public override BrowserNewContextOptions ContextOptions()
{
var options = base.ContextOptions();
options.BaseURL = _factory.ServerAddress;
return options;
}
2024-04-10 01:28:38 -05:00
[SetUp]
public async Task Setup()
{
await Context.Tracing.StartAsync(new()
{
Title = TestContext.CurrentContext.Test.ClassName + "." + TestContext.CurrentContext.Test.Name,
Screenshots = true,
Snapshots = true,
Sources = true
});
}
[TearDown]
public async Task TearDown()
{
await Context.Tracing.StopAsync(new()
{
2024-04-12 19:33:56 -05:00
Path = Path.Combine(
2024-04-10 01:28:38 -05:00
TestContext.CurrentContext.WorkDirectory,
"playwright-traces",
$"{TestContext.CurrentContext.Test.ClassName}.{TestContext.CurrentContext.Test.Name}.zip"
)
});
}
2024-04-08 23:34:32 -05:00
}