Skip to content

Environment Variables

cobaltroad edited this page May 27, 2011 · 6 revisions

When you are Running Features it can sometimes be handy to pass special values to Cucumber so that they can be picked up in your Step Definitions. You can easily do this on the command line:

cucumber FOO=BAR --format progress features

You can now pick up ENV['FOO'] in ruby (for example in env.rb or a step definition) and take actions according to the value.

You can also do this in cucumber.yml. For example, this sets up a profile that runs a tag and sets an environment variable

baz: --tags @mytag FOO=BAR
Clone this wiki locally