Add support for rules#38
Open
just95 wants to merge 4 commits into
Open
Conversation
A `Rule` cannot be the child of another rule. Thus, the check if we are `inRule` is not needed. If nested rules were allowed in the future, more than a single space of indentation would be needed anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Scenarios can be grouped usingRules. Thecheck-cucumbertool currently does not support theRulekeyword 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.