Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-adding scenario outline feature, cleaning up some steps, cleanin u…
…p scenario outline and data table
- Loading branch information
1 parent
77d4caf
commit 084da1a
Showing
9 changed files
with
264 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,70 @@ | ||
Feature: Data Tables | ||
Feature: Scenario Outlines and Examples | ||
|
||
Scenario: a data table interpreted as an array | ||
Given a scenario with: | ||
""" | ||
Given the following cukes: | ||
| Cucumis sativus | Cucumber | | ||
| Cucumis anguria | Burr Gherkin | | ||
""" | ||
And the step "the following cukes:" has a passing mapping that receives a data table | ||
When Cucumber executes the scenario | ||
Then the scenario passes | ||
And the received data table array equals the following: | ||
""" | ||
[ | ||
[ "Cucumis sativus", "Cucumber" ], | ||
[ "Cucumis anguria", "Burr Gherkin" ] | ||
] | ||
Scenario: Basic outline | ||
Given the following feature: | ||
""" | ||
Feature: testing scenarios | ||
Background: | ||
Given a background step | ||
Scenario: a data table can be read as an array of hashes | ||
Given the following data table in a step: | ||
Scenario Outline: outline | ||
When a <some> step | ||
Then i get <result> | ||
Examples: | ||
| some | result | | ||
| passing | passed | | ||
| failing | skipped | | ||
""" | ||
| Latin | English | | ||
| Cucumis sativus | Cucumber | | ||
| Cucumis anguria | Burr Gherkin | | ||
#And the step "a background step" has a passing mapping | ||
#And the step "a passing step" has a passing mapping | ||
#And the step "a failing step" has a failing mapping | ||
#And the step "i get passed" has a passing mapping | ||
#And the step "i get skipped" has a passing mapping | ||
When Cucumber runs the feature | ||
Then the scenario called "outline" is reported as failing | ||
#And the step "a background step" passes | ||
#And the step "a passing step" passes | ||
#And the step "a failing step" passes | ||
#And the step "i get passed" passes | ||
#And the step "i get skipped" is skipped | ||
|
||
Scenario: Outline with table | ||
Given the following feature: | ||
""" | ||
Feature: testing scenarios | ||
Scenario Outline: outline | ||
When a table step: | ||
| first | second | | ||
| <first> | <second> | | ||
Examples: | ||
| first | second | | ||
| 1 | 2 | | ||
""" | ||
When the data table is passed to a step mapping that converts it to key/value pairs | ||
Then the data table is converted to the following: | ||
And the step "a table step:" has a passing mapping that receives a data table | ||
When Cucumber runs the feature | ||
Then the received data table array equals the following: | ||
""" | ||
[ | ||
{ "Latin":"Cucumis sativus", "English":"Cucumber" }, | ||
{ "Latin":"Cucumis anguria", "English":"Burr Gherkin" } | ||
] | ||
[["first","second"],["1","2"]] | ||
""" | ||
|
||
Scenario: a data table can be read as an array of values | ||
Given the following data table in a step: | ||
""" | ||
| Latin | English | | ||
| Cucumis sativus | Cucumber | | ||
| Cucumis anguria | Burr Gherkin | | ||
""" | ||
When the data table is passed to a step mapping that gets the row arrays without the header | ||
Then the data table is converted to the following: | ||
Scenario: Outline with doc string | ||
Given the following feature: | ||
""" | ||
Feature: testing scenarios | ||
Scenario Outline: outline | ||
When a doc sting step: | ||
\"\"\" | ||
I am doc string in <example> example | ||
And there are <string> string | ||
\"\"\" | ||
Examples: | ||
| example | string | | ||
| first | some | | ||
""" | ||
[ | ||
[ "Cucumis sativus", "Cucumber" ], | ||
[ "Cucumis anguria", "Burr Gherkin" ] | ||
] | ||
""" | ||
And the step "a doc sting step:" has a passing mapping that receives a doc string | ||
When Cucumber runs the feature | ||
Then the received doc string equals the following: | ||
""" | ||
I am doc string in first example | ||
And there are some string | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var missing_steps = function() { | ||
var Given = When = Then = this.defineStep; | ||
var World = require('./cucumber_world').World; | ||
this.World = World; | ||
|
||
this.Given(/^the step "([^"]*)" has a mapping asynchronously failing through an exception with the message "([^"]*)"$/, function (arg1, arg2, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Then(/^it should pass with:$/, function (string, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Given(/^a mapping written in CoffeeScript$/, function (callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Given(/^a mapping written in PogoScript$/, function (callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Then(/^a "([^"]*)" step definition snippet for \/\^I am a happy veggie \\\\o\\\/\$\/ is suggested$/, function (arg1, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Then(/^a "([^"]*)" step definition snippet for \/\^I type \\\-\\\[\\\]\\\{\\\}\\\(\\\)\\\*\\\+\\\?\\\.\\\\\\\^\\\$\\\|\\\#\\\/\$\/ is suggested$/, function (arg1, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Then(/^a "([^"]*)" step definition snippet for \/\^I have \(\\d\+\) "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
this.Then(/^a "([^"]*)" step definition snippet for \/\^I have some "([^"]*)"\]\*\)"([^"]*)"\(\[\^"([^"]*)" and "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, arg4, arg5, arg6, callback) { | ||
// express the regexp above with the code you wish you had | ||
callback.pending(); | ||
}); | ||
|
||
}; | ||
module.exports = missing_steps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var scenario_exection_steps = function() { | ||
var Given = When = Then = this.defineStep; | ||
var World = require('./cucumber_world').World; | ||
this.World = World; | ||
|
||
|
||
Then(/^(?:only the first|the) scenario is executed$/, function(callback) { | ||
this.assertExecutedNumberedScenarios(1); | ||
callback(); | ||
}); | ||
|
||
Then(/^only the first two scenarios are executed$/, function(callback) { | ||
this.assertExecutedNumberedScenarios(1, 2); | ||
callback(); | ||
}); | ||
|
||
Then(/^only the third scenario is executed$/, function(callback) { | ||
this.assertExecutedNumberedScenarios(3); | ||
callback(); | ||
}); | ||
|
||
Then(/^only the second, third and fourth scenarios are executed$/, function(callback) { | ||
this.assertExecutedNumberedScenarios(2, 3, 4); | ||
callback(); | ||
}); | ||
}; | ||
module.exports = scenario_exection_steps; |
Oops, something went wrong.