using Microsoft.Playwright; using Microsoft.Playwright.NUnit; using PlaywrightTests.Utilities; namespace PlaywrightTests; [Parallelizable(ParallelScope.Self)] [TestFixture] [Category("CustomerTickets")] public class CustomerTicketsTest : 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 CheckViews() { await Auth.Login(Page); await Page.GetByRole(AriaRole.Link, new() { Name = " Kunden" }).ClickAsync(); await Page.GetByRole(AriaRole.Link, new() { Name = "Barkunde" }).ClickAsync(); await Page.Locator("#main").GetByText("Tickets").ClickAsync(); await Expect(Page.Locator("body")).ToContainTextAsync("Nur eigene"); await Page.GetByRole(AriaRole.Cell, new() { Name = "Barkunde" }).First.ClickAsync(); await Page.GetByRole(AriaRole.Cell, new() { Name = "Barkunde" }).Nth(1).ClickAsync(); await Page.GetByRole(AriaRole.Cell, new() { Name = "Barkunde" }).Nth(2).ClickAsync(); await Page.GetByText("Zurück zur Liste").ClickAsync(); await Page.GetByRole(AriaRole.Link, new() { Name = "c-entron software GmbH" }).ClickAsync(); await Page.Locator("#main").GetByText("Tickets").ClickAsync(); await Page.GetByRole(AriaRole.Cell, new() { Name = "No data to display" }).ClickAsync(); } }