Playwright Reporter SDK

Full API reference for the @vera-ci/playwright-reporter package.

Installation

pnpm add -D @vera-ci/playwright-reporter

Basic usage

playwright.config.ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: [
    ["html", { open: "never" }],
    [
      "@vera-ci/playwright-reporter",
      {
        apiKey: process.env.VERA_API_KEY,
        projectId: process.env.VERA_PROJECT_ID,
        uploadTraces: true,
        uploadVideos: true,
      },
    ],
  ],
});

Reporter options

The VeraReporterOptions interface:

OptionTypeDefaultDescription
apiKeystringVERA_API_KEY envYour Vera CI API key
projectIdstringVERA_PROJECT_ID envYour Vera CI project ID
baseUrlstringhttps://api.vera-ci.comAPI server URL
branchstringauto-detectedGit branch name
commitShastringauto-detectedGit commit SHA
commitMessagestringauto-detectedGit commit message
pullRequestNumbernumberauto-detectedPR/MR number
pullRequestUrlstringauto-detectedFull PR/MR URL
uploadTracesbooleantrueUpload Playwright traces
uploadVideosbooleantrueUpload test videos
failOnUploadErrorbooleanfalseFail the test run if upload fails
printSummarybooleantruePrint upload summary to console
tagsstring[][]Custom metadata tags for the run

Environment variables

VariableDescription
VERA_API_KEYAPI key (used if apiKey option is not set)
VERA_PROJECT_IDProject ID (used if projectId option is not set)

CI auto-detection

The reporter automatically detects your CI provider and extracts git metadata from environment variables. If no CI provider is detected, it falls back to running local git commands.

GitHub Actions

Env VariableUsed For
GITHUB_HEAD_REF / GITHUB_REF_NAMEBranch name
GITHUB_SHACommit SHA
GITHUB_REFPR number (extracted from refs/pull/N/merge)
GITHUB_SERVER_URL + GITHUB_REPOSITORYPR URL construction

CircleCI

Env VariableUsed For
CIRCLE_BRANCHBranch name
CIRCLE_SHA1Commit SHA
CIRCLE_PR_NUMBERPR number
CIRCLE_PULL_REQUESTPR URL

GitLab CI

Env VariableUsed For
CI_COMMIT_REF_NAMEBranch name
CI_COMMIT_SHACommit SHA
CI_MERGE_REQUEST_IIDMR number
CI_MERGE_REQUEST_URLMR URL

Upload behavior

The reporter uploads results as a multipart POST to {baseUrl}/v1/runs with Bearer token authentication.

Upload details:

Uploads have a 5-minute timeout with automatic retry (3 attempts with exponential backoff: 1s, 2s, 4s). The reporter does not throw errors by default. If an upload fails, it logs a warning and returns null. Set failOnUploadError: true to change this behavior.

Console output

When printSummary is enabled, the reporter prints a summary after upload:

  [Vera] Uploading results...

[Vera] Run uploaded successfully
12 tests · 10 passed · 2 failed · 15 snapshots
1 flaky
    → https://vera-ci.com/org/team/project/runs/abc123