1
votes

I have a tool that runs a cucumber features each day, but the problem is that report always has the same name as previous and yesterdays report can be overriden by the current. My cucumber.yml looks like this:

...
default-report: FIG_NEWTON_FILE=default.yml --color --format html --out results/report.html
...

I have an idea of renaming previously generated reports in hooks and move them to some archive folder, but that looks way to complicated for such small thing. Is there a way to generate cucumber report name with some timestamp instead of hardcode it in the cucumber.yml?

1

1 Answers

3
votes

The cucumber.yml file is preprocessed by ERb.So you can use ruby code to generate values in the cucumber.yml file as you like.

To have a timestamp in your report file name, you can do something like below:

default-report: FIG_NEWTON_FILE=default.yml --color --format html --out results/<%= Time.now.strftime("%Y%m%d-%H%M%S") %>-report.html