> ## 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 GitHub Actions Reporting

> Run Playwright in GitHub Actions and stream results to TestDino live, with sharded matrix jobs grouped into one run.

Stream Playwright test results from GitHub Actions to TestDino during the run. Use the AI prompt below, or follow the manual workflow sections.

## Prerequisites

* A <a href="https://app.testdino.com" target="_blank" rel="noopener noreferrer">TestDino account <Icon icon="arrow-up-right-from-square" size={12} /></a> with a project created
* A TestDino API key ([Generate API Keys](/guides/generate-api-keys))
* A Playwright test project (or clone the <a href="https://github.com/testdino-hq/TestDino-Example" target="_blank" rel="noopener noreferrer">TestDino Example Repository <Icon icon="arrow-up-right-from-square" size={12} /></a>)
* `@testdino/playwright` installed and configured in `playwright.config.ts|js|mjs`:

```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",
    }],
  ],
});
```

Keep any existing reporter entries, such as `['html']`. TestDino runs alongside them and streams results as the run executes.

## Set up with an AI agent

<Prompt description="Add a GitHub Actions workflow that streams Playwright results to TestDino." actions={["copy", "cursor"]}>
  Add a GitHub Actions workflow that streams Playwright tests to TestDino.

  **Requirements**

  * Secret name: TESTDINO\_TOKEN (store the project API key in repo secrets; never hardcode it)
  * Use @testdino/playwright in playwright.config with token: process.env.TESTDINO\_TOKEN and serverUrl: "[https://reporter.testdino.com](https://reporter.testdino.com)"
  * Job step: set env TESTDINO\_TOKEN from secrets and run npx playwright test
  * Checkout with fetch-depth: 0 so git metadata reaches TestDino
  * No separate upload step. Results stream during the run.
  * If sharding, pass the same --ci-run-id (or ciRunId) to every shard.

  Docs: [https://docs.testdino.com/guides/playwright-github-actions.md](https://docs.testdino.com/guides/playwright-github-actions.md)
</Prompt>

## Store the API Key

1. Go to your GitHub repository
2. Open **Settings → Secrets and variables → Actions**
3. Click **New repository secret**
4. Name: `TESTDINO_TOKEN`
5. Value: Your TestDino API key
6. Click **Add secret**

## Basic Workflow

Run your tests with `TESTDINO_TOKEN` set. Results stream to TestDino during the run, so no separate upload step is needed.

<Accordion title=".github/workflows/test.yml: Basic workflow">
  ```yaml .github/workflows/test.yml theme={null}
  name: Playwright Tests
  on: [push, pull_request]

  jobs:
    test:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v4
          with:
            fetch-depth: 0
        - uses: actions/setup-node@v4
          with:
            node-version: '20'

        - name: Install dependencies
          run: npm ci

        - name: Install Playwright
          run: npx playwright install --with-deps

        - name: Run tests with TestDino
          env:
            TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
            TESTDINO_SERVER_URL: https://reporter.testdino.com
          run: npx playwright test
  ```
</Accordion>

Results stream live even when tests fail, so failures land on the dashboard without an `if: always()` step.

## Sharded Tests

Run tests in parallel shards. Pass the same `ciRunId` to every shard so TestDino groups them into one run.

<Accordion title=".github/workflows/test.yml: Sharded workflow">
  ```yaml .github/workflows/test.yml theme={null}
  name: Playwright Tests
  on: [push, pull_request]

  jobs:
    test:
      runs-on: ubuntu-latest
      strategy:
        fail-fast: false
        matrix:
          shardIndex: [1, 2, 3, 4]
          shardTotal: [4]
      steps:
        - uses: actions/checkout@v4
          with:
            fetch-depth: 0
        - uses: actions/setup-node@v4
          with:
            node-version: '20'

        - name: Install dependencies
          run: npm ci

        - name: Install Playwright
          run: npx playwright install --with-deps

        - name: Run tests with TestDino
          env:
            TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
            TESTDINO_SERVER_URL: https://reporter.testdino.com
          run: npx tdpw test --ci-run-id "${{ github.run_id }}-${{ github.run_attempt }}" -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
  ```
</Accordion>

Set the `ciRunId` reporter option in `playwright.config` to the same value if you prefer running `npx playwright test` directly instead of `npx tdpw test`.

### Pipeline execution

After the workflow runs, GitHub Actions shows each matrix shard job in the workflow run view. Every shard streams its results, and TestDino merges them into one run.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/installation-and-setup/ci-setup/playwright-github-actions/github-testrun-pipeline-execution.webp" alt="GitHub Actions workflow run showing 4 matrix shard jobs, each streaming Playwright results to TestDino" />

### Results in TestDino

The test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data as tests complete.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/installation-and-setup/ci-setup/playwright-github-actions/github-actions-uploaded-testdino-testrunscreen.webp" alt="TestDino Test Runs dashboard showing streamed results from GitHub Actions with pass/fail counts and AI Insights" />

## Tag by Environment

Map branches to environments in project settings so runs route to the correct environment automatically. See [Environment Mapping](/guides/environment-mapping) for the pattern rules.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Results not appearing on the dashboard">
    Confirm `@testdino/playwright` is in your `playwright.config` `reporter` array and `TESTDINO_TOKEN` is set in the run step. Results stream during the run, so no separate upload step is required.
  </Accordion>

  <Accordion title="Sharded runs show up as separate runs">
    Pass the same `--ci-run-id` (or `ciRunId` reporter option) to every shard. Different values create one run per shard.
  </Accordion>

  <Accordion title="TESTDINO_TOKEN not found">
    Confirm the secret is set in **Settings → Secrets and variables → Actions**. Secret names are case-sensitive.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="CI Optimization" icon="gauge-high" href="/guides/playwright-ci-optimization">
    Reduce CI time with smart reruns
  </Card>

  <Card title="Environment Mapping" icon="code-branch" href="/guides/environment-mapping">
    Route test results to Dev, Staging, or Production by branch
  </Card>

  <Card title="Integrations" icon="puzzle-piece" href="/integrations/overview">
    Connect Slack, Jira, Linear, Asana, and more
  </Card>

  <Card title="GitHub App Integration" icon="github" href="/integrations/ci-cd/github">
    PR comments, CI checks, and pull request sync
  </Card>
</CardGroup>
