-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
Add a feature with an empty scenario in the compatibility kit #1498
Conversation
The current issue with the CI is:
In order to go further with that PR, I suggest:
Any other idea? Note: the extra data in "match": {
"location": "../../compatibility-kit/javascript/features/examples-tables/examples-tables.feature:27:9"
}, Option 2: fixing the json-formatter. The line of the output of the ruby json formatter in recent version seems legit actually. |
The json report from cucumber-ruby seems actually wrong. Instead of resulting in an empty scenario, it results in a background [
{
"description": " Scenario can be empty.\n Background and hooks are not executed.\n The state of the scenario is `undefined`",
"elements": [
{
"description": "",
"keyword": "Background",
"line": 6,
"name": "",
"type": "background"
}
],
"id": "minimal",
"keyword": "Feature",
"line": 1,
"name": "minimal",
"uri": "features/empty-scenario/empty-scenario.feature"
}
] The result of the json-formatter when converting messages from fake-cucumber looks pretty good to me: [
{
"description": " Scenario can be empty.\n Background and hooks are not executed.\n The state of the scenario is `undefined`",
"elements": [
{
"id": "minimal;empty",
"keyword": "Scenario",
"line": 9,
"name": "empty",
"steps": [],
"type": "scenario"
}
],
"id": "minimal",
"keyword": "Feature",
"line": 1,
"name": "minimal",
"uri": "features/empty-scenario/empty-scenario.feature"
}
] |
41f0a3a
to
bad62d4
Compare
Refs. cucumber/cucumber-ruby#1529 Once the issue in cucumber-ruby is fixed, we may revert that commit eventualy.
When a test_step is issued from an example table, the location now indicates the line of the example row, and the line of the step in the scenario.
bad62d4
to
2f0dac7
Compare
Back to draft as there is no consensus regarding empty scenarios |
Due to lack of consensus, I close this PR. We actually noticed that such behavior could differ depending the ecosystem it runs on, so I guess each implementation could deal with empty scenarios on their own. As far as I can tell, cucumber-ruby and cucumber-jvm are already managing empty scenarios. However cucumber-js may still have unhandled exceptions with those. |
Summary
Following cucumber/gherkin#11, the gherkin parser is considering empty scenarios, but cucumber implementation are not yet align on how to process empty scenarios.
Details
An empty-scenario has been added to the compatibility kit.
cucumber-ruby is already managing empty scenarios well so fake-cucumber has been updated in order to have the same behavior as cucumber-ruby.
That way, everything remains green without a lot of effort.
No behavior has been changed in any other module. Gherkin remain unchanged.
Checklist: