Skip to content
aslakhellesoy edited this page Aug 13, 2010 · 9 revisions

Cucumber lets you store and reuse commonly used cucumber command line arguments for a project in a cucumber.yml file. This file must be in your project’s root directory, config or .config.

For example, by having this in your config/cucumber.yml:

default: --format profile features
html_report: --format progress --format html --out=features_report.html features  

You can reuse the arguments listed above:

cucumber --profile html_report

It is important to point out that by simply running ‘cucumber’ the default profile will be used (if a cucumber.yml file is found in the current directory).

Preprocessing with ERb

The cucumber.yml file is preprocessed by ERb; this allows you to use ruby code to generate values in the cucumber.yml file. So if you have several profiles with similar values you could do something like:

<% common = "--tags ~@wip --strict" %>
default: <%= common %> features  
html_report: <%= common %> --format progress --format html --out=features_report.html features  

Also see Running Features for more details about how to execute your features.

Clone this wiki locally