pretty-formatter
Writes a rich report of the scenario and example execution as it happens
Usage
For usage in @cucumber/cucumber
, see https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#pretty
Options
featuresAndRules
- whether to include headings for Features and Rules (defaults totrue
)theme
- control over the styling of various elements (see below)
Themes
Here's the schema for a theme:
interface Theme {
attachment?: Style
dataTable?: {
all?: Style
border?: Style
content?: Style
}
docString?: {
all?: Style
content?: Style
delimiter?: Style
mediaType?: Style
}
feature?: {
all?: Style
keyword?: Style
name?: Style
}
location?: Style
rule?: {
all?: Style
keyword?: Style
name?: Style
}
scenario?: {
all?: Style
keyword?: Style
name?: Style
}
status?: {
all?: Partial<Record<TestStepResultStatus, Style>>
icon?: Partial<Record<TestStepResultStatus, string>>
}
step?: {
argument?: Style
keyword?: Style
text?: Style
}
tag?: Style
}
enum TestStepResultStatus {
UNKNOWN = "UNKNOWN",
PASSED = "PASSED",
SKIPPED = "SKIPPED",
PENDING = "PENDING",
UNDEFINED = "UNDEFINED",
AMBIGUOUS = "AMBIGUOUS",
FAILED = "FAILED"
}
Style
is any Node.js supported modifier or an array of them.
See the default theme for a good example. It's exported as CUCUMBER_THEME
, so you can clone and extend it if you'd like.