Can we call a scenario from one feature in another using karate?

旧城冷巷雨未停 提交于 2019-12-10 11:25:28

问题


We are using karate, wich is very funny. Sorry, but i didn't find any information about my issue. We have a feature A with several scenarii. And we need one scenario from that file. Can we call it in our feature B?


回答1:


No. You need to extract that Scenario into a separate*.feature file and then re-use it using the call keyword.

EDIT: Karate 0.9.0 onwards will support being able to call by tag as follows:

* def result = call read('some.feature@tagname')



回答2:


I have a concern with this approach: Karate should allow re-usability from a feature file itself for a particular scenario.

If I have such numerous cases then i will end up with a lot of feature files which would be holding duplicate scenarios just for the sake of getting called.



来源:https://stackoverflow.com/questions/46372155/can-we-call-a-scenario-from-one-feature-in-another-using-karate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!