import {CucumberConfig} from '@serenity-js/cucumber/lib/cli'
public interface | source

CucumberConfig

Configuration options to be passed to Cucumber CLI. You can specify the options using either camelCase (i.e. retryTagFilter) or kebab-case (i.e. retry-tag-filter) as Serenity/JS will convert them to an appropriate format for you.

Member Summary

Public Members
public

colors: string

Enable/disable colors in output.

version 1.x
public

compiler: string

Step definitions and support files can be written in languages that transpile to JavaScript.

version 1.x - 3.x
public

format: string[] | string

Specify additional output formats, optionally supply PATH to redirect formatter output

public

formatOptions: object | string

Provide options for formatters

public

name: string

Only execute the scenarios with name matching the expression.

public

profile: string

In order to store and reuse commonly used CLI options, you can add a cucumber.js file to your project root directory.

public

require: string

Require files or node modules before executing features

public

rerun: *

Relative path to an output file produced by Cucumber.js rerun formatter.

public

retry: number

The number of times to retry a failing scenario before marking it as failed.

version 7.x
public

retryTagFilter: string

Only retry tests matching the given tag expression.

version 7.x
public

strict: boolean

Fail if there are any undefined or pending steps

public

tags: string[] | string

Only run scenarios that match the given tags.

public

worldParameters: object | string

Provide parameters that will be passed to the world constructor

Public Members

public colors: string version 1.x source

Enable/disable colors in output. Cucumber 1.x only! For Cucumber 2.x and above use formatOptions: { colorsEnabled: false }

Please note For Cucumber 2.x and above use the CucumberConfig#formatOptions instead.

Examples:

Disable colors in output in Cucumber 1.x
 colors: false
Disable colors in output in Cucumber 2.x and above
 formatOptions: { colorsEnabled: false }

public compiler: string version 1.x - 3.x source

Step definitions and support files can be written in languages that transpile to JavaScript. To do set the compiler option to <file_extension>:<module_name>

Please note For Cucumber 4.x and above use the CucumberConfig#require option instead.

Examples:

Enable TypeScript support in Cucumber 1.x - 3.x
 compiler: 'ts:ts-node/register'

public format: string[] | string source

Specify additional output formats, optionally supply PATH to redirect formatter output

public formatOptions: object | string source

Provide options for formatters

Examples:

Cucumber 1.x
 formatOptions: JSON.stringify({ option: 'value' })

public name: string source

Only execute the scenarios with name matching the expression.

public profile: string source

In order to store and reuse commonly used CLI options, you can add a cucumber.js file to your project root directory. The file should export an object where the key is the profile name and the value is a string of CLI options.

The profile can be applied with -p <NAME> or --profile <NAME>. This will prepend the profile's CLI options to the ones provided by the command line. Multiple profiles can be specified at a time.

If no profile is specified and a profile named default exists, it will be applied.

public require: string source

Require files or node modules before executing features

Examples:

Enable TypeScript support in Cucumber 4.x and above
 require: 'ts:ts-node/register'

public rerun: * source

Relative path to an output file produced by Cucumber.js rerun formatter. Please note that the name of the output file must start with an @ symbol.

Examples:

Saving details of failed scenarios to @rerun-output.txt
 format: [ 'rerun:@rerun-output.txt' ]
Re-running scenarios saved to @rerun-output.txt
 rerun: '@rerun-output.txt'

public retry: number version 7.x source

The number of times to retry a failing scenario before marking it as failed.

Examples:

Cucumber 7.x
 retry: 3

public retryTagFilter: string version 7.x source

Only retry tests matching the given tag expression.

Examples:

Cucumber 7.x
 retry: 3,
 retryTagFilter: '@flaky',

public tags: string[] | string source

Only run scenarios that match the given tags.

Please note: Cucumber 1.x requires the tags option to be an array of Cucumber tags, while Cucumber 2.x and above uses a string with a tag expression.

Examples:

Cucumber 1.x
// Run all scenarios tagged with `@smoketest`, but not with `@wip`:
tag: [ '@smoketest', '~@wip' ]
Cucumber >= 2.x
// Run all scenarios tagged with `@smoketest`, but not with `@wip`:
tag: '@smoketest and not @wip'

public worldParameters: object | string source

Provide parameters that will be passed to the world constructor

Examples:

worldParameters as string
 worldParameters: JSON.stringify({ isDev: process.env.NODE_ENV !== 'production' })
worldParameters as object
 worldParameters: { isDev: process.env.NODE_ENV !== 'production' }