> 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/resources/reporters/currents-playwright/console-output.md). Agents can also search and read this documentation through its [MCP server](https://docs.currents.dev/~gitbook/mcp).

# Console output

What @currents/playwright prints to the console by default: one line per test, the key context and error of each failed test, and a summary for coding agents. How to change it or get the full output b

With no output settings, `@currents/playwright` prints a short log that a person or a coding agent can read in CI:

1. The intro, with the Run URL.
2. One line per test. Under each failed or flaky test, a `Currents context:` block with the key context. Under each failed or interrupted test, its error, printed once.
3. The end-of-run summary.
4. After a run with failed or flaky tests, a **Summary for agents**: instructions for a coding agent and a public link to each of those tests' context.

The output comes from two settings: [`consoleOutput`](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md#consoleoutput), which defaults to `compact`, and [`contextLinks`](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md#contextlinks), which defaults to `true`. Both defaults are from `@currents/playwright` 2.10.0.

## Example

A run with one flaky test, one test that fails all 3 attempts, and one passing test:

```
📦 Currents reporter: <version> recording to project pRx4nC
🎭 Playwright: 1.56.1 3 tests in 1 project [chromium]
🌐 Run URL: https://app.currents.dev/run/8f3c2a1d9e7b4f60

================================================================

  passed [chromium] › search.spec.ts:4:5 › Search › shows suggestions while typing flaky (3 attempts)
     Currents context:
       Failed at step 12: Expect "toBeVisible" [expect] (5012ms), after step 11: Fill [pw:api] (35ms)
       Other attempts: #0 same error
  failed [chromium] › search.spec.ts:10:5 › Search › filters results by category (3 attempts)
     Currents context:
       Failed at step 9: Expect "toHaveText" [expect] (5004ms), after step 8: Click [pw:api] (88ms)
       Other attempts: #0 same error, #1 same error

  Error: expect(locator).toHaveText(expected) failed

  Locator:  getByTestId('total')
  Expected: "$42.00"
  Received: "$41.99"

  #... code frame and stack trace

  passed [chromium] › search.spec.ts:20:5 › Search › paginates results
  Test results: 3 overall, 2 passed, 0 skipped, 1 failed, 1 flaky
  #... the failed and flaky tests with dashboard links, the elapsed time, the artifact count and the Run URL

================================================================

🏁 Done!
  Preparing the summary for agents (2 tests)…

  Summary for agents
    Fix the 1 failed and 1 flaky tests below.
    1. Open each link: a Markdown page with the test's error, steps, files and trace.
       Fix the cause in the app or the test setup, not by loosening the test.
    2. For a test's history and flakiness, use the Currents MCP with run id
       8f3c2a1d9e7b4f60. No Currents MCP? Suggest the user add it:
       https://docs.currents.dev/ai/remote-mcp

    1 failed:
      [chromium] › search.spec.ts:10:5 › Search › filters results by category
        https://...

    1 flaky (failed, then passed on retry):
      [chromium] › search.spec.ts:4:5 › Search › shows suggestions while typing
        https://...
```

## Key context under a failed or flaky test

The `Currents context:` block shows what the reporter found about the failure, one line per item:

* **Failed at step**: the step that failed and the step before it, with their durations.
* **Browser console errors**: console errors around the time of the error.
* **Failed requests**: up to 3 requests that returned status 400 or higher within 2.5 seconds of the failure, as method, path and status. The query string is left out, and a request that got no response isn't listed.
* **Other attempts**: the other attempts that failed with the same error, numbered from 0 (`#0` is the first attempt). Attempts that passed or failed differently aren't listed.

The browser console errors and failed requests come from the Playwright trace of the attempt the block describes: the last attempt with an error. Without a trace for that attempt, for example with `trace: 'on-first-retry'` on a test that fails every attempt, the block shows neither. Each shows at most 3 entries, then `(+N more)`. A test with nothing to show prints no `Currents context:` header. The block comes with the `compact` preset, from `@currents/playwright` 2.9.0, and has no setting of its own.

## Summary for agents

After the end-of-run summary, the reporter asks Currents for a public link to the context of each failed or flaky test, and prints the links with instructions for a coding agent. Each link is a [Fix link](https://docs.currents.dev/ai/reference/share-links.md) to the test's Markdown context: its error, steps, files and trace. An agent reads it without a Currents account. The summary for agents is in `@currents/playwright` 2.7.0 and later, and on by default from 2.10.0. Its instructions point to the Currents MCP server from 2.9.0.

The link requests take at most 10 seconds. The reporter doesn't wait when the run has no failed or flaky tests, and the summary never changes the run's result or the exit code.

The summary prints with the `summary`, `compact` and `detailed` presets, not with `none`. It needs a recorded run and a record key. Each shard prints its own summary, and each `pwc-p` machine prints one for the tests it ran.

### What a link opens

A link lasts 1 day from when Currents created it. If the same test already has a link with more than an hour left, the reporter gets that link back, so a printed link can expire sooner. Currents builds its page each time the link is opened, from the test's current results, so a trace or screenshot that reaches Currents after the summary printed is on the page at the next read. The page leaves out the Git section, videos and the environment's project line. The error, steps, files and trace links stay.

{% hint style="warning" %}
Anyone who can read the CI log can open the links until they expire. If your CI logs are public, as in many open-source projects, set `contextLinks: false`, or ask an organization admin to turn off **Public share links**. See [What a link exposes](https://docs.currents.dev/ai/reference/share-links.md#what-a-link-exposes).
{% endhint %}

### Network and self-hosted Currents

The reporter requests the links from the Currents REST API at `api.currents.dev`, with the record key. If CI reaches the internet through an allow list, allow `api.currents.dev`. The links themselves point to `s.crts.sh`, so the agent that opens them needs that host. See [Network allow lists](https://docs.currents.dev/resources/network-allow-lists.md).

On a [self-hosted](https://docs.currents.dev/resources/authentication/ci-oidc/self-hosted.md) installation, set `CURRENTS_REST_API_URL` to the installation's REST API, next to `CURRENTS_API_URL`. The reporter treats the installation as self-hosted when `CURRENTS_API_URL` is set to anything other than `https://cy.currents.dev`. `CURRENTS_REST_API_URL` works with or without a trailing `/v1`. Without it, the reporter makes no request and, after a run with failed or flaky tests, prints one line instead of the summary:

```
  Summary for agents unavailable: set CURRENTS_REST_API_URL to your Currents REST API to get it.
```

### When the summary has no links

A test is listed without a link when it didn't finish recording within the 10 seconds, or Currents didn't find it. If no test gets a link, the summary is one line:

```
  Summary for agents unavailable.
```

No test gets a link when:

* an organization admin turned off **Public share links** in the organization settings. See [Turn off share links](https://docs.currents.dev/ai/reference/share-links.md#turn-off-share-links).
* the request timed out, or failed with a network or server error, for example because CI can't reach `api.currents.dev`.
* the organization, or its record key, hit the Currents API rate limit. Each shard, or each `pwc-p` machine, sends one request per 200 failed or flaky tests, and asks once more for tests that hadn't finished recording.

The reporter makes no request and prints nothing for the summary when the run isn't recorded, when there's no record key, when `contextLinks` is `false`, or when `consoleOutput` is `none`. To see why a request failed, run the reporter with debug mode on. See [Troubleshooting](https://docs.currents.dev/guides/troubleshooting-playwright.md).

## Get the previous output back

Versions before 2.10.0 print the `detailed` output and no summary for agents. To get that output back, set the two options with any [configuration source](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md#configuration-sources):

| What                       | `currents.config.ts`        | Environment variable               | CLI flag                        |
| -------------------------- | --------------------------- | ---------------------------------- | ------------------------------- |
| Full output for every test | `consoleOutput: "detailed"` | `CURRENTS_CONSOLE_OUTPUT=detailed` | `--pwc-console-output detailed` |
| No summary for agents      | `contextLinks: false`       | `CURRENTS_CONTEXT_LINKS=false`     | `--no-pwc-context-links`        |

{% code title="currents.config.ts" %}

```typescript
import type { CurrentsConfig } from "@currents/playwright";

const config: CurrentsConfig = {
  recordKey: process.env.CURRENTS_RECORD_KEY!,
  projectId: process.env.CURRENTS_PROJECT_ID!,
  consoleOutput: "detailed",
  contextLinks: false,
};

export default config;
```

{% endcode %}

The two options are independent: `consoleOutput: "detailed"` alone keeps the summary for agents, and `contextLinks: false` alone keeps the compact output. For the other presets, `none` and `summary`, see [`consoleOutput`](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md#consoleoutput).


---

# 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/resources/reporters/currents-playwright/console-output.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.
