Registry / testing / cucumber-html

cucumber-html

JSON →
library0.2.4jsnpmunverified

Cross-platform HTML formatter for all Cucumber implementations (JVM, JS, etc.). Current stable version is 0.2.4, with low release cadence (last release in 2016). Generates HTML5-compliant reports, replaces old PDF formatter. Supports wkhtmltopdf for PDF conversion. Minimalistic with no dependencies.

npm install cucumber-html
INSTALL
IMPORT
SIG · CUCUMBER-HTML
C
cucumber-html
testingjavascriptv0.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

formatter
✓ import formatter from 'cucumber-html'
✗ const formatter = require('cucumber-html')
Default export; no named exports.
default
✓ const formatter = require('cucumber-html')
CommonJS require works, but package is designed for Node.js; no ESM wrapper.
None (script usage)
✓ // CLI usage only: cucumber-html can be used programmatically via JSON stream
✗ import { format } from 'cucumber-html'
No named exports; use default import and call with JSON data.

Generates an HTML report from Cucumber JSON output and writes to a file.

import formatter from 'cucumber-html'; import { createWriteStream } from 'fs'; const cucumberJson = { "name": "My Features", "elements": [{ "name": "Scenario: Passing", "steps": [{"name": "Given a step", "result": {"status": "passed"}}] }] }; formatter(cucumberJson) .pipe(createWriteStream('report.html'));
Debug
Known issues
deprecatedPackage has not been updated since 2016; consider using @cucumber/cucumber's built-in formatter or cucumber-html-reporter.
fix
Use '@cucumber/cucumber' with '--format html' or switch to 'cucumber-html-reporter'.
affects: >=0.0.0
gotchaRequires HTML5-compliant browser; may not render correctly in old browsers.
fix
Use a modern browser or wkhtmltopdf for PDF.
affects: >=0.0.0
gotchaInput JSON must follow Cucumber's JSON format exactly; any deviation may cause errors.
fix
Ensure JSON is produced by a supported Cucumber implementation.
affects: >=0.0.0
Errors
Common errors & fixes
formatter is not a function
Incorrect import: using named import instead of default.
fix
Use `import formatter from 'cucumber-html'` (no curly braces).
Cannot find module 'cucumber-html'
Package not installed or missing from package.json.
fix
Run `npm install cucumber-html`.
TypeError: formatter(...).pipe is not a function
formatter returns a readable stream, but the input object might be missing required properties.
fix
Ensure the JSON object has a 'name' property and 'elements' array with valid scenarios.
Upgrade
Version history
0.2.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
cucumber-html — npm install cucumber-html · libregistry