Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gherkin unique picklestep ids #800

Merged
merged 6 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Fixed

* PickleStep have unique IDs when generated from a `Background` section
([#800](https://github.com/cucumber/cucumber/pull/800)
[vincent-psarga])

## [8.2.0] - 2019-11-14

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions gherkin/c/testdata/good/background.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Feature: Background

Scenario: minimalistic
Given the minimalism

Scenario: also minimalistic
Given the minimalism
22 changes: 22 additions & 0 deletions gherkin/c/testdata/good/background.feature.ast.ndjson
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@
}
]
}
},
{
"scenario": {
"id": "4",
"keyword": "Scenario",
"location": {
"column": 3,
"line": 10
},
"name": "also minimalistic",
"steps": [
{
"id": "3",
"keyword": "Given ",
"location": {
"column": 5,
"line": 11
},
"text": "the minimalism"
}
]
}
}
],
"keyword": "Feature",
Expand Down
33 changes: 30 additions & 3 deletions gherkin/c/testdata/good/background.feature.pickles.ndjson
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"pickle": {
"id": "5",
"id": "7",
"language": "en",
"name": "minimalistic",
"sourceIds": [
"2"
],
"steps": [
{
"id": "3",
"id": "5",
"sourceIds": [
"0"
],
"text": "the minimalism inside a background"
},
{
"id": "4",
"id": "6",
"sourceIds": [
"1"
],
Expand All @@ -25,3 +25,30 @@
"uri": "testdata/good/background.feature"
}
}
{
"pickle": {
"id": "10",
"language": "en",
"name": "also minimalistic",
"sourceIds": [
"4"
],
"steps": [
{
"id": "8",
"sourceIds": [
"0"
],
"text": "the minimalism inside a background"
},
{
"id": "9",
"sourceIds": [
"3"
],
"text": "the minimalism"
}
],
"uri": "testdata/good/background.feature"
}
}
2 changes: 1 addition & 1 deletion gherkin/c/testdata/good/background.feature.source.ndjson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"data": "Feature: Background\n\n Background: a simple background\n Given the minimalism inside a background\n\n\n Scenario: minimalistic\n Given the minimalism\n",
"data": "Feature: Background\n\n Background: a simple background\n Given the minimalism inside a background\n\n\n Scenario: minimalistic\n Given the minimalism\n\n Scenario: also minimalistic\n Given the minimalism",
"media": {
"contentType": "text/x.cucumber.gherkin+plain",
"encoding": "UTF8"
Expand Down
3 changes: 3 additions & 0 deletions gherkin/c/testdata/good/background.feature.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
(6:1)Empty://
(7:3)ScenarioLine:Scenario/minimalistic/
(8:5)StepLine:Given /the minimalism/
(9:1)Empty://
(10:3)ScenarioLine:Scenario/also minimalistic/
(11:5)StepLine:Given /the minimalism/
EOF
24 changes: 24 additions & 0 deletions gherkin/c/testdata/good/complex_background.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Feature: Complex background
We want to ensure PickleStep all have different IDs

Background: a simple background
Given the minimalism inside a background

Scenario: minimalistic
Given the minimalism

Scenario: also minimalistic
Given the minimalism

Rule: My Rule

Background:
Given a rule background step

Scenario: with examples
Given the <value> minimalism

Examples:
| value |
| 1 |
| 2 |
195 changes: 195 additions & 0 deletions gherkin/c/testdata/good/complex_background.feature.ast.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
{
"gherkinDocument": {
"feature": {
"children": [
{
"background": {
"keyword": "Background",
"location": {
"column": 3,
"line": 4
},
"name": "a simple background",
"steps": [
{
"id": "0",
"keyword": "Given ",
"location": {
"column": 5,
"line": 5
},
"text": "the minimalism inside a background"
}
]
}
},
{
"scenario": {
"id": "2",
"keyword": "Scenario",
"location": {
"column": 3,
"line": 7
},
"name": "minimalistic",
"steps": [
{
"id": "1",
"keyword": "Given ",
"location": {
"column": 5,
"line": 8
},
"text": "the minimalism"
}
]
}
},
{
"scenario": {
"id": "4",
"keyword": "Scenario",
"location": {
"column": 3,
"line": 10
},
"name": "also minimalistic",
"steps": [
{
"id": "3",
"keyword": "Given ",
"location": {
"column": 5,
"line": 11
},
"text": "the minimalism"
}
]
}
},
{
"rule": {
"children": [
{
"background": {
"keyword": "Background",
"location": {
"column": 5,
"line": 15
},
"steps": [
{
"id": "5",
"keyword": "Given ",
"location": {
"column": 7,
"line": 16
},
"text": "a rule background step"
}
]
}
},
{
"scenario": {
"examples": [
{
"keyword": "Examples",
"location": {
"column": 7,
"line": 21
},
"tableBody": [
{
"cells": [
{
"location": {
"column": 9,
"line": 23
},
"value": "1"
}
],
"id": "8",
"location": {
"column": 7,
"line": 23
}
},
{
"cells": [
{
"location": {
"column": 9,
"line": 24
},
"value": "2"
}
],
"id": "9",
"location": {
"column": 7,
"line": 24
}
}
],
"tableHeader": {
"cells": [
{
"location": {
"column": 9,
"line": 22
},
"value": "value"
}
],
"id": "7",
"location": {
"column": 7,
"line": 22
}
}
}
],
"id": "10",
"keyword": "Scenario",
"location": {
"column": 5,
"line": 18
},
"name": "with examples",
"steps": [
{
"id": "6",
"keyword": "Given ",
"location": {
"column": 7,
"line": 19
},
"text": "the <value> minimalism"
}
]
}
}
],
"keyword": "Rule",
"location": {
"column": 3,
"line": 13
},
"name": "My Rule"
}
}
],
"description": " We want to ensure PickleStep all have different IDs",
"keyword": "Feature",
"language": "en",
"location": {
"column": 1,
"line": 1
},
"name": "Complex background"
},
"uri": "testdata/good/complex_background.feature"
}
}