@rwx-cloud/playwright-rwx-reporter
v0.1.0
Published
Adds RWX retry metadata to Playwright's built-in JSON report.
Readme
Playwright RWX reporter
@rwx-cloud/playwright-rwx-reporter adds serial-group retry metadata to
Playwright's built-in JSON report. Captain can use this metadata to retry the
same serial boundary that Playwright retries automatically.
This package is a metadata shim. It does not replace or write the JSON report.
Install
npm install --save-dev @rwx-cloud/playwright-rwx-reporterConfigure
Put this reporter before Playwright's built-in JSON reporter:
import { defineConfig } from "@playwright/test";
export default defineConfig({
reporter: [
["list"],
["@rwx-cloud/playwright-rwx-reporter"],
["json", { outputFile: "playwright-results.json" }],
],
});Reporter order is required. This reporter adds the annotation in onTestEnd,
and the JSON reporter that follows it serializes the updated annotations.
For a test inside one or more serial suites, the reporter adds one annotation:
{
"type": "rwx:serial",
"location": {
"file": "/project/tests/example.spec.ts",
"line": 10,
"column": 6
}
}The location is the outermost serial suite. This is a safe retry boundary for nested serial suites. Tests with no serial ancestor are unchanged.
Compatibility
The reporter reads _parallelMode from Playwright's concrete Suite objects.
This property is a private Playwright API and can change without notice.
Compatibility tests cover Playwright 1.50.1 and 1.62.1 on supported Node.js versions. The package requires Node.js 20.1.0 or later and uses CommonJS.
Development
Install dependencies and run all checks:
npm ci
npm run checkTo run the integration test against one supported Playwright version:
npm install --no-save --no-package-lock @playwright/[email protected]
npm run test:integration
npm ciThe final npm ci restores the version in package-lock.json.
