Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added an example illustrating how to override options with cucumber.o…

…ptions.
  • Loading branch information...
commit 3f470c8c00d91268eff374c783ccc05b86168108 1 parent 3090b51
@aslakhellesoy aslakhellesoy authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 examples/java-helloworld/README.md
View
12 examples/java-helloworld/README.md
@@ -24,3 +24,15 @@ mvn test
This runs Cucumber features using the JUnit runner. The `@RunWith(Cucumber.class)` annotation on the `RunCukes` junit class
kicks off Cucumber.
+
+#### Overriding options
+
+The Cucumber runtime parses command line options to know what features to run, where the glue code lives, what formatters to use etc.
+When you use the JUnit runner, these options are generated from the `@Cucumber.Options` annotation on your test.
+
+Sometimes it can be useful to override these options without changing the JUnit class. This can be done with the `cucumber.options` system property. If it is specified it will override *all* options. Here is an example:
+
+```
+mvn test -Dcucumber.options="--format json-pretty --glue classpath:cucumber/examples/java/helloworld src/test/resources"
+```
+
Please sign in to comment.
Something went wrong with that request. Please try again.