Send E2E test results to PRLane

Send each repository's end-to-end test results to PRLane from GitHub Actions. See the latest run on every pull request and the tests that keep failing or flaking, with no secret to manage.

Send E2E results from GitHub Actions

Works with any repository that runs Playwright in GitHub Actions and writes a JSON report. No secret or token to manage.

Set it up with a coding agent

Paste this into Claude Code, Cursor or another coding agent working in your repository. It covers every step below.

Prompt for your agent
Set up this repository to send its Playwright end-to-end test results to PRLane from GitHub Actions. Do every step below, then show me the changes (open a pull request if you can).

Before you start, ask me for my PRLane organization alias and replace <your-org-alias> below with it.

1. Add the sender script. First search the repository for an existing copy of send-playwright-report.mjs. If there is one, use it instead of adding a second copy, and change the path in step 5 to point at it. Otherwise, from the repository root, run this and commit the downloaded file unchanged (it is one dependency-free file that needs Node 20 or later on the runner):

   curl -fsSL https://prlane.com/e2e-reports/send-playwright-report.mjs -o scripts/send-playwright-report.mjs

2. Find the GitHub Actions job that runs Playwright. If the tests are sharded across several jobs, use the job that merges the shard reports, or add one that downloads the shards' blob reports and runs `npx playwright merge-reports`. Results must come from one combined report.

3. Make sure that job writes a Playwright JSON report to test-results.json. Add the JSON reporter next to the existing reporters (for example `["json", { outputFile: "test-results.json" }]` in playwright.config) or, when merging shards, run `npx playwright merge-reports --reporter json <blob-report-dir> > test-results.json`. Keep the existing reporters working. A relative `outputFile` resolves against the folder that holds the Playwright config, not the repository root: if the config lives in a subfolder such as e2e/, the report lands there, so point `--report` in step 5 at that path (for example e2e/test-results.json), or anchor `outputFile` to the repository root. Check where the file actually ends up and make `--report` match it.

4. Give that job permission to request a GitHub Actions OIDC identity token. Add these job-level permissions, merging them with any the job already has (a job-level block replaces the workflow-level one, so keep anything else the job needs):

   permissions:
     contents: read
     id-token: write

5. Add this step to the same job, after the tests (and after the merge, for sharded runs):

   - name: Send E2E results to PRLane
     if: ${{ !cancelled() }}
     continue-on-error: true
     timeout-minutes: 3
     run: >-
       node scripts/send-playwright-report.mjs
       --report test-results.json
       --org <your-org-alias>

   Keep `if: ${{ !cancelled() }}` so failed test runs still report, and `continue-on-error: true` so the step never fails the workflow. If more than one job or workflow sends results for the same pull request, give each one its own `--suite <name>` (for example the workflow or job name). PRLane shows the newest run per suite, so sends without distinct suites replace each other.

Do not add any secret or token: PRLane authenticates the step with the job's OIDC token. When you're done, remind me that the repository must be connected to the PRLane organization, or its results are refused.

Or set it up yourself

  1. Connect the repository

    The repository must be connected to your PRLane organization. Results from any other repository are refused.

  2. Add the sender script to the repository

    One dependency-free file that runs on Node 20 or later. Download it or run this once, then commit it:

    Download command
    curl -fsSL https://prlane.com/e2e-reports/send-playwright-report.mjs -o scripts/send-playwright-report.mjs

  3. Let the job request a GitHub Actions identity token

    Add this to the job that has the Playwright JSON report (merge sharded reports first). It grants no other access.

    Job permissions
    permissions:
      contents: read
      id-token: write

  4. Add the step after your tests

    Workflow step
    - name: Send E2E results to PRLane
      if: ${{ !cancelled() }}
      continue-on-error: true
      timeout-minutes: 3
      run: >-
        node scripts/send-playwright-report.mjs
        --report test-results.json
        --org <your-org-alias>

    Optional: --suite name for each job or workflow when several send results for the same pull request, --report-url https://… to link an HTML report you host, and --pr 123 for events whose ref is not a pull request.

How it authenticates

The step asks GitHub for a short-lived OIDC token for the audience below. PRLane checks GitHub's signature, that the token names a repository connected to the org, and that the token is used only once. The run, commit and branch come from the token, not from the report.

OIDC audience
prlane-e2e-reports:<your-org-alias>

Results are informational and never block a merge: keep merge gates on GitHub checks.

Write a JSON report

The sender reads Playwright's JSON report. Add the JSON reporter for CI runs, and the HTML reporter if you want PRLane to host the report too.

playwright.config.ts
// playwright.config.ts
import { join } from "node:path";
import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: process.env.CI
    ? [
        ["json", { outputFile: join(process.cwd(), "test-results.json") }],
        ["html", { open: "never" }],
      ]
    : "list",
});

Playwright resolves a relative outputFile against the folder of the config file, not the working directory. Anchoring it with process.cwd() keeps the report where the workflow step looks for it, even for configs in subfolders.

Complete workflow

A single-job Playwright workflow that sends its results and uploads the HTML report. Replace <your-org-alias> with your organization's alias, the part after /orgs/ in PRLane URLs.

