Registry / testing / cypress-ctrf-json-reporter

cypress-ctrf-json-reporter

JSON →
library0.0.14jsnpmunverified

cypress-ctrf-json-reporter is a Cypress test reporter designed to generate JSON reports conforming to the Common Test Report Format (CTRF) open standard. Currently at version `0.0.14`, this package is in its early development stages, with releases primarily focused on dependency updates and repository hygiene, indicating a maintenance-oriented cadence rather than active feature development. Its primary differentiator is the strict adherence to CTRF, a community-driven specification that ensures uniform, framework-agnostic test reports. This standardization allows for consistent validation, merging, comparison, and analysis of test results across diverse programming languages and testing frameworks, thereby improving CI/CD pipeline integration and analytics. It seamlessly integrates into Cypress configurations, outputting a `ctrf-report.json` file by default.

npm install cypress-ctrf-json-reporter
INSTALL
IMPORT
SIG · CYPRESS-CTRF-JSON-
C
cypress-ctrf-json-reporter
testingjavascriptv0.0.14
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.

GenerateCtrfReport
const { GenerateCtrfReport } = require('cypress-ctrf-json-reporter')
import { GenerateCtrfReport } from 'cypress-ctrf-json-reporter'
For CommonJS (`.js`) files like `cypress.config.js` or `plugins/index.js`.
GenerateCtrfReport
import { GenerateCtrfReport } from 'cypress-ctrf-json-reporter'
import GenerateCtrfReport from 'cypress-ctrf-json-reporter'
For ES Modules (`.ts`, `.mjs`) files. `GenerateCtrfReport` is a named export.
GenerateCtrfReportOptions
import type { GenerateCtrfReportOptions } from 'cypress-ctrf-json-reporter'
For TypeScript users to explicitly type the options object passed to the reporter constructor.

Demonstrates how to install and configure the reporter within Cypress's `cypress.config.js` to generate a CTRF-compliant JSON report.

const { defineConfig } = require('cypress'); const { GenerateCtrfReport } = require('cypress-ctrf-json-reporter'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { // Implement node event listeners here new GenerateCtrfReport({ on, outputFile: 'my-custom-report.json', appName: 'My Cypress App', buildNumber: process.env.CI_BUILD_NUMBER ?? 'local' }); }, }, }); // To run: // npx cypress run
Debug
Known issues
gotchaThe package is still in early development (v0.0.x), which typically means API stability is not guaranteed, and breaking changes might occur in minor releases.
fix
Always review release notes carefully when upgrading. Consider pinning to exact versions for production environments.
affects: >=0.0.1
breakingCypress versions below v10 require a different installation approach, placing the reporter initialization in `cypress/plugins/index.js` instead of `cypress.config.js`'s `setupNodeEvents` function.
fix
For Cypress < v10, initialize the reporter within `cypress/plugins/index.js` as shown in the package's documentation, passing the `on` object directly.
affects: <10
Errors
Common errors & fixes
Only one listener can be registered for 'after:run' event. Multiple plugins are conflicting.
Cypress's plugin system allows only one listener per event. If multiple reporters or plugins try to register for the same lifecycle event (e.g., `after:run`), the last one registered overrides previous ones.
fix
Refer to the 'Handling Multiple Plugins in Cypress' section in the reporter's README for guidance on how to manage and merge multiple event listeners, ensuring all plugins work together without conflict. This often involves a custom `setupNodeEvents` helper.
TypeError: GenerateCtrfReport is not a constructor or function.
This usually indicates that the `GenerateCtrfReport` symbol was not correctly imported or required, or that the `new` keyword was omitted when instantiating the class.
fix
Ensure `const { GenerateCtrfReport } = require('cypress-ctrf-json-reporter')` (for CJS) or `import { GenerateCtrfReport } from 'cypress-ctrf-json-reporter'` (for ESM/TS) is used, and always instantiate it with `new GenerateCtrfReport({...})`.
Upgrade
Version history
0.0.14latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
cypress-ctrf-json-reporter — npm install cypress-ctrf-json-reporter · libregistry