Skip to content
Back to skills

Playwright E2e Mastery

ASecurity

Enforce standards for reliable, end-to-end (E2E) testing using Playwright. This skill focuses on the "User-Centric" testing model—verifying actual UI flows (Login, Checkout, Onboarding) rather than implementation details. It ensures low-flake, high-stability automation across Chromium, WebKit, and Firefox.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 24, 2026
testinggonodetestingdebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 24, 2026

npx -y skills add iDorgham/Workspace-Factory --skill playwright-e2e-mastery --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Playwright E2e Mastery?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Playwright E2e Mastery
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/idorgham-playwright-e2e-mastery/badge)](https://www.skillsdirectory.com/skills/idorgham-playwright-e2e-mastery)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
type: Skill
subagents: [core-validator, integrity-bot]
agents: [master-guide, swarm-router]
dependencies: [core-orchestration, global-sync]
version: 1.0.0
---



# 🎭 Playwright E2E Interaction Physics

## Purpose
Enforce standards for reliable, end-to-end (E2E) testing using Playwright. This skill focuses on the "User-Centric" testing model—verifying actual UI flows (Login, Checkout, Onboarding) rather than implementation details. It ensures low-flake, high-stability automation across Chromium, WebKit, and Firefox.

---

## Technique 1 — Locators over Selectors (Stability)
- **Rule**: Never use CSS or XPath selectors for interactive elements; always use Playwright's **User-Facing Locators**.
- **Protocol**: 
    1. Use `getByRole` (e.g., `role="button", name="Submit"`) to ensure accessibility is also tested.
    2. Use `getByText` or `getByLabel` for inputs.
    3. Use `getByTestId` only as a last resort for complex, non-semantic containers.
    4. Benefit: Tests become resilient to structural changes in the HTML.

---

## Technique 2 — Auto-Waiting & Network Interception
- **Rule**: Rely on Playwright's "Auto-Waiting" instead of manual `sleep()` or `timeout()` calls.
- **Protocol**: 
    1. Perform actions (click, fill) and let Playwright wait for the element to be visible/enabled.
    2. Use `route()` to mock flakey external APIs (e.g., Stripe, Google Maps) during E2E runs.
    3. Set `unroute` or specific assertions to ensure a real API call was attempted when testing integration.

---

## 🛡️ Critical Failure Modes (Anti-Patterns)

| Anti-Pattern | Result | Correction |
| :--- | :--- | :--- |
| **Flakey Timeouts** | Unreliable CI results | Increase "SlowMo" for debugging; use `waitForResponse` or `waitForURL` instead of arbitrary time delays. |
| **Testing Implementation Details** | Brittle tests | Focus on the "Output" (e.g., "Is the message visible?") rather than the "State" (e.g., "Is the variable true?"). |
| **Ignoring Screenshots/Videos** | Invisible failures | Always configure local test-reports to capture video and traces on the first failure. |

---

## Success Criteria (Playwright QA)
- [ ] 0 "Manual Sleeps" found in the test codebase.
- [ ] 100% of critical paths (User Journey) are covered by E2E tests.
- [ ] Tests run successfully in "Headless" mode on CI nodes.
- [ ] Parallel execution setup reduces full-suite time (e.g., < 10 mins).
- [ ] RTL specific interaction (e.g., Drawer opening from the left in AR) is verified.

Files in this skill

  • SKILL.md2.4 KB
  • core.py374 B
  • manifest.yaml192 B
  • tests/test_core.py314 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.