> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/ai/agent-evidence/local-test-results.md).

# 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](https://docs.currents.dev/ai/agent-evidence.md), 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](https://docs.currents.dev/ai/agentic-testing/prove-a-change.md).

## What you need

The Currents CLI and a key. See [Install the Currents CLI and set a key](https://docs.currents.dev/ai/agent-evidence.md#install-the-currents-cli-and-set-a-key).

## Playwright Test

Turn on what you want to keep for this run:

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

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

```bash
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
```

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2Fgit-blob-396d4bb5ff43b0fa3f4abcebee966c35ccc5707f%2Fterminal-local-test-results.gif?alt=media" alt="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"><figcaption></figcaption></figure>

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.

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2Fgit-blob-076108c27fe8c6e4b018d30be1651d2e67314ca1%2Fsession-test-results.png?alt=media" alt="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"><figcaption></figcaption></figure>

<details>

<summary>Vitest</summary>

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:

```bash
npx vitest run > vitest-output.log
npx currents session attach src/checkout/__traces__ src/checkout/__screenshots__ vitest-output.log
npx currents session share
```

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.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/ai/agent-evidence/local-test-results.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
