Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Record local test results

Share the traces, screenshots and videos of a Playwright Test or Vitest run that is not reported to Currents, as one session

Sometimes an agent writes a test only to check its change, runs it once, and does not keep it. The run is not reported to Currents, but its traces, screenshots and videos show that the change works. Attach them to a session, and the reviewer gets one link to the test results instead of a summary in the chat.

For tests that stay in your suite and run in CI, report them to Currents instead. See Prove a change with CI tests.

What you need

The Currents CLI and a key. See Install the Currents CLI and set a key.

Playwright Test

Turn on what you want to keep for this run:

// playwright.config.ts
use: { trace: 'on', screenshot: 'on', video: 'on' },

Run the tests, then attach the whole test-results folder:

npx playwright test
npx currents session start --project-id <project-id> --title "Lowercase discount code" --status failed
npx currents session attach test-results
npx currents session share
A terminal: npx playwright test with one failed and one passed test, then currents session start, attach test-results, which lists the trace, screenshots, videos and error-context.md of each test, and share

Playwright writes one subfolder per test in test-results, and session attach takes them all: the trace, screenshots, video and error-context.md, the page snapshot Playwright saves when a test fails. Each trace opens in the trace player. To show what ran, also attach the JSON report or the console output of the run.

A failed session with the test error, and the files of two tests named by their test-results folder: screenshots, videos, traces, error-context.md and results.json. The failed test screenshot shows Apply stuck on Applying
Vitest

In Vitest browser mode with the Playwright provider, set browser.trace: 'on'. Vitest writes traces to a __traces__ folder and failure screenshots to a __screenshots__ folder, next to each test file. Start a session as for Playwright Test, then attach those folders and the output of the run:

Unit tests produce no browser files. Attach the output, the JSON report or the coverage summary, so the reader sees what ran and what passed.

Last updated

Was this helpful?