@qamadness/qam-playwright-reporter
v0.3.0
Published
Playwright reporter that submits test results to a QAM Hub instance.
Maintainers
Readme
@qamadness/qam-playwright-reporter
Playwright custom reporter that submits test results to a QAM Hub instance after a run finishes.
Install
npm i -D @qamadness/qam-playwright-reporterConfigure
In playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['json', { outputFile: 'test-results/report.json' }],
['@qamadness/qam-playwright-reporter', {
apiUrl: process.env.QAM_API_URL!, // e.g. https://qam.example.com/api
projectId: process.env.QAM_PROJECT_ID!, // UUID from QAM Hub → Automation Runs page
runName: `CI Run ${process.env.CI_BUILD_NUMBER ?? new Date().toISOString().slice(0, 16).replace('T', ' ')}`,
// apiToken is read from QAM_API_TOKEN env var automatically
}],
],
});Auth
Generate a Bearer token in QAM Hub → Profile → API Tokens and expose it as the
QAM_API_TOKEN environment variable (CI secret). Never commit it.
Linking to manual cases
Prefix test titles with TC-<number> to auto-link automation results to their
manual test cases in QAM Hub:
test('TC-42: user can log in', async ({ page }) => { /* ... */ });Options
| Option | Type | Required | Default | Description |
| ---------------- | --------- | -------- | ----------------------------- | ---------------------------------------------- |
| apiUrl | string | yes | — | Base URL of the QAM Hub API (no trailing /). |
| projectId | string | yes | — | QAM Hub project UUID. |
| apiToken | string | no | process.env.QAM_API_TOKEN | Bearer token. |
| runName | string | no | ISO timestamp | Human-readable run name in QAM Hub. |
| jsonReportPath | string | no | test-results/report.json | Path to the Playwright JSON report. |
| disabled | boolean | no | false | Skip submission (useful for local runs). |
| autoDetectCiMeta | boolean | no | true | Auto-detect CI/git run metadata (see below). |
| branch | string | no | auto | Git branch — overrides auto-detection. |
| commitSha | string | no | auto | Git commit SHA — overrides auto-detection. |
| commitMessage | string | no | auto | Commit message (first line) — overrides auto. |
| ciBuildUrl | string | no | auto | Link to the CI build — overrides auto. |
| environment | string | no | auto | Environment label (e.g. staging). |
| triggeredBy | string | no | auto | CI actor — overrides auto-detection. |
CI run metadata
By default the reporter auto-detects the branch, commit SHA, commit message, CI
build URL, environment and triggering actor and shows them on each run in QAM Hub.
No configuration is needed — it recognizes GitHub Actions, GitLab CI, CircleCI,
Azure Pipelines, Bitbucket Pipelines, Travis CI, Drone, Buildkite, Jenkins and
TeamCity, and falls back to reading local git for anything a provider doesn't
expose (e.g. the commit message on GitHub).
Override any field explicitly via the options above, or disable detection entirely
with autoDetectCiMeta: false.
Videos & traces
When your Playwright config records videos (use: { video: 'on' | 'retain-on-failure' })
and/or traces (use: { trace: 'on' | 'retain-on-failure' }), the reporter uploads each
test's video and trace directly to QAM Hub's object storage (they're too large to embed in the
JSON payload) and links them to the run. In QAM Hub, the test details modal shows the video in an
inline player and offers the trace as a downloadable .zip (open it at
trace.playwright.dev).
Files larger than 50 MB are skipped. Upload failures never abort result submission — the run is still recorded without the media. Storage must be configured on the QAM Hub backend.
Requirements
Playwright >= 1.30. The json built-in reporter must be enabled — this reporter
reads the JSON report it produces.
Learn more
- Test management for Playwright — why and how to connect Playwright to QAM Hub.
- Uploading Playwright reports — step-by-step setup guide.
- QAM Hub — the test management platform.
License
MIT
