I have some Cucumber tests that can be run from console with
rake cucumber
Is there a command line option to store test results to a text file?
Cucumber Reports You can then access them from your browser, where they will be rendered using the same HTML formatter that would be used on the desktop. The public beta is available at https://reports.cucumber.io where you will find a sample report and an FAQ.
From the main menu, select Run | Edit Configurations. or press Alt+Insert and select Cucumber Java from the list. After that, you can complete the configuration using the options on the right. For the description of each option, refer to Run/Debug configuration: Cucumber Java.
Cucumber uses reporter plugins to produce reports that contain information about what scenarios have passed or failed.
Either
Run cucumber
directly and use -o
. From cucumber --help
:
-o, --out [FILE|DIR]
Write output to a file/directory instead of STDOUT. This option
applies to the previously specified --format, or the
default format if no format is specified. Check the specific
formatter's docs to see whether to pass a file or a dir.
Run rake
with CUCUMBER_OPTS="-o whateverfile"
, i.e.
CUCUMBER_OPTS="-o whateverfile" rake cucumber # assuming you're using a Bourne family shell
or
rake CUCUMBER_OPTS="-o whateverfile" cucumber
Edit lib/tasks/cucumber.rake and add
t.cucumber_ops = '-o whateverfile'
to one or more of the Cucumber::Rake::Task
s
Or just redirect the output of the cucumber
command yourself:
cucumber > whateverfile
-o
is a little different than redirecting: it always prints the "progress" output to the screen. If you don't specify a format it puts the default "pretty" format in the file. If you do (e.g. cucumber -f html -o whateverfile
) it puts the format you specify in the file.
In case it matters, I'm using Ruby Cucumber 2.3.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With