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

Scenario Outlines inconsistencies #153

Open
ciaranmcnulty opened this issue Apr 3, 2019 · 7 comments
Open

Scenario Outlines inconsistencies #153

ciaranmcnulty opened this issue Apr 3, 2019 · 7 comments

Comments

@ciaranmcnulty
Copy link
Contributor

ciaranmcnulty commented Apr 3, 2019

Checking the parsing examples from Gherkin, the following fail due to issues with scenario outlines:

@ciaranmcnulty
Copy link
Contributor Author

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 |

@stof
Copy link
Member

stof commented Apr 3, 2019

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 ?

@ciaranmcnulty
Copy link
Contributor Author

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)

@stof
Copy link
Member

stof commented Apr 3, 2019

ah indeed, if we keep our 2 different nodes based on the presence of Examples, there is no BC break.

@ciaranmcnulty
Copy link
Contributor Author

@dpakach As you've been looking at how Examples and Outlines are treated, what do you think about implementing this?

@aslakhellesoy
Copy link

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.

@ciaranmcnulty
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants