Playwright Trace CLI
Investigate Playwright test traces from the command line to pinpoint failed actions, requests, and page errors.
The skill restricts itself to Bash(npx:*) and includes an explicit close command to remove extracted data; however, it does not require confirmation, disclose that traces may contain sensitive requests, console data, DOM, screenshots, or attachments, or explain npx resolution and network data-flow risks, so points are deducted.
The workflow and command names are internally coherent and cover opening, querying, snapshots, and cleanup; however, dependencies are not version-pinned, failure behavior for invalid ZIPs, missing actions, unavailable browsers, or command errors is unspecified, and static files do not establish that the commands are runnable, so points are deducted.
The audience, trace ZIP input, investigation scenarios, and major output types are reasonably clear; boundaries, trigger conditions, environment requirements, and Chinese-language support are not defined, and npx network reachability for mainland-China users is unaddressed, so points are deducted.
The document has clear sections, examples, and a typical investigation flow; repository context supplies Apache-2.0 licensing, versioning, Microsoft ownership, README material, and release references. The skill itself lacks installation guidance, compatibility information, known limitations, FAQs, changelog details, and a concrete maintenance/update path, so points are deducted.
The commands cover core trace investigation tasks including actions, requests, console, errors, snapshots, and attachments, with outputs that appear directly useful; static evidence does not verify actual results, edge cases, or comparative benefit over manual inspection or Trace Viewer, and failures still require user diagnosis, so full marks are not justified.
The skill gives concrete, auditable commands and the supplied repository revision provides traceable context; however, no committed key-path tests, CI execution evidence, or independent reproduction evidence for this skill is supplied, so verification remains limited.
- Trace files may contain headers, bodies, page content, console data, screenshots, and attachments; review sensitivity before exposing outputs to untrusted environments.
- npx is not version-pinned and may require network package resolution, which can be unreliable on mainland-China or restricted networks; use a locally installed, version-matched Playwright CLI where possible.
- Failure handling, browser dependencies, and snapshot eval limitations are not documented; malformed or complex traces may require Trace Viewer or manual investigation.
What does this skill do, and when should you use it?
Playwright Trace CLI inspects ZIP traces produced by Playwright tests without opening a browser. It exposes trace metadata, action trees, requests, console output, errors, DOM snapshots, screenshots, and attachments. After `open`, subsequent commands operate on the active trace, and opening another trace replaces it. It is best suited to developers who already use Playwright and need a focused command-line workflow for debugging test failures.
Uses npx playwright trace to open and extract a .zip trace and report browser, viewport, duration, and action or error counts; list and filter actions; inspect an action's parameters, logs, source location, and snapshots; list or filter requests, console messages, and errors; load an action's DOM snapshot for an accessibility snapshot, DOM evaluation, or screenshot; list and extract attachments; and remove extracted trace data with close.
- An end-to-end test developer uses `actions --errors-only` to identify the action that failed.
- An engineer investigating API behavior filters requests by URL or method and uses `requests --failed` to find HTTP failures.
- A test maintainer uses `console --errors-only` and `errors` to inspect browser messages and stack traces.
- A developer reconstructing page state at failure time uses `snapshot <action-id>` to inspect a DOM snapshot or capture a screenshot.
- An automation engineer uses `attachments` and `attachment` to review files captured in a trace.
What are this skill's strengths and limitations?
- Covers actions, requests, console output, errors, DOM snapshots, screenshots, and attachments in one CLI workflow.
- Supports filtering by action title, failure state, URL, HTTP method, and failed status.
- Can evaluate DOM expressions against a frozen snapshot to inspect specific page content.
- Well suited to repeatable debugging in command-line and automation environments.
- It handles Playwright trace ZIP files, not general browser automation or test execution.
- Only one trace is active at a time; opening a new trace replaces the current one.
- The skill restricts its declared tool access to `Bash(npx:*)`, so other clients may need permission adjustments.
- The source provides no skill-specific test suite, independent version information, or cross-platform validation evidence.
How do you install this skill?
The README documents installing the Playwright CLI with npm install -g @playwright/cli@latest, followed by optional skill installation with playwright-cli install --skills. The source does not document standalone placement or installation for this individual SKILL.md.
How do you use this skill?
Open a trace first: npx playwright trace open test-results/my-test/trace.zip. Then inspect it with npx playwright trace actions, and, as needed, use npx playwright trace action 12, npx playwright trace requests --failed, npx playwright trace console --errors-only, or npx playwright trace snapshot 12. Run npx playwright trace close when finished to remove extracted data.
How does this skill compare with similar options?
The README presents npx playwright show-trace trace.zip and Trace Viewer as a graphical trace-viewing option. This skill instead provides a command-line investigation workflow with filtering for actions, requests, console output, errors, snapshots, and attachments.