I wanted to draw your attention to cucumber/gherkin, which I recently built within the cucumber org
The plan is to eventually replace behat/gherkin in Behat with this parser. Probably as a stepping stone, behat/gherkin will become a compatibility layer that depends on the new parser.
You may want to jump the queue and depend on it directly ;)
It has a nice concept called a Pickle, which is basically a list of steps (i.e. things like scenario outlines, backgrounds are all totally flattened)
$parser = new GherkinParser(
includeSource: false, // don't provide file + contents
includeGherkinDocument: false, // don't provide ASTs
includePickles: true, // do include pickles
);
foreach ($parser->parseString($url, $contents) as $message)
{
foreach ($message->pickle?->steps ?? [] as $step) {
$step->text; // e.g. 'Given I have a pickle'
$step->tags; // any tags that were on the scenario, rule, feature...
}
}
Hi,
I wanted to draw your attention to cucumber/gherkin, which I recently built within the cucumber org
The plan is to eventually replace behat/gherkin in Behat with this parser. Probably as a stepping stone, behat/gherkin will become a compatibility layer that depends on the new parser.
You may want to jump the queue and depend on it directly ;)
It has a nice concept called a Pickle, which is basically a list of steps (i.e. things like scenario outlines, backgrounds are all totally flattened)
Hit me up if you want to talk through it