Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of Gherkin 6 multiple
Scenario
s can be grouped usingRule
s. Thecheck-cucumber
tool currently does not support theRule
keyword and thus cannot find scenarios in rules. This PR adds support for the import of scenarios from rules into Testomatio.The main change is in
getScenarioCode
: when the child of a feature is a rule, the children of the rule are processed recursively.Additionally the calculation of a scenario's end position had to be updated. Previously the end position was defined as the start position of the next child or the end of the source in case of the last child. Now there is the additional case that the last child of a rule is followed by another rule. To generalize all cases, the start positions of all rules and scenarios are calculated in a preprocessing step using
getLocations
. The end positions are then calculated from the start positions.I also added an example and corresponding test cases. The tests ensure that all scenarios in rules are found and that the correct code fragment is extracted.