Is there a way to get different report formats when running cucumber-jvm via command line?I'm looking to an equivalent forÂ@CucumberOptions(format = { "pretty", "html:target/cucumber", "json:target/cucumber.json" })Do I need to pass in several --format arguments in, or do I comma-separate the values?-Dcucumber.options="--format pretty, html:target/cucumber"
"-Dcucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.json"
cucumber.runtime.CucumberException: Only one formatter can use STDOUT. If you use more than one formatter you must specify output path with FORMAT:PATH_OR_URL
I'm probably overlooking something really simple and obvious here, but I thought I had only specified "pretty" as a STDOUT formatter?
Do I have to create the target folder first, maybe?
On Friday, June 27, 2014 2:21:56 PM UTC+1, Christian wrote:
On Friday, June 27, 2014 2:07:46 PM UTC+1, Christian wrote:Is there a way to get different report formats when running cucumber-jvm via command line?I'm looking to an equivalent forÂ@CucumberOptions(format = { "pretty", "html:target/cucumber", "json:target/cucumber.json" })Do I need to pass in several --format arguments in, or do I comma-separate the values?-Dcucumber.options="--format pretty, html:target/cucumber"I just tried to pass the following in via Build > Invoke Top-level Maven Targets > Advanced > Properties:cucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.jsonWhen I run that, it gets passed in as"-Dcucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.json"and I get the following error:cucumber.runtime.CucumberException: Only one formatter can use STDOUT. If you use more than one formatter you must specify output path with FORMAT:PATH_OR_URLI'm probably overlooking something really simple and obvious here, but I thought I had only specified "pretty" as a STDOUT formatter?
Do I have to create the target folder first, maybe?cucumber.options=src/test/resources/features --tags @a --format pretty:STDOUT --format html:target/cucumber-a --format json:target/cucumber-a.jsonseems to work...Â
Is that a bug?
Christian wrote:
On Friday, June 27, 2014 2:21:56 PM UTC+1, Christian wrote:
On Friday, June 27, 2014 2:07:46 PM UTC+1, Christian wrote:Is there a way to get different report formats when running cucumber-jvm via command line?I'm looking to an equivalent forÂ@CucumberOptions(format = { "pretty", "html:target/cucumber", "json:target/cucumber.json" })Do I need to pass in several --format arguments in, or do I comma-separate the values?-Dcucumber.options="--format pretty, html:target/cucumber"I just tried to pass the following in via Build > Invoke Top-level Maven Targets > Advanced > Properties:cucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.jsonWhen I run that, it gets passed in as"-Dcucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.json"and I get the following error:cucumber.runtime.CucumberException: Only one formatter can use STDOUT. If you use more than one formatter you must specify output path with FORMAT:PATH_OR_URLI'm probably overlooking something really simple and obvious here, but I thought I had only specified "pretty" as a STDOUT formatter?
You need to be aware of the "--format" option when used in -Dcucumber.options works differently than the other options, it adds the formatters specified in -Dcucumber.options to the ones specified in @CucumberOptions, so when you get the error you are likely to have two formatters wanting to write to standard out, the pretty formatter instance from @CucumberOptions and the pretty formatter instance from -Dcucumber.options.
Cucumber-JVM will use the options from @CucumberOptions that aren't overridden by the -Dcucumber.options statement.
cucumber.options=src/test/resources/features --tags @a --format pretty:STDOUT --format html:target/cucumber-a --format json:target/cucumber-a.jsonseems to work...Â
Yes, now the pretty formatter instance from -Dcucumber.options writes to the regular file STDOUT (check the file system, you will find it there), so then there is only the pretty formatter instance from @CucumberOptions writing to standard out.Is that a bug?
On Friday, June 27, 2014 6:45:49 PM UTC+1, Björn Rasmusson wrote:Christian wrote:
On Friday, June 27, 2014 2:21:56 PM UTC+1, Christian wrote:
On Friday, June 27, 2014 2:07:46 PM UTC+1, Christian wrote:Is there a way to get different report formats when running cucumber-jvm via command line?I'm looking to an equivalent forÂ@CucumberOptions(format = { "pretty", "html:target/cucumber", "json:target/cucumber.json" })Do I need to pass in several --format arguments in, or do I comma-separate the values?-Dcucumber.options="--format pretty, html:target/cucumber"I just tried to pass the following in via Build > Invoke Top-level Maven Targets > Advanced > Properties:cucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.jsonWhen I run that, it gets passed in as"-Dcucumber.options=src/test/resources/features --tags @a --format pretty --format html:target/cucumber-a --format json:target/cucumber-a.json"and I get the following error:cucumber.runtime.CucumberException: Only one formatter can use STDOUT. If you use more than one formatter you must specify output path with FORMAT:PATH_OR_URLI'm probably overlooking something really simple and obvious here, but I thought I had only specified "pretty" as a STDOUT formatter?
You need to be aware of the "--format" option when used in -Dcucumber.options works differently than the other options, it adds the formatters specified in -Dcucumber.options to the ones specified in @CucumberOptions, so when you get the error you are likely to have two formatters wanting to write to standard out, the pretty formatter instance from @CucumberOptions and the pretty formatter instance from -Dcucumber.options.Hi Björn,Now, that contrasts slightly with what you told me the other day... ;-)ÂCucumber-JVM will use the options from @CucumberOptions that aren't overridden by the -Dcucumber.options statement.Good to know, though...
cucumber.options=src/test/resources/features --tags @a --format pretty:STDOUT --format html:target/cucumber-a --format json:target/cucumber-a.jsonseems to work...Â
Yes, now the pretty formatter instance from -Dcucumber.options writes to the regular file STDOUT (check the file system, you will find it there), so then there is only the pretty formatter instance from @CucumberOptions writing to standard out.Is that a bug?Well, let me rephrase, then: how do I force a format for the Jenkins console on Continuous Integration when users have specified something else in the annotation?ÂPlease don't say "you can't"... ;-)
Regards,Christian