Overriding Cucumber Options
There are several ways you can set the options used to control how Cucumber runs your features. Learning how they interact is useful if you want Cucumber to behave differently depending on how you invoke it. Let’s look at the various ways you can supply options to Cucumber and how they interact.
How Cucumber Overrides
Cucumber options initially get set by the arguments you provide to your runner—either directly on the command line for cucumber.api.cli.Main or using a @CucumberOptions annotation for the JUnit or TestNG runners.
Cucumber then looks to see if any option overrides have been provided. It looks in the following three places:
-
The OS environment variable CUCUMBER_OPTIONS
-
The Java system property cucumber.options ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access