What this skill teaches your AI coding agent
Playwright Resilient E2E Testing removes common sources of test flakiness from automated browser suites. The protocol enforces three rules: first, brittle CSS selectors and XPath hierarchies are strictly forbidden in favor of user-facing accessible locators such as getByRole and getByLabel. Second, arbitrary sleep commands like waitForTimeout are banned; agents must rely on web-first auto-retrying assertions that poll the DOM until criteria are met. Third, every test suite must seed and clean its own isolated state.
Playwright Resilient E2E Testing is an open-source testing skill licensed under CC0-1.0 that outlaws arbitrary sleeps and brittle CSS selectors in favor of accessible locators.
You need strict, reproducible guardrails enforcing testing & qa discipline across agent interactions.
You are building quick disposable prototypes where architectural consistency and test verification are unnecessary.
Activation boundaries & prompt triggers
- 💬 "User prompts: "End-to-end testing playbook enforcing accessibility locators, auto-retrying...""
- 💬 "User asks to write end-to-end browser tests or automate web UI regression checks."
- 💬 "When autonomous agent needs strict protocol guardrails"
- ⛔ Locate elements exclusively via user-visible accessibility roles, labels, and text.
- ⛔ Never use arbitrary time sleeps (page.waitForTimeout); rely on web assertions and auto-waiting.
- ⛔ Isolate test state completely between specs with independent browser contexts.
Inject into Claude.ai, Claude Code, or Cursor
Choose your agent runtime to install the playbook directly into local configuration.
.cursor/rules/playwright-resilient-testing.mdc---description: End-to-end testing playbook enforcing accessibility locators, auto-retrying assertions, and zero arbitrary sleep statements.globs: *alwaysApply: false---# Playwright E2E Testing StandardsWhen writing or debugging Playwright end-to-end tests:1. LOCATOR HYGIENE: - ONLY use user-facing accessible locators: `page.getByRole()`, `page.getByLabel()`, `page.getByPlaceholder()`, `page.getByText()`. - NEVER use arbitrary CSS class selectors, DOM IDs, or XPath hierarchies.2. ZERO ARBITRARY SLEEPS: - `page.waitForTimeout()` is STRICTLY FORBIDDEN. - Use auto-retrying assertions: `await expect(page.getByRole('button', { name: 'Submit' })).toBeEnabled();`3. NETWORK DETERMINISM: - Mock third-party external services using `page.route()`.Interactive file tree manifest & playbook viewer
Click any file to audit instructions, verification scripts, and architectural references before installation.
SKILL.md---
name: playwright-resilient-testing
description: "End-to-end testing playbook enforcing accessibility locators, auto-retrying assertions, and zero arbitrary sleep statements."
version: 1.0.0
license: CC0-1.0
compatibility: [claude-3-5-sonnet, cursor, windsurf, cline]
---
# Playwright Resilient E2E Testing Protocol
Playwright Resilient E2E Testing removes common sources of test flakiness from automated browser suites. The protocol enforces three rules: first, brittle CSS selectors and XPath hierarchies are strictly forbidden in favor of user-facing accessible locators such as getByRole and getByLabel. Second, arbitrary sleep commands like waitForTimeout are banned; agents must rely on web-first auto-retrying assertions that poll the DOM until criteria are met. Third, every test suite must seed and clean its own isolated state.
## Core Guardrails
- ⛔ Locate elements exclusively via user-visible accessibility roles, labels, and text.
- ⛔ Never use arbitrary time sleeps (page.waitForTimeout); rely on web assertions and auto-waiting.
- ⛔ Isolate test state completely between specs with independent browser contexts.
## Autonomous Activation Triggers
When user prompts:
- "User prompts: "End-to-end testing playbook enforcing accessibility locators, auto-retrying...""
- "User asks to write end-to-end browser tests or automate web UI regression checks."
- "When autonomous agent needs strict protocol guardrails"
Verified behavioral proof of work
Identical prompt executed with and without this skill under autonomous coding loops.
Execute Playwright Resilient E2E Testing Protocol under autonomous coding loops
2- // Baseline code3+ // Deterministic scoped patch complying with all protocol invariantsExecution safety and file access boundaries
Agent skills with executable scripts can run shell or Python utilities. Always audit scripts before execution.
- Scope: Bound to active workspace branch.
- Network Calls: Zero outbound network calls.
- AST Syntax Gate: Pre-flight verification blocks breaking mutations.
Operational triage & resolution runbook
Skill not triggering during user conversational prompt▼
Agent system prompt does not associate task keywords with the skill's trigger boundary.
Reference the skill name explicitly in your prompt (e.g., "Follow the rules in playwright-resilient-testing to perform this refactoring").
Conflicting rules with root project instructions▼
Global instructions (.cursorrules or CLAUDE.md) contradict the skill's invariants.
Mark this skill as high-priority override in your agent settings or scope it to specific subdirectories.
Context window saturation warning▼
Multiple skills loaded simultaneously without progressive disclosure.
Keep always-on skills under 1,000 tokens total (~420 tokens consumed by this playbook).
Skill vs. MCP Server vs. Plain System Prompt
| Primitive | Best Used When | Token Cost | Execution Risk |
|---|---|---|---|
| Agent Skill (`SKILL.md`) | Multi-step domain workflows & procedural guardrails | Low (~400 tokens) | Minimal (AST verified) |
| MCP Server | External system integrations (APIs, live databases) | Zero (until called) | Scoped by tool permissions |
| Plain System Prompt | Simple style guidelines & tone preferences | High (Always in context) | High drift risk |
Composable peers & official repository
Combine with Chrome DevTools Health Auditor for complementary agent steering across testing and refactoring.
Inspect SkillCombine with Mutation Testing & Fault Fuzzing Playbook for complementary agent steering across testing and refactoring.
Inspect SkillCombine with Verification Before Completion Protocol for complementary agent steering across testing and refactoring.
Inspect Skill