Код: Выделить всё
[AllureNUnit]
internal abstract class PageTestBase : Microsoft.Playwright.NUnit.PageTest
{
protected async Task Step(string name, Func action)
{
try
{
await AllureApi.Step(name, action);
}
catch (Exception)
{
//save screenshot in case something goes wrong (mandatory)
await Page.ScreenshotAsync(new() { Path = "failure.png" });
//TODO: set result to failed
}
//TODO: depending on settings user can opt to save screenshots after every step
await Page.ScreenshotAsync(new() { Path = "AfterEachStep.png" });
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... re-reports