Test Report Output using Cucumber - Selenium Ruby

2019-04-15 22:44发布

问题:

I'm looking to have reports output from my Cucumber tests. So far I can put the following:

cucumber features/feature_name.feature -f json -o C:/Reports

This will only produce a json report at the end of the test and you can't see the results as they're happening as you normally would with cucumber.

Can I get it to do both so that I will see the green/red steps within cmd and get the json report at the end?

Thank you

回答1:

You can add as many report formatters as you want.

To include the default "pretty" formatter and the "json" formatter:

cucumber features/feature_name.feature -f pretty -f json -o C:/Reports/results.txt


回答2:

It's now recommended to use -p json:C:/Reports/results.json.