There are several ways to run your features. This page lists the most common ones. Any of these techniques also lets you define common command line options in a cucumber.yml file.
Assuming you’ve installed cucumber as a gem, run this at a command prompt to see the options for running features:
cucumber features/authenticate_user.feature: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.
cucumber features --name "Failed login"
…will run the scenario(s) named “Failed login”
cucumber --require features features/authentication/authenticate_user.feature
…will run authenticate_user feature. Any feature that is located inside a sub-directory of features directory must require features. Note: you can also add this to your cucumber.yml.
From the command line:
This 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" # Any valid command line option can go here. end
See the Cucumber.tmbundle documentation
Last edited by tobiashm,