GitHub

Attachments & Preview

Test attachments — screenshots, videos, traces, and logs — persisted to disk and inspected in the Universal Preview modal.

During test execution, Zen Reports for Playwright extracts every attachment Playwright produces — screenshots, videos, trace files, and stdout/stderr output — and persists it under <outputDir>/attachments/ in your report bundle. Attachments are then inspectable directly in the dashboard through the Universal Preview modal, without leaving the report.

Attachment items listed in a test case detail
Attachment items on the expanded test case card.

Where Attachments Appear

  • Test case detail: clickable attachment thumbnails and items inside the expanded test case detail open the preview modal.
  • Standard output: stdout and stderr blocks in the test case detail are clickable line-by-line and open in the same modal.
  • Failures tab: expanded failures show the same attachments and output (without the execution steps section).

Universal Preview Modal

One modal handles every attachment type:

Type What the preview shows
Screenshots & images Full-size image view with zoom and pan — click to enlarge; the lightbox also supports wheel zoom and panning.
Text (logs, stdout/stderr, JSON) Rendered text with an inline filter search (F focuses the search bar) for grepping long logs.
Video Inline playback of test video recordings.
Binary / other files File metadata (name, size, type) with a download action.
Screenshot preview in the Universal Preview modal
Screenshot attachment in the preview modal.
Text attachment preview with inline search
Text attachment preview with the inline filter search.
Video attachment preview in the modal
Video attachment playback in the modal.
Binary file preview showing metadata and download
Binary attachment preview: file metadata and download.

Keyboard Navigation

Inside the modal, when a test case has multiple artifacts:

Shortcut Action
P or ← View the previous attachment in the artifact carousel.
N or → View the next attachment in the artifact carousel.
F Focus the inline filter search bar (text artifacts and logs).
Esc Blur the search input if focused; close the previewer on the next press.

The full list lives in the Keyboard Shortcuts Guide.


Storage Notes

  • Attachments live on disk under <outputDir>/attachments/; the report records their relative paths (in SQLite history and the report JSON), and the dashboard resolves them from disk or fetches them on demand.
  • Migrating legacy history (see History Migration) does not move attachment binaries — only their references — so the attachments/ folder should be kept alongside history.db.
  • zr history clean removes orphaned attachments from disk when runs are purged (see CLI Reference).