bitovi/ai-enablement-prompts/debug-e2e-test

Claude Code and agent skill by bitovi/ai-enablement-prompts

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Debug and fix failing Playwright E2E tests. Use when tests fail, when asked to fix failing tests, or when investigating test failures. Analyzes test output, screenshots, error context, and uses Playwright MCP to identify root causes.

Install

npx vskill@latest install bitovi/ai-enablement-prompts/debug-e2e-test

SKILL.md

Skill: Debug E2E Test

Systematic workflow for debugging and fixing failing Playwright E2E tests.

When to Use

  • A Playwright E2E test is failing
  • Asked to fix a failing test
  • Investigating why tests are broken
  • Tests pass locally but fail in CI

Debugging Workflow

Step 1: Run the Specific Failed Test

Run ONLY the specific failing test:

bash
npx playwright test <test-file>.spec.ts -g "test name"
Step 2: Analyze the Test Output

Extract from terminal output:

  1. Test location: File path and line number
  2. Failure type: What assertion failed
  3. Expected vs Actual: What the test expected vs what it got
  4. Error message: The specific error
  5. Artifact paths: Screenshot and error-context locations
Step 3: Load the Screenshot

Use the screenshot from test results to see the visual state at failure time.

Step 4: Read the Error Context

Read any error-context.md file from test results:

  • DOM snapshot
  • Console logs
  • Network errors
Step 5: Read the Test Code

Understand what the test is trying to do, what selectors it uses, and what assertions it makes.

Step 6: Compare Test Expectations with Implementation
bash
grep -r "text the test looks for" src/ --include="*.tsx"

Check: routes, text content, element types, selectors.

Step 7: Use Playwright MCP (If Needed)

If artifacts don't reveal the issue:

  1. Navigate to the page
  2. Take a screenshot
  3. Get visible HTML
  4. Interact with elements
  5. Inspect behavior
Step 8: Fix the Issue

Fix the test, the code, or both.

Step 9: Verify the Fix
bash
npx playwright test <test-file>.spec.ts -g "test name"

Intermittent Failures — Non-Deterministic Data

If tests pass sometimes and fail other times:

Common Causes
  1. Sample generators using Date.now() or new Date()
  2. Missing seeds in mock handlers
  3. Stories without seeds
How to Diagnose
bash
npx playwright test <file>.spec.ts -g "test name"
npx playwright test <file>.spec.ts -g "test name"
# If results differ, you have non-deterministic data
How to Fix
  1. Update sample generators to use seeds
  2. Add seeds everywhere — never call sample functions without seeds

Tips

  1. Always run the single test first
  2. Start with artifacts — screenshot + error-context tell you 90% of issues
  3. Use MCP sparingly
  4. Check obvious things first — routes, text, element types
  5. One test at a time

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bitovi/ai-enablement-prompts/debug-e2e-test/badge)](https://verified-skill.com/skills/bitovi/ai-enablement-prompts/debug-e2e-test)

Something wrong with this skill or its page? Tell us.