playwright-trace-debugging

Debug Playwright test failures by analyzing trace files using pwtrace CLI. Use this skill after Playwright tests fail and you have a trace.zip file. Teaches systematic debugging workflow from overview to detailed inspection (show → step → dom → console → screenshot → network).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "playwright-trace-debugging" with this command: npx skills add nathanl/playwright-trace-debugging/nathanl-playwright-trace-debugging-playwright-trace-debugging

Playwright Trace Debugging

Debug failed Playwright tests systematically using trace file analysis with pwtrace.

When to Use This Skill

  • After Playwright test failures when you have a trace.zip file
  • Debugging flaky or intermittent test failures
  • Understanding CI/CD test failures
  • When the Playwright Trace Viewer GUI isn't available
  • Getting LLM-friendly text output from trace files

Prerequisites

npm install -g pwtrace
# or use: npx pwtrace <command> trace.zip

Core Philosophy: Progressive Disclosure

Start broad and drill down only as needed. The workflow follows this pattern:

show → step → dom/console/screenshot/network
 ↓       ↓           ↓
Which  What     Why did it fail?
failed? happened?

Always start with pwtrace show trace.zip to identify which step(s) failed, then use targeted commands to investigate.

For command syntax and options, use:

pwtrace --help                    # Overview and workflow
pwtrace <command> --help          # Command-specific options

Debugging Decision Tree

Use this to quickly decide which command to run next:

❌ Test failedpwtrace show → identify failed step(s)

🔍 Step N failedpwtrace step N → understand what happened

📄 Selector issuespwtrace dom --step N --interactive → see available elements

  • Element not found? Use --selector button to find similar elements
  • Wrong element? Check attributes and state (disabled, hidden)

🐛 JavaScript errorspwtrace console --level error → find exceptions

  • Errors around specific step? Add --step N

🌐 Network issuespwtrace network --failed → find failed requests

  • Check for 4xx/5xx errors, timeouts, CORS issues

👁️ Visual confirmationpwtrace screenshot --step N --list → choose screenshot

  • Then extract with --index <N>

⏱️ Timing/flaky tests → Compare DOM across steps

  • pwtrace dom --step N vs --step N-1
  • Look for loading states, animations, async operations

Complete Example

Login test times out. Here's the investigation:

pwtrace show trace.zip          # Step 4 failed (click "Sign In")
pwtrace step trace.zip 4         # See console error
pwtrace dom --step 4 --interactive  # Button exists but is disabled
pwtrace console --step 4 --level error  # JS validation error
pwtrace network --failed         # API /validate-email returned 500
# Root cause: Backend validation API failing

Tips

  • Always start with show - Don't skip straight to debugging a specific step
  • Check DOM before screenshots - DOM is searchable and text-based
  • Use --interactive frequently - Quickly filters to actionable elements
  • Most commands support --format json - Pipe to jq or analyze programmatically
  • Compare before/after states - Use dom on both successful and failed steps

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated