您好,我有以下功能文件:
结账功能
Scenario: checkout items in basket
* call read('classpath:login.feature@[call by scenario name]')
Given path '/checkout'
And request {"items":{"biscuits": 1,"apples": 2}}
When method post
Then status 200
在检查购物篮中的商品之前,我想通过场景名称调用 login.feature(使用凭据登录应用程序),而不使用标签。您能告诉我这样做的语法吗?
登录功能
Scenario: log into app with credentials
Given path '/login'
And request {"userDetails":{"userName": 1,"apples": 2}}
When method post
Then status 200
我读过了https://github.com/intuit/karate#call-tag-selector但似乎无法让它发挥作用。
因为你没有标签。在上面添加这一行Scenario
in login.feature
:
@foo
然后你只需这样做:
* call read('classpath:login.feature@foo')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)