我目前正在使用空手道DSL,并且我想确保如果一个方案失败了,那么其他方案就不会。因此,我添加了after场景挂钩。 但是,在运行方案时,将跳过方案之后的挂钩。 这是我的情况:
Scenario: Create a domain
* configure afterScenario =
"""
function(){
var info = karate.info;
karate.call('ReusableFeatureFiles/domainService/DeleteDomain.feature',{caller: info.DeleteDomain });
}
"""
Given url baseUrl+ '/admin/domain/save-domain.action'
And header Content-Type = 'application/x-www-form-urlencoded'
And form field domain.name = domainName
And form field domain.maxUserPerRoom = domainMaxUserPerRoom
And form field domain.maxAdminPerRoom = domainMaxAdminPerRoom
When method POST
Then status 200
And match response.result == 'success'
您能帮我解决这个问题吗? 预先感谢。