Install command
Provided
Automatically runs Playwright E2E tests when test files or page components are modified.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Provided
Config snippet
Provided
Copy snippet
Provided
Prerequisites
None
Platforms
1 listed
Difficulty
0/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Safety & privacy surface
1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens, permissions & scopes.
#!/bin/bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🎭 Playwright Test Runner - Analyzing file changes..."
# Check if this is a test file
if [[ "$FILE_PATH" == *.spec.ts ]] || [[ "$FILE_PATH" == *.spec.js ]] || [[ "$FILE_PATH" == *e2e*.ts ]]; then
echo "📝 Test file detected: $FILE_PATH"
echo "🎭 Running specific Playwright test..."
if command -v npx >/dev/null 2>&1; then
npx playwright test "$FILE_PATH" --reporter=list
if [ $? -eq 0 ]; then
echo "✅ E2E tests passed for $FILE_PATH"
else
echo "❌ E2E tests failed for $FILE_PATH"
fi
else
echo "⚠️ Playwright not found. Install with: npm install -D @playwright/test"
fi
elif [[ "$FILE_PATH" == *pages/*.tsx ]] || [[ "$FILE_PATH" == *app/*.tsx ]] || [[ "$FILE_PATH" == *components/*.tsx ]]; then
PAGE_NAME=$(basename "${FILE_PATH%.*}")
echo "🧩 Component/page detected: $PAGE_NAME"
echo "🎭 Running related E2E tests..."
if command -v npx >/dev/null 2>&1; then
# Try to find and run tests related to this component
npx playwright test --grep "$PAGE_NAME" --reporter=list 2>/dev/null
if [ $? -eq 0 ]; then
echo "✅ Related E2E tests passed for $PAGE_NAME"
else
echo "ℹ️ No specific tests found for $PAGE_NAME or tests failed"
# Run a basic regression test if available
npx playwright test --grep "regression" --reporter=list 2>/dev/null || echo "ℹ️ No regression tests available"
fi
else
echo "⚠️ Playwright not found. Install with: npm install -D @playwright/test"
fi
else
echo "ℹ️ File type not relevant for E2E testing: $FILE_PATH"
fi
echo ""
echo "💡 Playwright Testing Tips:"
echo " • Test files should end with .spec.ts, .spec.js, or contain 'e2e'"
echo " • Use page-specific test names to enable smart test detection"
echo " • Consider running full test suite before major releases"
echo " • Check Playwright configuration for browser settings"
echo ""
echo "🎯 Test analysis complete!"
exit 0{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/playwright-test-runner.sh",
"matchers": [
"write",
"edit"
]
}
}
}.claude/settings.local.json~/.claude/settings.json.claude/settings.json{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/playwright-test-runner.sh",
"matchers": ["write", "edit"]
}
}
}
#!/bin/bash
# Read the tool input from stdin
INPUT=$(cat)
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🎭 Playwright Test Runner - Analyzing file changes..."
# Check if this is a test file
if [[ "$FILE_PATH" == *.spec.ts ]] || [[ "$FILE_PATH" == *.spec.js ]] || [[ "$FILE_PATH" == *e2e*.ts ]]; then
echo "📝 Test file detected: $FILE_PATH"
echo "🎭 Running specific Playwright test..."
if command -v npx >/dev/null 2>&1; then
npx playwright test "$FILE_PATH" --reporter=list
if [ $? -eq 0 ]; then
echo "✅ E2E tests passed for $FILE_PATH"
else
echo "❌ E2E tests failed for $FILE_PATH"
fi
else
echo "⚠️ Playwright not found. Install with: npm install -D @playwright/test"
fi
elif [[ "$FILE_PATH" == *pages/*.tsx ]] || [[ "$FILE_PATH" == *app/*.tsx ]] || [[ "$FILE_PATH" == *components/*.tsx ]]; then
PAGE_NAME=$(basename "${FILE_PATH%.*}")
echo "🧩 Component/page detected: $PAGE_NAME"
echo "🎭 Running related E2E tests..."
if command -v npx >/dev/null 2>&1; then
# Try to find and run tests related to this component
npx playwright test --grep "$PAGE_NAME" --reporter=list 2>/dev/null
if [ $? -eq 0 ]; then
echo "✅ Related E2E tests passed for $PAGE_NAME"
else
echo "ℹ️ No specific tests found for $PAGE_NAME or tests failed"
# Run a basic regression test if available
npx playwright test --grep "regression" --reporter=list 2>/dev/null || echo "ℹ️ No regression tests available"
fi
else
echo "⚠️ Playwright not found. Install with: npm install -D @playwright/test"
fi
else
echo "ℹ️ File type not relevant for E2E testing: $FILE_PATH"
fi
echo ""
echo "💡 Playwright Testing Tips:"
echo " • Test files should end with .spec.ts, .spec.js, or contain 'e2e'"
echo " • Use page-specific test names to enable smart test detection"
echo " • Consider running full test suite before major releases"
echo " • Check Playwright configuration for browser settings"
echo ""
echo "🎯 Test analysis complete!"
exit 0
Complete hook script that performs automatic Playwright E2E test execution
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [ -z "$FILE_PATH" ]; then
exit 0
fi
echo "🎭 Playwright Test Runner - Analyzing file changes..."
if [[ "$FILE_PATH" == *.spec.ts ]] || [[ "$FILE_PATH" == *.spec.js ]]; then
echo "📝 Test file detected: $FILE_PATH"
if command -v npx >/dev/null 2>&1; then
npx playwright test "$FILE_PATH" --reporter=list
if [ $? -eq 0 ]; then
echo "✅ E2E tests passed for $FILE_PATH"
else
echo "❌ E2E tests failed for $FILE_PATH"
fi
fi
fi
exit 0
Complete hook configuration for .claude/settings.json to enable Playwright test execution on file changes
{
"hooks": {
"postToolUse": {
"script": "./.claude/hooks/playwright-test-runner.sh",
"matchers": ["write", "edit"]
}
}
}
Enhanced hook script for component-based test discovery and execution
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [[ "$FILE_PATH" == *pages/*.tsx ]] || [[ "$FILE_PATH" == *app/*.tsx ]]; then
PAGE_NAME=$(basename "${FILE_PATH%.*}")
echo "🧩 Component/page detected: $PAGE_NAME"
if command -v npx >/dev/null 2>&1; then
if npx playwright test --list --grep "$PAGE_NAME" 2>/dev/null | grep -q .; then
npx playwright test --grep "$PAGE_NAME" --reporter=list
else
npx playwright test --testPathPattern="$PAGE_NAME" --reporter=list 2>/dev/null || echo "ℹ️ No tests found for $PAGE_NAME"
fi
fi
fi
exit 0
Enhanced hook script with browser installation detection and automatic installation
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [[ "$FILE_PATH" == *.spec.ts ]] || [[ "$FILE_PATH" == *.spec.js ]]; then
if command -v npx >/dev/null 2>&1; then
if ! npx playwright install --dry-run chromium 2>/dev/null | grep -q 'chromium'; then
echo "🌐 Installing Playwright browsers..."
npx playwright install chromium
fi
echo "🎭 Running Playwright tests..."
npx playwright test "$FILE_PATH" --reporter=list --project=chromium
fi
fi
exit 0
Enhanced hook script for cross-browser test execution with Chromium, Firefox, and WebKit
#!/bin/bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // ""')
if [[ "$FILE_PATH" == *.spec.ts ]]; then
if command -v npx >/dev/null 2>&1; then
echo "🎭 Running Playwright tests with multiple browsers..."
npx playwright test "$FILE_PATH" --reporter=list --project=chromium --project=firefox --project=webkit
TEST_EXIT_CODE=$?
if [ $TEST_EXIT_CODE -eq 0 ]; then
echo "✅ All cross-browser tests passed"
else
echo "❌ Some cross-browser tests failed"
fi
fi
fi
exit 0
Browsers not installed after @playwright/test install. Run: 'npx playwright install' downloading Chromium/Firefox/WebKit. Or specific: 'npx playwright install chromium' for single browser. Verify browser installation. Test with various browser configurations.
--grep searches test descriptions not filenames. Use --testPathPattern: 'npx playwright test --testPathPattern="$PAGE_NAME"' or combine: '--grep "$PAGE_NAME" --testPathPattern=".*"'. Verify test naming. Test with various test patterns.
Hook lacks env variables or server not running. Check baseURL: set in playwright.config.ts. Or start server: add 'npm run dev &' before tests with cleanup: 'kill $!' after. Verify environment setup. Test with various server configurations.
No file type filtering. Restrict matchers: 'matchers': ['write:/*.spec.{ts,js}', 'edit:/*.spec.{ts,js}'] running only on test file changes. Or add path check excluding components. Verify matcher configuration. Test with various file types.
Fallback triggers on grep failure. Add existence check: 'if ! npx playwright test --list --grep "$PAGE_NAME" | grep -q .; then exit 0; fi' before running. Skip fallback if no matches. Verify test discovery. Test with various test structures.
Increase timeout in playwright.config.ts: test.setTimeout(60000) for 60 seconds. Or use --timeout flag: npx playwright test --timeout=60000. Verify test complexity. Test with various timeout values.
Verify browser installation: npx playwright install --help. Check browser-specific configuration in playwright.config.ts. Test browsers individually: --project=chromium. Verify browser compatibility. Test with various browser configurations.
Use --reporter=list for detailed output. Or --reporter=line for concise output. Verify reporter configuration. Check Playwright version compatibility. Test with various reporter options.
Playwright Test Runner - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Automatically runs Playwright E2E tests when test files or page components are modified. Open dossier | A PostToolUse hook that runs the matching test runner for a changed file's language — Jest or Vitest for JS/TS, pytest for Python, go test, or Maven/Gradle for Java — scoped to the edited file. Open dossier | Automatically run relevant tests when code changes are detected, with intelligent test selection and parallel execution. Open dossier | Automated accessibility testing and compliance checking for web applications following WCAG 2.1 and WCAG 2.2 guidelines. This hook automatically runs accessibility scans on HTML files after they are written or edited, using axe-core for comprehensive WCAG compliance testing. Open dossier |
|---|---|---|---|---|
| Next steps | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | hooks | hooks | hooks | hooks |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-09-19 | 2025-09-16 | 2025-09-16 | 2025-09-19 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs your project's test command automatically after each edit; tests execute arbitrary project code, so enable this only in a trusted repo and expect it to run frequently. The script invokes whichever runner it detects (npm test, npx vitest, pytest, go test, mvn/gradle); make sure the right one is installed so it does not run an unexpected command. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. | ✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling. |
| Privacy notes | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Runs locally and prints test output to the hook; that output can include file paths, test names, and any data your tests log. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. | ✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output. |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | | | | |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Set autoMode.hard_deny rules to block risky actions in auto mode.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.