Registry / testing / playwright-ctrf-json-reporter

playwright-ctrf-json-reporter

JSON →
library0.0.29jsnpmunverified

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-reporter
INSTALL
IMPORT
SIG · PLAYWRIGHT-CTRF-JS
P
playwright-ctrf-json-reporter
testingjavascriptv0.0.29
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

playwright-ctrf-json-reporter
reporter: [['playwright-ctrf-json-reporter', { outputFile: 'report.json' }]]
import { CTRFReporter } from 'playwright-ctrf-json-reporter'; // This package is a Playwright plugin, not a directly importable class
This package is a Playwright reporter configured via a string literal in `playwright.config.ts` within the `reporter` array. It does not export symbols for direct programmatic import and instantiation in user code.

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.

import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: [ ['list'], // Optional: Use default 'list' reporter alongside CTRF ['playwright-ctrf-json-reporter', { outputFile: 'ctrf-report.json', // Optional: Customize output file name outputDir: 'test-results/ctrf', // Optional: Specify output directory minimal: false, // Optional: Generate comprehensive report (default: false) screenshot: true, // Optional: Include screenshots in the report annotations: true, // Optional: Include annotations testType: 'e2e', // Optional: Specify test type appName: 'MyPlaywrightApp', // Optional: Application name appVersion: '1.2.3', // Optional: Application version osPlatform: process.platform, // Optional: OS platform (example using Node.js process info) osRelease: process.release.name // Optional: OS release name }] ], use: { trace: 'on-first-retry', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, { name: 'firefox', use: { ...devices['Desktop Firefox'] } }, { name: 'webkit', use: { ...devices['Desktop Safari'] } } ] }); // To run tests and generate report: // npx playwright test
Debug
Known issues
breakingAs a package in early development (version 0.0.x), breaking changes may be introduced in minor or patch releases without strictly adhering to semantic versioning until a 1.0.0 release. Always review the changelog when updating.
fix
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"`).
affects: >=0.0.1
gotchaBy default, the reporter generates a comprehensive report (`minimal: false`), but specific details like screenshots and annotations are excluded unless explicitly enabled. Users expecting these details might be surprised by their absence in default reports.
fix
Explicitly set `screenshot: true` and `annotations: true` in your `playwright.config.ts` reporter options if you require these details in your CTRF report.
affects: >=0.0.1
gotchaThe default `outputDir` for the generated CTRF report is the project root (`.`), which can clutter the main project directory. The default `outputFile` is `ctrf-report.json`.
fix
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.
affects: >=0.0.1
Errors
Common errors & fixes
Reporter 'playwright-ctrf-json-reporter' not found
The package is either not installed, or there is a typo in the reporter name within `playwright.config.ts`.
fix
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.
Error: EACCES: permission denied, open '/path/to/ctrf-report.json'
The Node.js process running Playwright tests does not have sufficient write permissions for the specified `outputDir`.
fix
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.
Upgrade
Version history
0.0.29latest on npm
Audit
Dependencies
@ctrf/corerequiredProvides core Common Test Report Format (CTRF) utilities and data structures required for report generation.
Agent activity
8 hits · last 30 days
node
8
Resources
playwright-ctrf-json-reporter — npm install playwright-ctrf-json-reporter · libregistry