嗨,我有以下功能文件:
结帐功能
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
中login.feature
:
@foo
然后,您只需执行以下操作:
* call read('classpath:login.feature@foo')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句