[Core] Provide a unique id of the current scenario to the hooks. #1160
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.
Summary
Provide a unique id of the current scenario to the hooks. Fixes #1158.
Details
Provide methods to access the uri of the feature file of the current executing scenario and the line(s) where the scenario is defined in the feature file. If the scenario is created from a scenario outline both the line of the example row and the scenario outline is provided.
In addition also put back the getId() method, returning
<uri>:<line>
(in case of scenarios from a scenario outline it is<example row line>
). Even though it is not possible to provide the same id string as when using Gherkin v2.12.2 (<featrue name>:<scenario name>
), hooks using Scenario.getId() sill still compile and still get a unique id for the scenario through that method.How Has This Been Tested?
The automated test suite updated to cover this functionality.
Types of changes
Checklist: