Setting cucumber-jvm parameters in Maven from the command line

I am trying to set the "name" parameter for Cucumber in order to be able to run a specific function or script.

I introduced it

mvn test -DCucumber.Options--name="MyFeatureName" 

but it just runs all the functions and gives no errors.

Any ideas?

+7
source share
2 answers

Here is a snippet from the Cucumber-JVM repository on how to run the java-helloworld example by passing the cucumber options:

 mvn test -Dcucumber.options="--format json-pretty --glue classpath:cucumber/examples/java/helloworld src/test/resources" 

Keep in mind that it will override all parameters in the @ Cucumber.Options annotation that you specified in "RunCukesTest". I have not been able to work for my own tests, but maybe this will help.

So, it seems that you need to provide all the parameters necessary to start the cucumber, including the java class path and where the code is located using the "-glue" parameter.

+15
source

Your tests are performed in a separate JVM, so you need to specify this system property in the configuration of the test plugin (i.e. in the config or configuration of the failover plugin in your pom.xml).

0
source

All Articles