简体   繁体   English

有没有办法为空手道 DSL 中的每个功能/场景分配一个唯一的“ID 密钥”

[英]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.scenariokarate.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.

相关问题 空手道 DSL:如何将场景大纲变量传递到 json 字符串中 - Karate DSL: How to pass Scenario Outline variables into a json string 空手道:是否可以从场景大纲中匹配 json - Karate: is it possible to match the json from scenario outline 动态为超链接onclick事件分配唯一的id值 - Dynamically assign unique id value to hyperlink onclick event 无法在空手道功能文件中找到或读取文件 - could not find or read file in karate feature file 有人使用空手道 DSL 作为测试数据管理工具吗? - Does anybody use Karate DSL as a test data management tool? 如何在空手道特征文件中传递体型? - how to pass body type in Karate feature file? 能够通过节点获取访问令牌,但不能在空手道DSL中获取 - able to get the access token through Node but not in Karate DSL "无法将用空手道编写的功能文件作为 eclipse 中的黄瓜功能运行" - Not able to run the feature files written in karate as a cucumber feature in eclipse 空手道模拟测试双打无法识别 headerContains 场景参数 - Karate Mock Test Doubles not recognizing the headerContains scenario parameter 如何在空手道框架的场景大纲中添加“abortedStepsShouldPass”配置? - How to add 'abortedStepsShouldPass' configuration inside the scenario outline in Karate framework?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM