test-bdd-cucumber-perl icon indicating copy to clipboard operation
test-bdd-cucumber-perl copied to clipboard

Use Gherkin parser as soon as it becomes available

Open ehuelsmann opened this issue 9 years ago • 13 comments
trafficstars

The cucumber project started "Gherkin3", a project which allows to consistently parse Gherkin .feature files across languages (https://github.com/cucumber/gherkin).

ehuelsmann avatar Feb 09 '16 10:02 ehuelsmann

Work in progress here: https://github.com/pjlsergeant/gherkin/tree/master/perl

pjlsergeant avatar Feb 20 '16 11:02 pjlsergeant

This will break use of "Scenario" to mean "Scenario Outline", so I'm unsure about this.

pjlsergeant avatar Apr 29 '16 03:04 pjlsergeant

The Gherkin release notes suggest that in Gherkin 6 Scenario Outline vs Scenario has been resolved: https://github.com/cucumber/cucumber/blob/master/gherkin/CHANGELOG.md#6013---2018-09-25

ehuelsmann avatar Aug 20 '19 12:08 ehuelsmann

After cucumber/cucumber#694 gets merged the Gherkin parser has everything we need to drive cucumber tests: the generated pickles list all the scenarios and their steps that will be executed. This will also eliminate the need to parse Gherkin "ourselves".

ehuelsmann avatar Sep 02 '19 09:09 ehuelsmann

I'm only inclined to go this way if we can have the protobuf library required to produce the wire protocol data be an optional component in the ecosystem.

ehuelsmann avatar Dec 27 '20 19:12 ehuelsmann

An alternative would be to test our parser with the central testing corpus.

ehuelsmann avatar Dec 27 '20 19:12 ehuelsmann

There's a fully updated Gherkin parser available now on CPAN!

ehuelsmann avatar Feb 07 '21 22:02 ehuelsmann

BTW, changing to the new parser also means to support the Rule keyword, bit at the same time has a big impact on the rest of the program due to the fact that Gherkin has a different setup for the AST of the feature file.

For the execution, things will become simpler, because we will be handed pickles to be expanded into test cases and executed from the there. For the formatters (harnesses), things will be very different as they will need to combine AST data with test results to print scenarios and rules with their outcomes.

ehuelsmann avatar Jul 19 '21 09:07 ehuelsmann

As noted in cucumber/common#768, we need the pickles to be expanded, because the steps in the pickles don't hold a keyword whereas we have always used the keyword for dispatching the correct step function.

ehuelsmann avatar Aug 12 '21 22:08 ehuelsmann

With the merge of cucumber/common#1741, the data that we need is now available in the pickles! All we need is a release and some effort to replace our own parser with the one published by the Cucumber project!

ehuelsmann avatar May 25 '22 17:05 ehuelsmann

As of Gherkin 24.0.0 (released to CPAN today) all prerequisites are there to move to the parser from the Cucumber project!

ehuelsmann avatar Jun 09 '22 18:06 ehuelsmann

Great work @ehuelsmann :-D

pjlsergeant avatar Jun 10 '22 08:06 pjlsergeant

First step towards using Cucumber infrastructure taken: released 0.85 today which uses Cucumber::TagExpressions tag expression parser and evaluator.

ehuelsmann avatar Aug 11 '23 14:08 ehuelsmann