JSON formatter
The built-in JSON formatter is deprecated and will be removed in a future release.
Cucumber uses reporter plugins to produce reports that contain information about what scenarios have passed or failed.
Some plugins are built-in, others have to be installed separately. You can also build your own.
This page documents built-in formatter plugins, custom formatters and some common third-party plugins. Available plugins may vary per programming language.
The easiest way to get started with reporting is to use the Cucumber Reports service.
Watch this video for a quick introduction or read the introductory blog post for more details.
Publishing to the Cucumber Reports service is currently supported in:
6.7.0
and above5.1.1
and above7.0.0
and aboveIf you don’t want to publish your reports to the Cucumber Reports service, you can generate local reports using one of the following built-in reporter plugins (also known as “formatters”):
message
progress
pretty
html
json
rerun
junit
testng
message
progress
pretty
html
json
rerun
junit
testng
message
html
json
progress
rerun
snippets
usage
There is also a “pretty” formatter available as an optional module @cucumber/pretty-formatter.
message
progress
pretty
html
json
rerun
junit
Cucumber implementations are extensible so that you can write and use your own formatter, or use a third-party one published by someone else. This involves creating a class that implements/extends the standard formatter interface.
Detailed documentation around how to use and write custom formatters in cucumber-js is available here:
Once you add your formatter class in the features/support
directory, you can reference it with the --format
flag:
cucumber --format MyModule::CustomFormatter
Once you add your formatter class, you can reference it with the --format
flag:
cucumber --format CustomFormatter
Once you add your formatter class, you can reference it with the --format
flag:
cucumber --format CustomFormatter
Cucumber uses an event-based API for its formatters. These formatters respond to several defined events, which are common across all official implementations under the Cucumber Messages standard.
There are also many third-party plugins:
You can help us improve this documentation. Edit this page.