playwright
Skill2 starsChanged 10 months agoMITView on GitHub
Develops end-to-end UI tests with Playwright for Blazor applications. Use when: Writing E2E tests, testing Blazor WASM pages, validating UI flows, checking responsive design, detecting JavaScript errors, or testing MudBlazor components.
55 other projects use a version of this.
Adopted by
Most recently taken up by
- hmjBill/skillstheir own version, first seen Oct 5, 2026
- fmind/dottheir own version, first seen Oct 5, 2026
- hencter/hencte.toptheir own version, first seen Oct 4, 2026
- HanksChen0110/skillstheir own version, first seen Oct 3, 2026
- hahuyhungdev/ai-coding-configtheir own version, first seen Oct 2, 2026
- Enjoyoer/loadouttheir own version, first seen Sep 30, 2026
Used with
Projects with it also use doc, web-perf and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JetBrainsSkilldoc
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.
Also in 5 projects that use this
OpenAISkillweb-perf
Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.
Also in 4 projects that use this
CloudflareSkillturnstile-spin
Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.
Also in 3 projects that use this
CloudflareSkillcloudflare-one
Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors.
Also in 3 projects that use this
kayamanSkilledit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Also in 4 projects that use this
OpenAISkilldurable-objects
Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
Also in 3 projects that use this
- +2 more from openai
Other versions55 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 55
- openai/openai-agents-python★ 30ksame name
- openai/skills★ 28ksame name
- freestylefly/wesight★ 941same name
- JetBrains/skills★ 360same name
- Mindrally/skills★ 266same name
- alexeykrol/claude-code-starter★ 194same name
- kandada/aacode★ 134same name
- magnus919/agent-skills★ 109same name
- matyasstoch/david-skills★ 59same name
- letitbk/claude-academic-setup★ 46same name
45 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- llms.txtllms.txt
- aspireSkill
- aspnet-coreSkill
- blazorSkill
- blueprint-builderSkill
- configuring-opentelemetry-dotnetSkill
- coverage-analysisSkill
- coverletSkill
- cryptographySkill
- database-expertSkill
- dockerSkill
- dotnetSkill
- entity-framework-coreSkill
- entity-frameworkSkill
- fluent-assertionsSkill
- frontend-designSkill
- grpcSkill
- jwtSkill
- mcpSkill
- microsoft-extensionsSkill
- migrate-xunit-to-xunit-v3Skill
- minimal-api-file-uploadSkill
- minimal-apisSkill
- mongodbSkill
- moqSkill
- nbitcoinSkill
- network-bootstrapSkill
- nunitSkill
- optimizing-ef-core-queriesSkill
- postgresqlSkill
- prodexecSkill
- redisSkill
- scalarSkill
- signalrSkill
- sorcha-appSkill
- sorcha-architectureSkill
- sorcha-cliSkill
- sorcha-uiSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- verifiable-credentialsSkill
- walkthrough-builderSkill
- worker-servicesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 50 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 118
Every nav-triggering locator gets a corresponding Click_RoutesTo<Page> test that asserts the URL after the click.
- Distinctive: line 119
Every state-mutating button gets a click + assert-on-resulting-state test.
- Very specific: line 120
If a locator is for an assertion target only (e.g.
- Very specific: line 176
Use mcp__context7__resolve-library-id to search for "playwright"
“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright Skill
E2E testing for Blazor WebAssembly using Playwright .NET with NUnit and .NET Aspire integration. Tests run against the full Aspire application stack with all services.
Quick Start
Basic Page Test
[Parallelizable(ParallelScope.Self)]
[TestFixture]
public class BlazorUITests : PageTest
{
private DistributedApplication? _app;
private string? _blazorUrl;
[OneTimeSetUp]
public async Task OneTimeSetUp()
{
var appHost = await DistributedApplicationTestingBuilder
.CreateAsync<Projects.Sorcha_AppHost>();
_app = await appHost.BuildAsync();
await _app.StartAsync();
_blazorUrl = _app.GetEndpoint("blazor-client").ToString();
}
[Test]
public async Task HomePage_LoadsSuccessfully()
{
await Page.GotoAsync(_blazorUrl!);
await Page.WaitForLoadStateAsync();
await Expect(Page).ToHaveTitleAsync(new Regex("Sorcha|Blueprint"));
}
}Locator Patterns
// Role-based (preferred)
await Page.GetByRole(AriaRole.Button, new() { Name = "Submit" }).ClickAsync();
// Text-based
Page.Locator("a:has-text('Designer')")
// MudBlazor components
Page.Locator(".mud-button")
Page.Locator(".mud-table")
// Test IDs (most stable)
Page.Locator("[data-testid='my-element']")Key Concepts
| Concept | Usage | Example |
| PageTest | Base class providing Page object | class MyTests : PageTest |
| Locator | Lazy element reference | Page.Locator("button") |
| Expect | Assertion API | await Expect(Page).ToHaveURLAsync(...) |
| Aspire Testing | Full stack integration | DistributedApplicationTestingBuilder |
| Auto-wait | Built-in waiting | Actions wait for actionability |
Common Patterns
JavaScript Error Detection
[Test]
public async Task NoJavaScriptErrors()
{
var errors = new List<string>();
Page.Console += (_, msg) =>
{
if (msg.Type == "error") errors.Add(msg.Text);
};
await Page.GotoAsync(_blazorUrl!);
await Page.WaitForLoadStateAsync();
var criticalErrors = errors.Where(e =>
!e.Contains("WASM") && !e.Contains("Blazor")).ToList();
Assert.That(criticalErrors, Is.Empty);
}Responsive Design Testing
[Test]
public async Task ResponsiveDesign_Works()
{
await Page.SetViewportSizeAsync(375, 667); // Mobile
await Page.GotoAsync(_blazorUrl!);
Assert.That(await Page.TextContentAsync("body"), Is.Not.Empty);
await Page.SetViewportSizeAsync(1920, 1080); // Desktop
await Page.ReloadAsync();
Assert.That(await Page.TextContentAsync("body"), Is.Not.Empty);
}Anti-pattern: locators declared but never clicked
When a page object declares a locator (EnrolDeviceButton, FooterNavSettings) but no test in the suite ever calls .ClickAsync() on it, you are paying the cost of maintaining the locator without getting any coverage from it. The smell is easy to miss in review: the locator exists, the test compiles, CI is green — but the underlying user gesture has never been exercised end-to-end.
This is exactly how the Citizen Wallet PWA shipped twelve broken navigation buttons (PR #698) past every CI gate. CitizenWalletPage declared EnrolDeviceButton + PresentButton, the test fixture imported them, but no test clicked them. The first time a real human clicked Enrol was on production — every nav button 404'd.
Discipline for new page objects:
- Every nav-triggering locator gets a corresponding
Click_RoutesTo<Page>test that asserts the URL after the click. - Every state-mutating button gets a click + assert-on-resulting-state test.
- If a locator is for an assertion target only (e.g.
EmptyState), document that — name it*Indicator/*Bannerso future contributors don't expect it to be clicked.
Stable selector convention — use data-testid attributes on every nav element rather than CSS path or text content. Pattern: kebab-case, scope-prefixed (footer-nav-settings, home-present-button, credential-detail-back-button). Survives MudBlazor markup churn; survives localisation.
Example test for a nav-button sweep — one TestCaseSource covering N buttons:
private static IEnumerable<TestCaseData> NavCases
{
get
{
yield return new TestCaseData("footer-nav-devices", "devices").SetName("Footer Devices → /wallet/devices");
yield return new TestCaseData("footer-nav-settings", "settings").SetName("Footer Settings → /wallet/settings");
// ... one row per nav element
}
}
[Test, TestCaseSource(nameof(NavCases))]
public async Task FooterNav_ClickRoutesToExpectedPage(string testId, string expectedSuffix)
{
await NavigateToWalletAndWaitForBlazorAsync();
await Page.Locator($"[data-testid='{testId}']").ClickAsync();
await Page.WaitForURLAsync($"**/wallet/{expectedSuffix}*", new() { Timeout = 5000 });
Assert.That(new Uri(Page.Url).AbsolutePath,
Does.StartWith($"/wallet/{expectedSuffix}"));
}Post-redeploy cache testing for PWAs
A PWA with year-cached entry-point JS (dotnet.js, blazor.webassembly.js — see the blazor skill on this) only breaks on return visits after a redeploy. CI's normal "fresh browser context, fresh container" Playwright runs miss it entirely.
Two cheap regression guards:
- HTTP cache-header probes — straight
HttpClientagainst the live PWA, assertdotnet.jsandblazor.webassembly.jscarryno-cache/must-revalidateand notimmutable. No browser needed, sub-second runtime. Seetests/Sorcha.UI.E2E.Tests/Docker/CitizenWallet/CitizenWalletNginxCacheHeadersTests.cs. - Browser context reuse across redeploy — non-trivial Playwright dance: visit
/wallet/, force fingerprint rotation (rebuild + recreate citizen-wallet container with a tagged content change), navigate again without clearing browser state, assert no wasm fetches 404. Phase 2 of issue #700.
See Also
- patterns - Locator strategies and assertions
- workflows - Test setup and CI integration
Related Skills
- See the xunit skill for unit testing patterns
- See the fluent-assertions skill for SignalR integration tests
- See the blazor skill for component architecture
- See the signalr skill for real-time notification testing
- See the docker skill for container-based test environments
Documentation Resources
Fetch latest Playwright .NET documentation with Context7.
How to use Context7:
- Use
mcp__context7__resolve-library-idto search for "playwright" - Prefer website documentation (
/websites/playwright_dev_dotnet) over source code - Query with
mcp__context7__query-docsusing the resolved library ID
Library ID: /websites/playwright_dev_dotnet
Recommended Queries:
- "Locators selectors best practices"
- "NUnit test fixtures setup teardown"
- "Wait for element network idle auto-waiting"
- "Assertions expect API"
- "Trace viewer debugging"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

