Generates native C# Playwright end-to-end (E2E) browser tests for user journeys (UC-* / TC-*) using Microsoft.Playwright.Xunit. Use when the user asks to "write e2e test", "create playwright test for dotnet", "write browser test in C#", or mentions Playwright with .NET.
66
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./aiup-blazor-dotnet/skills/playwright-test/SKILL.mdWrite end-to-end browser tests in native C# using Microsoft.Playwright.Xunit inside a dedicated E2E test project (*.Tests.E2E).
A diff of the specification change may follow the file path in the arguments. When it is there, it is the definitive list of what changed — work through it change by change. A removed line means the scenario it described was dropped: delete the tests that exist only for it instead of keeping them as passing extras.
Before writing new tests, look in the *.Tests.E2E project for an existing test class covering this
use case or test case (e.g. PlaceOrderE2ETest.cs, or any class referencing the UC-XXX / TC-XXX ID).
If one exists, update it to match the current specification instead of creating a second class:
docs/use_cases/UC-XXX-*.md or docs/test_cases/TC-XXX-*.md.Microsoft.Playwright.Xunit.PageTest.WebApplicationFactory<Program> or custom host fixture) to launch the app automatically on a dynamic port during test execution, or read base URL from configuration (https://localhost:5001).GetByRole, GetByLabel, GetByTestId) and async assertions (Expect(...).ToBeVisibleAsync()).namespace MyApp.Tests.E2E;
public class PlaceOrderE2ETest : PageTest
{
private readonly string _baseUrl;
public PlaceOrderE2ETest(TestServerFixture fixture)
{
_baseUrl = fixture.BaseUrl; // Dynamic test host URL or configuration
}
[Fact]
public async Task UserCanPlaceOrderSuccessfully()
{
await Page.GotoAsync($"{_baseUrl}/place-order");
await Page.GetByLabel("Quantity").FillAsync("2");
await Page.GetByRole(AriaRole.Button, new() { Name = "Submit Order" }).ClickAsync();
await Expect(Page.GetByText("Order Placed Successfully")).ToBeVisibleAsync();
}
}dotnet test to execute end-to-end tests against the application.c3a5da3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.