Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

Commit

Permalink
Make scenario outline work again (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas-Kullmann committed Jun 17, 2019
1 parent ceb40e2 commit 34926e3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/custom-param-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ When('I am searching for the {color} color on Google', async (t, [color]) => {
Then('I should see the {word} value in the page', async (t, [value]) => {
const result = Selector('span', t).withText(value);
await t.expect(result.visible).ok();
});
});
13 changes: 12 additions & 1 deletion examples/google.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ Feature: The big search feature
Given I open Google's search page
When I am typing my search request "github TestCafe" on Google
And I am pressing "enter" key on Google
Then I should see that the first Google's result is "GitHub - DevExpress/testcafe:"
Then I should see that the first Google's result is "DevExpress/testcafe:"

Scenario Outline: Searching for <keyword> on Google
Given I open Google's search page
When I am typing my search request "<keyword>" on Google
And I am pressing "enter" key on Google
Then I should see that the first Google's result is "<result-text>"

Examples:
| keyword | result-text |
| facebook | Facebook |
| twitter | Twitter |
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gherkin-testcafe",
"version": "2.3.0",
"version": "2.3.1",
"author": "Lukas Kullmann <[email protected]>",
"contributors": [
"Wilhelm Behncke <[email protected]>",
Expand Down Expand Up @@ -35,7 +35,7 @@
"scripts": {
"prettier": "prettier --write 'src/**/*.js' README.md main.js index.d.ts",
"prettier-check": "prettier --list-different 'src/**/*.{js,yaml,yml,json,md}'",
"google-example": "node main.js chrome ./examples/google.js ./examples/google.feature",
"google-example": "node main.js chromium ./examples/google.js ./examples/google.feature",
"datatable-example": "node main.js chrome ./examples/datatable.js ./examples/datatable.feature",
"custom-param-type-example": "node main.js chrome ./examples/google.js ./examples/custom-param-type.js ./examples/custom-param-type.feature --param-type-registry-file ./examples/custom-param-type-registry.js"
},
Expand Down
5 changes: 2 additions & 3 deletions src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ module.exports = class GherkinTestcafeCompiler {
.before(ctx => this._runFeatureHooks(ctx, this.beforeAllHooks))
.after(ctx => this._runFeatureHooks(ctx, this.afterAllHooks));

gherkinResult[1].gherkinDocument.feature.children.forEach(child => {
const scenario = child.scenario;
if (!this._shouldRunScenario(scenario)) {
gherkinResult.forEach(({ pickle: scenario }) => {
if (!scenario || !this._shouldRunScenario(scenario)) {
return;
}

Expand Down

0 comments on commit 34926e3

Please sign in to comment.