https://github.com/cucumber/html-formatter
HTML formatter for reporting Cucumber results
https://github.com/cucumber/html-formatter
bdd cucumber java javascript polyglot-release ruby tidelift
Last synced: about 1 month ago
JSON representation
HTML formatter for reporting Cucumber results
- Host: GitHub
- URL: https://github.com/cucumber/html-formatter
- Owner: cucumber
- License: mit
- Created: 2019-10-21T13:50:58.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-09-11T17:26:22.000Z (about 1 month ago)
- Last Synced: 2025-09-11T20:05:56.159Z (about 1 month ago)
- Topics: bdd, cucumber, java, javascript, polyglot-release, ruby, tidelift
- Language: C#
- Homepage: https://cucumber.io/
- Size: 6.98 MB
- Stars: 18
- Watchers: 70
- Forks: 5
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cucumber HTML Formatter
This is a cross-platform formatter that produces a pretty HTML report for Cucumber runs.
It is built on top of [@cucumber/react-components](https://github.com/cucumber/react-components) and works with *any*
Cucumber implementation with a `message` formatter that outputs [cucumber messages](https://github.com/cucumber/common/tree/main/messages).This formatter is built into the following Cucumber implementations:
* [cucumber-ruby](https://github.com/cucumber/cucumber-ruby/blob/main/lib/cucumber/formatter/html.rb)
* [cucumber-jvm](https://github.com/cucumber/cucumber-jvm/blob/main/core/src/main/java/io/cucumber/core/plugin/HtmlFormatter.java)
* [cucumber-js](https://github.com/cucumber/cucumber-js/blob/main/src/formatter/html_formatter.ts)
* [Reqnroll](https://github.com/reqnroll/Reqnroll/blob/main/Reqnroll/Formatters/Html/HtmlFormatter.cs)## Customizations
_Supported by: Java and .Net_
The formatter can be configured with:
* A custom page title and icon
* Additional CSS to support [styling react components](https://github.com/cucumber/react-components?tab=readme-ov-file#styling).
* Additional Javascript for other customisations.
* The default Javascript and CSS can be replaced to support building custom react components.## Contributing
The Java and Ruby packages are wrappers that bundle the build artefacts from the Javascript package.
Thus, to work on either the Java or Ruby packages, you will need to have installed Node.js first.
Once you have Node.js installed, you can use:
make prepare
This will build the Javascript package and copy the required artifacts to the Java and Ruby packages.
### Screenshots
In the JavaScript package, we use fixtures from the [Compatibility Kit](https://github.com/cucumber/compatibility-kit) (CCK) to generate sample reports, render them in a browser and check them against reference screenshots [with Playwright](https://playwright.dev/docs/test-snapshots).
If the tests fail, you can see actual vs expected screenshots plus a visual diff for each affected test in the `test-results` directory.
If fixtures are added or changed in the CCK, the screenshots will have to be updated accordingly. To do that, run:
```shell
npx playwright test --update-snapshots
```