-
Notifications
You must be signed in to change notification settings - Fork 0
Running Features
There are several ways to run your features. This page lists the most common ones.
Assuming you’ve installed cucumber as a gem, run this at a command prompt to see the options for running features:
cucumber --helpFor example
cucumber features/authenticate_user.feature --line 44 --format html > features.html…will run the scenario defined at line 44 of the authenticate_user feature, format it as HTML and pipe it to the features.html file for viewing in a browser.
Profiles allow you to store and reuse commonly used cucumber arguments for a project in a cucumber.yml file. For example, by having this in your cucumber.yml at your project root:
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).
rake featuresThis requires a Rakefile with a Cucumber task definition. For example:
require 'rubygems'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "--format pretty"
t.rcov = true
end
If you are using Ruby on Rails this task is defined for you already.
See the Cucumber.tmbundle documentation
TODO: Show a simple task
TODO: Show a simple task