using Microsoft.Playwright; using Microsoft.Playwright.NUnit; using PlaywrightTests.Utilities; namespace PlaywrightTests; [Parallelizable(ParallelScope.Self)] [TestFixture] [Category("version2")] public class TicketTests : PageTest { [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() { Path = Path.Combine( TestContext.CurrentContext.WorkDirectory, "playwright-traces", $"{TestContext.CurrentContext.Test.ClassName}.{TestContext.CurrentContext.Test.Name}.zip" ) }); } [Test] public async Task CheckTickets() { await Auth.Login(Page); await Page.GetByRole(AriaRole.Link, new() { Name = " Tickets" }).ClickAsync(); var options = new LocatorAssertionsToBeVisibleOptions {Timeout = 10_000}; await Expect(Page.GetByRole(AriaRole.Button, new() { Name = "Neue View erstellen" })).ToBeVisibleAsync(options); } }