'Is there a way to assign a unique "ID Key" to each feature/scenario in Karate DSL
I would like to know if it is possible to assign "ID Keys" to each feature or scenarios in Karate DSL in order to keep all of them uniquelly referenced.
When you have hundreds of features/scenarios seems very difficult to keep all this list tidy . The name of the scenarios does not seem to be a valid unique reference as I am including variable data in its name.
Solution 1:[1]
It is probably best that you use a combination of the feature file name and the "scenario ref id" which looks like this: [1.4]
or [2.1:10]
.
In the upcoming 1.0 / RC version, have a look at the values of karate.scenario
and karate.feature
when you are within a test execution: https://github.com/intuit/karate/wiki/1.0-upgrade-guide#karateinfo-deprecated
The other thing you can consider is add tags to every scenario: https://github.com/intuit/karate#tags
@id=001
Scenario: some name
* print karate.scenario.name
That's all we have right now, it may need you / the community to contribute if you have some ideas for the future.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Peter Thomas |