Cucumber Commands

To execute all tests in the test suite, just run the cucumber command from the root folder of your project, as follows:

cucumber

To run a subset of tests, you can specify a single or multiple feature files to run, which will execute all the scenarios in those files, e.g:

cucumber features/registration.feature
cucumber features/registration.feature features/login.feature

If you have tagged features or scenarios, you can run, for example:

cucumber --tags @smoke
cucumber --tags '@daily or @wip'

You can also specify the output format (HTML or JSON). If no format is specified, the test results will be displayed in the terminal:

cucumber --format html > html-reports/reportOct25.html
cucumber --format json > json-reports/reportOct25.json

The –publish option saves an HTML report that can be shared for 24 hours via a temporary link on the official Cucumber website:

cucumber --publish

The –dry-run switch tells Cucumber to parse the files without executing them, and will tell you if your Gherkin isn’t valid:

cucumber --dry-run

When running parallel tests, you can specify the number of processors to be used:

parallel_cucumber -n 4