Registry / testing / wdio-ctrf-json-reporter

wdio-ctrf-json-reporter

JSON →
library0.0.17jsnpmunverified

The `wdio-ctrf-json-reporter` is a WebdriverIO test reporter designed to generate JSON test reports adhering to the Common Test Report Format (CTRF) standard. As of version `0.0.17`, this package enables consistent, standardized reporting of test results, facilitating easier validation, merging, comparison, and analysis across various testing frameworks and languages. It is actively maintained with frequent minor updates, focusing on bug fixes, dependency updates, and feature enhancements like improved URL building and handling of retried specs. Its key differentiator is the adoption of the community-driven CTRF open standard, which aims to unify test reporting, providing a structured output for CI/CD integration and developer tooling. This reporter is essential for projects seeking interoperability and consistent data formats for their WebdriverIO test outcomes.

npm install wdio-ctrf-json-reporter
INSTALL
IMPORT
SIG · WDIO-CTRF-JSON-REP
W
wdio-ctrf-json-reporter
testingjavascriptv0.0.17
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.

Reporter Configuration String
reporters: [['ctrf-json', { outputDir: 'ctrf', minimal: false }]]
import { CtrfJsonReporter } from 'wdio-ctrf-json-reporter'
Reporters are configured in `wdio.conf.ts` using a string identifier, not directly imported into user code.
Reporter Options Type (if needed for advanced configuration)
import type { CtrfJsonReporterOptions } from 'wdio-ctrf-json-reporter';
While rarely directly imported, the options type can be useful for strict TypeScript configurations or dynamic reporter instantiation.
CommonJS Configuration (older projects)
reporters: [['ctrf-json', { appName: 'My App' }]]
const CtrfReporter = require('wdio-ctrf-json-reporter'); reporters: [CtrfReporter]
WebdriverIO reporters are specified by their string name in the configuration array, regardless of ES Modules or CommonJS context.

Demonstrates installation, configuration within `wdio.conf.ts` with common options, and the recommended `ctrf-cli` merge step for parallel test execution.

npm install --save-dev wdio-ctrf-json-reporter // wdio.conf.ts or wdio.conf.js import type { Options } from '@wdio/types'; export const config: Options.WebdriverIO = { // ... other WebDriverIO configuration ... runner: 'local', specs: [ './test/specs/**/*.ts' ], // ... reporters: [ ['ctrf-json', { outputDir: 'ctrf', minimal: false, testType: 'e2e', appName: 'MyWebApp', buildName: `CI_BUILD_${process.env.BUILD_NUMBER ?? 'local'}`, // Example dynamic option buildNumber: process.env.BUILD_NUMBER ?? '1.0.0' }] ], // ... }; // After running tests (e.g., via `npx wdio run wdio.conf.ts`): // To merge reports from parallel execution: // npx ctrf merge ctrf
Debug
Known issues
gotchaAs a 0.0.x release, this package's API and behavior may not be fully stable. Minor version bumps can introduce breaking changes without explicit notification typical of semantic versioning (e.g., 1.0.0+).
fix
Pin to exact patch versions (`0.0.x`) and regularly review release notes for updates. Consider `npm audit` and `npm outdated` frequently.
affects: >=0.0.1
breakingWebdriverIO v5 and above handle reporting on a per-session basis for parallel execution, meaning this reporter will generate multiple CTRF JSON files (one per spec file/worker) in the `outputDir`.
fix
Use the `ctrf-cli` package to merge individual reports into a single, consolidated CTRF JSON file after test execution: `npx ctrf merge <outputDir>`.
affects: >=0.0.1
gotchaEnsure the `outputDir` specified in the reporter options is correctly configured and accessible. If not set, it defaults to 'ctrf' in the project root.
fix
Explicitly set `outputDir` in the reporter options: `outputDir: 'my-reports-folder'` and verify directory permissions.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Reporter 'ctrf-json' could not be found. Did you install it?
The reporter package is not installed or not correctly listed in `devDependencies`.
fix
Run `npm install --save-dev wdio-ctrf-json-reporter` to ensure the package is installed.
Multiple JSON files generated for parallel tests, not a single report.
This is expected behavior for WebdriverIO v5+ reporters running in parallel. Each test runner/worker generates its own report.
fix
Use the `ctrf-cli` tool to merge all individual reports into one: `npx ctrf merge <directory-with-reports>`.
Report file is empty or missing data for certain tests.
Configuration issues, incorrect test status mapping, or tests failing before reporter hooks can execute.
fix
Review `wdio.conf.ts/js` for correct reporter setup. Check WebdriverIO logs for test failures or unhandled exceptions that might prevent reporter events from firing correctly. Ensure `minimal: false` is set if you need full report details.
Upgrade
Version history
0.0.17latest on npm
Audit
Dependencies
webdriveriorequiredPeer dependency; this package functions as a reporter for WebdriverIO test runs.
ctrf-clioptionalRecommended for merging multiple CTRF JSON reports, especially when running WebdriverIO tests in parallel.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
wdio-ctrf-json-reporter — npm install wdio-ctrf-json-reporter · libregistry