playwright-trace-analysis

Diagnose Playwright test failures by analyzing trace.zip archives, console output, network activity, and screenshots.

8.0k|560|Updated Mar 3, 2022
One-click install
npx skills add https://github.com/podman-desktop/podman-desktop --skill playwright-trace-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-trace-analysis
Source: https://github.com/podman-desktop/podman-desktop/tree/main/.agents/skills/playwright-trace-analysis
Command: npx skills add https://github.com/podman-desktop/podman-desktop --skill playwright-trace-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Debugging failing or flaky Playwright E2E tests from CI artifacts is slow and error-prone. This Skill performs root-cause analysis on Playwright trace archives, correlating trace steps, console logs, network requests, and screenshots to classify failures as app bugs, test bugs, flakiness, or environment issues.

Core Features & Use Cases

  • Trace-driven root-cause analysis: Parses trace.zip files via MCP tools or manual newline-delimited JSON parsing to find the first meaningful failure, not the cascade.
  • Failure classification: Categorizes failures as app bug, test bug, likely flaky, environment/infra, or unknown, with explicit confidence levels and evidence citations.
  • Multi-trace comparison: Compares passing vs failing traces or retry traces to isolate divergence points and distinguish deterministic failures from flakiness.
  • Use Case: A CI run fails with a locator timeout. Provide the trace.zip path and receive a structured report with an event timeline, cited evidence, root cause, ruled-out hypotheses, and a specific fix with file path and line reference.

Quick Start

Analyze the Playwright trace at tests/playwright/output/traces/login_test_trace.zip and tell me why the test failed.

Frequently Asked Questions about playwright-trace-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze a Playwright trace.zip file to find why a test failed?

Provide the path to the trace.zip and the analysis starts with an overview of trace steps, network activity, and screenshots. It identifies the first meaningful failure, corroborates with screenshots or network logs, and reports a root cause with cited evidence.

How to tell if a Playwright test failure is flaky or a real bug?

Compare traces across retries: a consistent failure at the same step indicates a deterministic app or test bug, while pass-on-retry with timing-sensitive signals like loading spinners suggests flakiness. Multiple traces failing identically should not be classified as flaky.

What if the Playwright trace viewer or MCP tool cannot parse my trace?

Manually created traces using the tracing.start/stop API may not be recognized by automated tools. Verify the zip contains trace.trace and trace.network files, then parse the newline-delimited JSON directly with the provided Python scripts.

Why does my Playwright trace show no console errors even though the test failed?

Application code often logs critical errors via console.log instead of console.error, so severity-only filtering misses them. Scan console messages at all levels for failure keywords like TypeError, fetch failed, ECONNREFUSED, and timeout.

Can Playwright trace analysis work with Electron app tests?

Yes, with caveats. Electron traces capture renderer-process console and network activity, but main-process API calls are not recorded. Watch for IPC errors, preload script failures, webview loading issues, and multi-window confusion.