.github/workflows/e2e.yml
name: E2E
on: pull_request
jobs:
  e2e:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: npx playwright test
      - name: Send E2E results to PRLane
        if: ${{ !cancelled() }}
        continue-on-error: true
        timeout-minutes: 3
        run: >-
          node scripts/send-playwright-report.mjs
          --report test-results.json
          --org <your-org-alias>
          --html-report playwright-report

Sharded runs

Send once per workflow run, after merging the shards. Each shard writes a blob report; one job downloads them, merges them into HTML and JSON, and sends. Only the sending job needs id-token: write.

Sharded jobs
jobs:
  e2e:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        shard: [1/4, 2/4, 3/4, 4/4]
    steps:
      # checkout, install and browsers as above
      - run: npx playwright test --shard=${{ matrix.shard }} --reporter=blob
      - uses: actions/upload-artifact@v4
        if: ${{ !cancelled() }}
        with:
          name: blob-report-${{ strategy.job-index }}
          path: blob-report
          retention-days: 1

  report:
    if: ${{ !cancelled() }}
    needs: e2e
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - uses: actions/download-artifact@v4
        with:
          path: all-blob-reports
          pattern: blob-report-*
          merge-multiple: true
      - run: npx playwright merge-reports --reporter html ./all-blob-reports
      - run: npx playwright merge-reports --reporter json ./all-blob-reports
        env:
          PLAYWRIGHT_JSON_OUTPUT_NAME: test-results.json
      - name: Send E2E results to PRLane
        if: ${{ !cancelled() }}
        continue-on-error: true
        timeout-minutes: 3
        run: >-
          node scripts/send-playwright-report.mjs
          --report test-results.json
          --org <your-org-alias>
          --html-report playwright-report

  • Give each workflow its own --suite name when several report on the same pull request. The PR drawer shows the newest run per suite, so sends that share a suite replace each other.
  • Re-running a workflow sends a new attempt. PRLane keys runs by repository, run, attempt and suite, so a re-send of the same attempt replaces its earlier results instead of duplicating them.

Let PRLane host the HTML report

Add --html-report playwright-report to the sender step and PRLane stores Playwright's HTML report folder for the run, so you don't need a bucket of your own. The upload runs after the results are sent and uses a fresh GitHub token, so it needs no extra setup.

  • Limits: at most 2,000 files, 200 MB per file and 2 GB per report, with index.html at the root.
  • Open report in Fleet checks that you belong to the organization, then opens a signed link that lasts one hour.
  • Reports come from CI, so PRLane serves them in a locked-down sandbox with no access to your PRLane session. Playwright's trace viewer can't run there: download a trace and open it at trace.playwright.dev or locally.
  • If hosting isn't available on a deployment, the step says so in its log and your results are still recorded. Already host reports elsewhere? Use --report-url https://… to link yours instead.

Where results show up

  • Fleet PR drawer: an E2E tests block with the newest run per suite for that pull request, with its counts, failing tests and links to the report and the workflow run.
  • Fleet → E2E reports: recent runs across your repositories and the tests that fail or flake most often, for the organization or one workspace.

E2E results are informational and never block a merge. Any workflow on a branch can send results for its own run, so keep merge gates on GitHub's required checks.

API reference

Any test framework can send results with one request. The bundled script does exactly this for Playwright.

POST /api/e2e-reports/<org alias>/runs
  • Authorization: Bearer <GitHub Actions OIDC token> for the audience prlane-e2e-reports:<org alias>, at most 10 minutes old, used once.
  • JSON body, optionally Content-Encoding: gzip: at most 4 MB sent and 32 MB unpacked.
  • Repository, run, attempt, commit, branch and workflow come from the token. Sending the same run, attempt and suite again replaces its results.

Payload

{
  "version": 1,
  "suite": "full",
  "framework": "playwright",
  "reportUrl": "https://example.com/report/index.html",
  "headSha": "<40-hex PR head commit>",
  "startedAt": "2026-10-24T07:00:00.000Z",
  "durationMs": 371000,
  "tests": [
    {
      "file": "e2e/auth/login.spec.ts",
      "titlePath": ["Login"],
      "title": "signs in",
      "project": "chromium",
      "outcome": "flaky",
      "durationMs": 5120,
      "retries": 1,
      "error": "Timed out 5000ms waiting for …"
    }
  ]
}

outcome is the result after retries: passed, failed, flaky (passed on a retry) or skipped. Send setup or teardown errors as failed tests so the run never shows as passed. headSha is the pull request commit that was tested; a pull_request run's token names GitHub's merge commit instead.

Errors

CodeWhat to do
e2e_reports_disabledReceiving results is switched off on this deployment.
org_not_foundNo org with that alias: check --org and --base-url.
missing_tokenNo bearer token: give the job id-token: write.
bad_audienceThe token's audience is not prlane-e2e-reports:<org>.
repository_not_connectedConnect the repository to the org.
token_replayedEach token is single use; mint a new one to retry.
token_expiredRe-run the job; check the runner's clock.
body_too_largeOver 4 MB on the wire; gzip it or split suites.
invalid_bodyThe JSON does not match the payload below.

Get your PR fleet under control

Connect GitHub, see every open pull request across your repositories, and start merging the ready ones. The Free plan has no monthly fee.