空手道 -TestNG 在任一步骤失败时停止执行

Karate -TestNG stop execution when any one of the step fail

当任一步骤失败时,空手道步骤执行停止。

示例: 场景:验证用户详细信息。

给定 url "this is my webservice"

当方法post

然后状态200

*断言 1==2

然后回复

然后匹配 XXXXXXX

比赛 XXXX

步骤断言失败,其余步骤不执行。有什么方法即使我的断言失败了,剩下的步骤也可以继续这个过程

这是预期的行为。

但是你可以使用karate.match() function to perform the assert manually. Then you can use conditional logic to decide if you want to continue next steps or not. But I totally don't recommend这个。

例如:

* def temp = karate.match(actual, expected)
* print 'some step'
* assert temp.pass