Open hsudbrock opened 9 years ago
Your interpretation is correct, actually the line starting with the asterisk is not interpreted as a step
but it is rather considered part of the scenario outline description. I wasn't aware the asterisk can be used to identify a step: can you point me to the documentation regarding this?
Interesting - Cucumber happily executes my Gherkin features that contain the asterisk, but I cannnot find it documented in the Cucumber documentation.
I know the asterisk-feature from this book: https://pragprog.com/book/srjcuc/the-cucumber-for-java-book. The asterisk-feature is also described in blog entries on Cucumber (e.g., http://antonymarcano.com/blog/tag/gherkin/).
Nevertheless, the asterisk-feature is not documented in the attempt to define a BNF grammar for Gherkin (https://github.com/cucumber/gherkin/wiki/BNF).
I will try to find out where these asterisks are handled in Cucumber's Gherkin parser...
Sadly the Natural plugin doesn't use the Gherkin parser, but one I've described myself in an EBNF like syntax. If you wish I'm still strugglying to find a way to use the official parser and get rid of the many parsing issues we are experiencing.
Would you be willing to help me on this?
In the Gherkin3 parser project the asterisk is defined in the language definition file (https://github.com/cucumber/gherkin3/blob/master/gherkin-languages.json), where the asterisk is just one of potentially multiple "translations" for keywords like "when", "given", etc. It seems odd to me defining the asterisk as a translation, but the Gherkin3-people will have had a good reason for that, I guess.
Yes, I would be willing to help, but cannot say yet when I will find time for this. I'll keep in touch.
Updated URL: https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json
This will most likely need to be included in a general "localization" update. The issue is in fact that newer versions of Gherkin will match practically any starting word as a keyword. I have even seen joke implementations written in Klingon. We will probably need to update the AST to use any keyword as the starting word, or just ignore it altogether and consume the whole line of text as the step. This would actually solve another problem I'm running into with the code generator, which is the lack of support in the AST to access the keyword, preventing serialization until an update can be made. It will also make step matching a bit more expensive, but this can be mitigated in other ways.
@rlogiacco Confirmed partial fix in next. *
is now a supported Step keyword. There have also been other minor improvements on the localization front, but nothing to fruition yet.
This issue has not been updated for a while: marking it as stale.
@rlogiacco This will be closed by https://github.com/rlogiacco/Natural/pull/86
In the following example, I get java hyperlinks for the second line in the scenario outline, but not for the first. It seems to be caused by using '*' and not one of the keywords 'And', 'Given', etc.