JPeetz/agent-skills / skills/qa-testing/playwright-e2e-testing
playwright-e2e-testing
VerifiedUse this skill when writing, debugging, or maintaining Playwright end-to-end tests in TypeScript, JavaScript, or Python. Covers test structure and architecture (Page Object Model, fixtures, custom matchers), locator strategy (role-based, test-ID, accessible selectors), auto-waiting and retry, API/network mocking, visual regression, component testing (React, Vue, Svelte), accessibility audits (axe-core), device emulation, authentication and session management (multi-profile, OAuth, 2FA), performance testing (Web Vitals, Lighthouse), CI/CD configuration (GitHub Actions, GitLab CI, sharding), flaky test detection and auto-healing, test data/fixtures, i18n testing, Electron and browser extension testing, security testing (XSS, CSRF, CSP), and WebSocket testing. Designed for agentic platforms β Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, GitHub Copilot, Windsurf, OpenCode, and all SKILL.md-compatible agents.
| File | Kind | Size |
|---|---|---|
| CHANGELOG.md | markdown | 2.2 KB |
| LICENSE | other | 1.0 KB |
| SKILL.md | skill md | 23.4 KB |
| evals/evals.json | config | 5.3 KB |
| references/ci-cd-patterns.md | markdown | 2.5 KB |
| references/locator-strategies.md | markdown | 3.0 KB |
| references/testing-types-matrix.md | markdown | 3.2 KB |
| scripts/flake-detector.shexecutable | script | 2.0 KB |
| scripts/generate-auth-profile.ts | script | 3.4 KB |
| scripts/validate-playwright-setup.shexecutable | script | 2.2 KB |
scripts/flake-detector.sh
View on GitHub#!/bin/bash
# flake-detector.sh β Runs a Playwright test suite repeatedly to detect flaky tests
# Usage: ./flake-detector.sh [--runs=10] [--grep="pattern"] [--project="name"]
set -euo pipefail
RUNS=10
GREP_FILTER=""
PROJECT=""
SPEC_FILE="${1:-}"
while [[ $# -gt 0 ]]; do
case "$1" in
--runs=*) RUNS="${1#*=}"; shift ;;
--grep=*) GREP_FILTER="--grep ${1#*=}"; shift ;;
--project=*) PROJECT="--project ${1#*=}"; shift ;;
*) SPEC_FILE="$1"; shift ;;
esac
done
if [ -z "$SPEC_FILE" ]; then
echo "Usage: ./flake-detector.sh <spec-file> [--runs=10] [--grep=pattern]"
echo "Example: ./flake-detector.sh e2e/tests/checkout.spec.ts --runs=20"
exit 1
fi
echo "π¬ Flake Detector β Running '$SPEC_FILE' $RUNS times"
echo "================================================"
PASSES=0
FAILURES=0
FLAKES=0
PREVIOUS_RESULT=""
# Disable retries to expose flakes
export PLAYWRIGHT_RETRIES=0
for i in $(seq 1 $RUNS); do
printf "Run %2d/%d... " "$i" "$RUNS"
if npx playwright test "$SPEC_FILE" $GREP_FILTER $PROJECT --reporter=line 2>&1 | tail -1 | grep -q "passed"; then
RESULT="PASS"
PASSES=$((PASSES + 1))
else
RESULT="FAIL"
FAILURES=$((FAILURES + 1))
fi
echo "$RESULT"
if [ -n "$PREVIOUS_RESULT" ] && [ "$RESULT" != "$PREVIOUS_RESULT" ]; then
FLAKES=$((FLAKES + 1))
fi
PREVIOUS_RESULT="$RESULT"
done
echo ""
echo "================================================"
echo "π Results for $SPEC_FILE:"
echo " Passes: $PASSES/$RUNS"
echo " Failures: $FAILURES/$RUNS"
echo " Flakes: $FLAKES (result changes between runs)"
echo ""
if [ $FLAKES -gt 0 ]; then
echo "β οΈ FLAKY TEST DETECTED β Result changed between runs"
echo " Review test for: missing awaits, race conditions, time dependencies"
echo " Run with --debug to step through: npx playwright test $SPEC_FILE --debug"
exit 1
elif [ $FAILURES -gt 0 ]; then
echo "β TEST FAILED consistently β Not flaky, genuinely broken"
exit 1
else
echo "β
TEST IS STABLE β $RUNS/$RUNS passed consistently"
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |