Open ciaranmcnulty opened 5 years ago
Checked with @aslakhellesoy and in Gherkin 6 Scenario Outline and Scenario are synonyms - they only differ based on whether they are followed by an Example, so the following are valid:
Scenario Outline: Something
Given I don't have any examples
Scenario: Something else
Given <foo>
Examples:
| foo |
| bar |
This would require a BC break here, and in Behat though, as outlines are currently treated differently from scenarios in Behat.
Btw, I'm wondering how cucumber deals with the output formatting for these cases. Does it still tries to output something looking like a colored gherkin file ?
I don't think it's necessarily a BC break - it allows some new syntaxes (above) that previously would have been a parse error
(our AST would need to still differentiate ScenarioOutline nodes from Scenario nodes, but we could detect which it is based on whether it is followed by Examples)
ah indeed, if we keep our 2 different nodes based on the presence of Examples, there is no BC break.
@dpakach As you've been looking at how Examples and Outlines are treated, what do you think about implementing this?
Just my 2c - the official Gherkin parser does the same - the AST node that gets created depends on the absence/presence of examples. And we managed to release this without any users complaining about BC issues.
Removing these lines will now produce failing tests
Checking the parsing examples from Gherkin, the following fail due to issues with scenario outlines:
readme_example
,scenario_outlines_with_tags
,several_examples
,tags
) - scenario outlines without an Example are not allowed by our parser but are just ignored by cucumber