Support the '*' keyword in a step name #86
Merged
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.
There is a possibility to use the '*' keyword in the Gherkin language instead of one of the other common keywords (like Given or And). This can be handy when listing things, as for example
(See Gherkin syntax)
Unfortunately this is not supported for some reason by the json reporter.
Is there a reason why this keyword is explicitly filtered out from the list of keywords (utils.ts:20)?
As of now, steps defined like this have their names parsed incorrectly and this results in meaningless step names, like in this report:
Whereas with this fix, the names are displayed correctly:
This fix removes the filtering out of the '*' keywords and also escapes the strings so that they don't break the regular expressions. The escape regex originally comes from MDN.
Note: Technically there will be duplicate '*'s in the keywords array (
stepKeywords
), if that is an issue the duplicates can be removed.