Playwright Reporter SDK
Full API reference for the @vera-ci/playwright-reporter package.
Installation
pnpm add -D @vera-ci/playwright-reporterBasic 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:
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | VERA_API_KEY env | Your Vera CI API key |
projectId | string | VERA_PROJECT_ID env | Your Vera CI project ID |
baseUrl | string | https://api.vera-ci.com | API server URL |
branch | string | auto-detected | Git branch name |
commitSha | string | auto-detected | Git commit SHA |
commitMessage | string | auto-detected | Git commit message |
pullRequestNumber | number | auto-detected | PR/MR number |
pullRequestUrl | string | auto-detected | Full PR/MR URL |
uploadTraces | boolean | true | Upload Playwright traces |
uploadVideos | boolean | true | Upload test videos |
failOnUploadError | boolean | false | Fail the test run if upload fails |
printSummary | boolean | true | Print upload summary to console |
tags | string[] | [] | Custom metadata tags for the run |
Environment variables
| Variable | Description |
|---|---|
VERA_API_KEY | API key (used if apiKey option is not set) |
VERA_PROJECT_ID | Project 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 Variable | Used For |
|---|---|
GITHUB_HEAD_REF / GITHUB_REF_NAME | Branch name |
GITHUB_SHA | Commit SHA |
GITHUB_REF | PR number (extracted from refs/pull/N/merge) |
GITHUB_SERVER_URL + GITHUB_REPOSITORY | PR URL construction |
CircleCI
| Env Variable | Used For |
|---|---|
CIRCLE_BRANCH | Branch name |
CIRCLE_SHA1 | Commit SHA |
CIRCLE_PR_NUMBER | PR number |
CIRCLE_PULL_REQUEST | PR URL |
GitLab CI
| Env Variable | Used For |
|---|---|
CI_COMMIT_REF_NAME | Branch name |
CI_COMMIT_SHA | Commit SHA |
CI_MERGE_REQUEST_IID | MR number |
CI_MERGE_REQUEST_URL | MR 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