HTTPS clone URL
Subversion checkout URL
- A Table Of Content
- A Whole New World
- Autotest Integration
- Browsers and Transactions
- Calling Steps from Step Definitions
- Conjunction Steps (Antipattern)
- Console Colours
- Continuous Integration
- Cucumber Backgrounder
- Cucumber Feature
- Cucumber for Perl
- Cucumber JVM
- Custom Formatters
- Environment Variables
- Feature Coupled Step Definitions (Antipattern)
- Feature Introduction
- FunFX and Flex
- Get in touch
- Given When Then
- Given when then (new)
- Introduction to Cucumber for non programmers
- IronRuby and .NET
- IronRuby and Mono
- Jenkins integration
- JRuby and Java
- Mocking and Stubbing with Cucumber
- Multiline Step Arguments
- Projects Using Cucumber
- Related tools
- RSpec Expectations
- Ruby on Rails
- Running Features
- SAP Enterprise Portal Behavior Testing
- Scenario Outlines
- Setting up Selenium
- Setting up Steam
- Snailgun and Cucumber
- Spoken languages
- Step Argument Transforms
- Step Definitions
- Step Organization
- subdomain_fu and incorrect redirection to " body You are being redirected body " page
- Tutorials and Related Blog Posts
- Using AE
- Using MiniTest
- Using Rake
- Using RCov with Cucumber and Rails
- Using Test::Unit
- Wire Protocol
Clone this wiki locally
Cucumber lets you store and reuse commonly used cucumber command line arguments for a project in a
cucumber.yaml file. This file must be in a
.config subdirectory or
config subdirectory of your current working directory.
# config/cucumber.yml ##YAML Template --- html_report: --format progress --format html --out=features_report.html bvt: --tags @bvt
Defining a template requires a name and then the command-line options that you want to execute with this profile. The example above generates two profiles: the first, named
html_report, with a list of command-line options that specify new output formats and a second, named
bvt which executes all features and scenarios tagged with @bvt.
[user@system project] cucumber --profile html_report [user@system project] cucumber -p bvt
The execution of a profile simply requires the use of the flag
During execution you can also specify additional parameters alongside the profile.
[user@system project] cucumber --profile html_report --tags ~@wip
Even multiple profiles can be specified together. The following executes all the features and scenarios tagged as @bvt with the specified progress and html output.
[user@system project] cucumber -p html_report -p bvt
It is often the case that you will want to execute Cucumber with a particular profile a majority of the time. The Cucumber configuration file uses a
default profile to provide this functionality. When you specify a default profile you are stating that Cucumber should apply this command-line options to an execution when you do not specify a profile.
Using the same example, perhaps we want the
html_report profile to be our default execution.
# config/cucumber.yml ##YAML Template --- default: --profile html_report --profile bvt html_report: --format progress --format html --out=features_report.html bvt: --tags @bvt
default profile is a special profile that when present, is applied to the execution of Cucumber when you have not specified a profile.
[user@system project] cucumber
So now, by default, Cucumber is going to use both the
bvt profile and
html_report profile testing all features and scenarios tagged as @bvt with the progress output and html output.
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:
# config/cucumber.yml ##YAML Template --- <% common = "--tags ~@wip --strict" %> default: <%= common %> features html_report: <%= common %> --format html --out=features_report.html features
Environment Variables can be used in the profile argument list for a profile as you would normally specify one on the command-line.
# config/cucumber.yml ##YAML Template # ie profile executes the browser features with Internet Explorer --- default: --profile html_report --profile bvt html_report: --format progress --format html --out=features_report.html bvt: --tags @bvt ie: BROWSER=IE
Integration with Autotest uses two profiles
autotest-all. These profiles should be reserved for that service.