> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdino.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Playwright Real-Time Reporting

> Stream Playwright results live to TestDino over WebSocket.

Real-time streaming sends Playwright test results to the TestDino dashboard as each test completes. Live progress, pass/fail counts, and per-worker activity appear on the Test Runs page while the run is still executing. Streaming is the default with `@testdino/playwright`, so no upload step is needed.

## Quick Reference

| Topic                                           | Link                              |
| :---------------------------------------------- | :-------------------------------- |
| [Enable streaming](#enable-real-time-streaming) | Toggle on the Test Runs page      |
| [Setup](#setup)                                 | Install reporter and stream tests |
| [WebSocket status](#websocket-status)           | Connection indicator and states   |
| [Multi-tab support](#multi-tab-support)         | BroadcastChannel coordination     |
| [Limitations](#known-limitations)               | Browser and scope caveats         |
| [FAQ](#faq)                                     | Common questions                  |

## Enable Real-Time Streaming

A toggle switch on the Test Runs page header controls the streaming mode. Flip it to enable live updates.

| Setting       | Detail                                          |
| :------------ | :---------------------------------------------- |
| Default state | OFF                                             |
| Persistence   | Saved to localStorage, persists across sessions |

When streaming is enabled:

* The **Active Test Runs** section renders at the top of the Test Runs page, showing runs currently executing.
* A **WebSocket status badge** indicates connection state.
* The onboarding setup guide switches to the **Real-time** tab.

## Setup

Install `@testdino/playwright` and add it to the `reporter` array in your Playwright config. This is the only entry TestDino needs. Other reporters (`html`, `list`) are optional and yours to keep.

```bash theme={null}
npm install @testdino/playwright
```

```typescript playwright.config.ts theme={null}
import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [
    ['@testdino/playwright', {
      token: process.env.TESTDINO_TOKEN,
      serverUrl: "https://reporter.testdino.com",
    }],
  ],
});
```

Set your token and run tests the way you already do. Results stream to TestDino as the run executes.

```bash theme={null}
export TESTDINO_TOKEN="$TESTDINO_TOKEN"
npx playwright test
```

<Accordion title="Prefer not to edit your config?">
  Run `tdpw test` instead of `npx playwright test`. Same result, no config change.

  ```bash theme={null}
  npx tdpw test -t "$TESTDINO_TOKEN" --server-url https://reporter.testdino.com
  ```

  It wraps `npx playwright test`, so any Playwright flag passes through, for example `npx tdpw test --project=chromium --shard=1/3`.
</Accordion>

Open the [Test Runs](/platform/playwright-test-runs) page. Active runs appear at the top with a live progress bar, pass/fail/skip counts, and per-worker detail.

## WebSocket Status

When real-time streaming is enabled, a status badge appears on the Test Runs page indicating the connection state.

| Status           | Meaning                                                    |
| :--------------- | :--------------------------------------------------------- |
| **Connecting**   | Establishing WebSocket connection to TestDino              |
| **Online**       | Connected and receiving live updates                       |
| **Offline**      | Connection lost; updates are paused                        |
| **Disconnected** | WebSocket closed; toggle streaming off and on to reconnect |

The badge is hidden when streaming is disabled.

## Active Test Runs

With streaming enabled, the Test Runs page displays a collapsible **Active Test Runs** section. Each active run shows a progress bar, live result counts, commit, branch, and CI source.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/optimize-ci/playwright-real-time-test-streaming/sharded-runs.webp" alt="Active test runs section showing live progress and result counts" />

For sharded runs, the run is labeled **SHARDED** with tabs for each shard. Select a tab to view its workers and currently executing tests.

## Multi-Tab Support

Only one browser tab opens a WebSocket connection to TestDino. This tab acts as the **primary tab**. Additional tabs receive updates through the browser's [BroadcastChannel API](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel).

* If you close the primary tab, another open tab promotes itself and opens a new WebSocket.
* All tabs display the same live data regardless of which tab holds the connection.

## Known Limitations

| Limitation       | Detail                                                                                |
| :--------------- | :------------------------------------------------------------------------------------ |
| Browser support  | Requires a browser that supports WebSocket and BroadcastChannel (all modern browsers) |
| Single project   | Each WebSocket connection is scoped to one project at a time                          |
| Local preference | The streaming toggle is per-browser, not synced across devices                        |

## FAQ

<AccordionGroup>
  <Accordion title="Will my test data be lost if I toggle streaming off?">
    No. Toggling streaming off does not affect historical data. All previously recorded runs, test cases, and analytics remain intact. The toggle only changes how new results are delivered to the dashboard.
  </Accordion>

  <Accordion title="What happens if the WebSocket disconnects mid-run?">
    Results keep sending. When the dashboard reconnects, it catches up to the current state. No test data is lost on the server side.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Node.js CLI" icon="node-js" href="/cli/testdino-playwright-nodejs">
    Full CLI reference and configuration options
  </Card>

  <Card title="Test Runs" icon="play" href="/platform/playwright-test-runs">
    View and filter completed and active test runs
  </Card>

  <Card title="CI Integration" icon="microchip" href="/guides/playwright-github-actions">
    Configure GitHub Actions for automated test runs
  </Card>

  <Card title="Getting Started" icon="rocket" href="/getting-started">
    Set up TestDino and run your first tests
  </Card>
</CardGroup>
