[英]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.我想知道是否可以为空手道 DSL 中的每个功能或场景分配“ID 密钥”,以保持所有这些功能或场景的唯一引用。
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.
场景的名称似乎不是有效的唯一引用,因为我在其名称中包含了可变数据。
Any hints?有什么提示吗?
Thanks in advance for your help.在此先感谢您的帮助。
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]
.最好使用功能文件名和“场景引用 ID”的组合,如下所示:
[1.4]
或[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在即将发布的 1.0 / RC 版本中,在执行测试时查看
karate.scenario
和karate.feature
的值: 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您可以考虑的另一件事是为每个场景添加标签: 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.这就是我们现在所拥有的一切,如果您对未来有一些想法,可能需要您/社区做出贡献。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.