Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4f5f301b90
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (81 sloc) 2.496 kb
Feature: Command line interface
In order to run cucumber in different contexts
As a person who wants to run features
I want to run Cucumber on the command line
Scenario: run a single feature
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario:
When a step is passing
"""
Given a file named "features/step_definitions/cucumber_steps.js" with:
"""
var cucumberSteps = function() {
this.When(/^a step is passing$/, function(callback) { callback(); });
};
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature`
Then it should pass with:
"""
.
1 scenario (1 passed)
1 step (1 passed)
"""
Scenario: run a single feature without step definitions
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario:
When a step is undefined
"""
When I run `cucumber.js features/a.feature`
Then it should pass with:
"""
U
1 scenario (1 undefined)
1 step (1 undefined)
"""
Scenario: run feature with non-default step definitions file location specified (-r option)
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario:
When a step is passing
"""
Given a file named "step_definitions/cucumber_steps.js" with:
"""
var cucumberSteps = function() {
this.When(/^a step is passing$/, function(callback) { callback(); });
};
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature -r step_definitions/cucumber_steps.js`
Then it should pass with:
"""
.
1 scenario (1 passed)
1 step (1 passed)
"""
Scenario: run feature with step definitions in required directory (-r option)
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario:
When a step is passing
"""
Given a file named "step_definitions/cucumber_steps.js" with:
"""
var cucumberSteps = function() {
this.When(/^a step is passing$/, function(callback) { callback(); });
};
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature -r step_definitions`
Then it should pass with:
"""
.
1 scenario (1 passed)
1 step (1 passed)
"""
Jump to Line
Something went wrong with that request. Please try again.