The `playwright-ctrf-json-reporter` package is a Playwright test reporter designed to generate test results in the Common Test Report Format (CTRF) as a JSON file. The CTRF standard, an open, community-driven initiative, aims to provide a consistent and language-agnostic format for test reports, allowing for uniform validation, merging, comparison, and analysis across diverse testing frameworks and programming languages. Currently at version 0.0.29, the package is in active early development, receiving frequent updates that introduce new features and address minor issues. Its primary differentiator is its strict adherence to the CTRF specification, ensuring that generated reports are fully compatible with CTRF-consuming tools, thereby providing enhanced test insights with detailed test information and configurable environment details. This allows for seamless integration into CI/CD pipelines that leverage the CTRF standard for unified test reporting.
npm install playwright-ctrf-json-reporterVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install the reporter and configure it in `playwright.config.ts` to generate a CTRF-compliant JSON report with custom options, including environment details.
Refer to the GitHub release notes and changelog for each update. Pin exact versions for stability in production environments (e.g., `"playwright-ctrf-json-reporter": "0.0.29"`).
Explicitly set `screenshot: true` and `annotations: true` in your `playwright.config.ts` reporter options if you require these details in your CTRF report.
Configure `outputDir: 'test-results/ctrf'` (or a similar path) in your `playwright.config.ts` to store reports in a dedicated directory. Also consider customizing `outputFile` if multiple reports are generated.
Ensure the package is installed as a dev dependency: `npm install --save-dev playwright-ctrf-json-reporter`. Verify the spelling in your `playwright.config.ts` file matches the package name exactly.
Adjust the `outputDir` in your `playwright.config.ts` to a directory where the process has write permissions, or manually change the file system permissions for the target directory.