Is it possible to take cucumber option values from a java .properties file?
In this SO post, it shows that it is being passed from CLI.
Here's my sample class:
@RunWith(Cucumber.class)
@CucumberOptions(
features = {"resources/features/"},
glue = {"classpath:com/"},
tags = {"@foo, @bar"}
)
public class UITestRunner {
}
Instead of hardcoding the tags here, I'd like to take it from a property file. Any help is appreciated!
Cucumber will initially look for arguments provided by cucumber.api.cli.Main
or @CucumberOptions
But you can override them providing (in this particular order):
CUCUMBER_OPTIONS
cucumber.options
cucumber.properties
with a cucumber.options
propertyOnce one of described above options is found, it will be used. Overrides are provided in a variable (or property) called cucumber.options
or CUCUMBER_OPTIONS
. All values, except plugin arguments will override values provided by cucumber.api.cli.Main
or @CucumberOptions
. Plugin option will add up to the plugins specified by cucumber.api.cli.Main
or @CucumberOptions
.