Skip to content

JPeetz/agent-skills / skills/qa-testing/playwright-e2e-testing

playwright-e2e-testing

Verified

Use 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.

FileKindSize
CHANGELOG.mdmarkdown2.2 KB
LICENSEother1.0 KB
SKILL.mdskill md23.4 KB
evals/evals.jsonconfig5.3 KB
references/ci-cd-patterns.mdmarkdown2.5 KB
references/locator-strategies.mdmarkdown3.0 KB
references/testing-types-matrix.mdmarkdown3.2 KB
scripts/flake-detector.shexecutablescript2.0 KB
scripts/generate-auth-profile.tsscript3.4 KB
scripts/validate-playwright-setup.shexecutablescript2.2 KB

scripts/validate-playwright-setup.sh

View on GitHub
#!/bin/bash
# validate-playwright-setup.sh β€” Validates Playwright installation and browser availability
# Usage: ./validate-playwright-setup.sh [--ci]
set -euo pipefail

CI_MODE=false
if [[ "${1:-}" == "--ci" ]]; then
  CI_MODE=true
fi

echo "πŸ” Validating Playwright setup..."

# Check Node.js
if ! command -v node &>/dev/null; then
  echo "❌ Node.js is not installed. Install Node.js 18+ first."
  exit 1
fi

NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
  echo "❌ Node.js 18+ required. Found: $(node -v)"
  exit 1
fi
echo "βœ… Node.js $(node -v)"

# Check Playwright package
if ! npx playwright --version &>/dev/null; then
  echo "⚠️  Playwright not found. Install with: npm install -D @playwright/test"
  exit 1
fi
echo "βœ… Playwright $(npx playwright --version)"

# Check browsers
BROWSERS=("chromium" "firefox" "webkit")
MISSING_BROWSERS=()

for browser in "${BROWSERS[@]}"; do
  if [ "$CI_MODE" = true ] && [ "$browser" != "chromium" ]; then
    continue  # In CI, only chromium is commonly needed
  fi
  if ! npx playwright install --dry-run "$browser" 2>/dev/null | grep -q "already installed"; then
    MISSING_BROWSERS+=("$browser")
  fi
done

if [ ${#MISSING_BROWSERS[@]} -gt 0 ]; then
  echo "⚠️  Missing browsers: ${MISSING_BROWSERS[*]}"
  echo "   Run: npx playwright install ${MISSING_BROWSERS[*]}"
  echo "   Or with deps: npx playwright install --with-deps ${MISSING_BROWSERS[*]}"
else
  echo "βœ… All required browsers installed"
fi

# Check config file
if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
  echo "βœ… playwright.config found"
else
  echo "⚠️  No playwright.config found in current directory"
fi

# Check test directory
if [ -d "e2e" ] || [ -d "tests" ] || [ -d "__tests__" ]; then
  echo "βœ… Test directory found"
else
  echo "⚠️  No e2e/ or tests/ directory found"
fi

if [ "$CI_MODE" = true ]; then
  echo ""
  echo "πŸ—οΈ  CI mode: installing system dependencies..."
  npx playwright install --with-deps chromium 2>/dev/null || \
    echo "⚠️  Could not auto-install system deps. Ensure Docker image includes them."
fi

echo ""
echo "βœ… Playwright validation complete."
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: 467kUpdated Claude CodeCodexVerifiedInstall
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: 467kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 193kUpdated Claude CodeCodexVerifiedInstall