为什么在空手道报告中使用karate.abort()将“跳过步骤”视为“失败的步骤”?

时间:2018-09-12 03:08:13

标签: dsl karate

对于我的测试场景,我正在使用“ karate.abort()”函数,如果满足条件,它将跳过下面的步骤。 但是,由于跳过了步骤,因此这标志着我的完整测试未通过。

如果调用karate.abort()并跳过下一步,是否可以将测试用例标记为“通过”?

示例:

方案概述:ARN无效时的Lambda API注册

Given url ApiAdminURL

And path AdminPath

And header apigateway-apikey = apiGatewayKey

And header apigateway-basepath = 'lambda-migration'

* json myReq = read('swagger-lambda.json')

* set myReq.apiConf.subscriptionTiers = <subscriptionTiers>

* set myReq.swagger.info.title = 'REGTEST_AUTO_Regression_Lambda_Quote_Function'

* set myReq.swagger.basePath = 'lambda-migration'

* set myReq.swagger.info.version = 'v1'

* set myReq.swagger.x-lambda-arn = '<arn>'

And request myReq

When method post

Then status <responseCode>

* eval if (responseStatus == 400) karate.abort()

* call read('Lambda-Sleep.feature')

* call read('Lambda-APIDefinition.feature')

* def responsefromsubscriber = call read('Lambda-Subscriber.feature')

 {accessTokenforInvokation: '#(accessTokenforInvokation)', applicationId: '#

 (applicationId)', subscribeToken: '#(subscribeToken)'}

* def AccessTokenforInvokation =

  responsefromsubscriber.accessTokenforInvokation

* def ApplicationId = responsefromsubscriber.applicationId

* def SubscribeToken = responsefromsubscriber.subscribeToken

1 个答案:

答案 0 :(得分:0)

这是一个已在补丁程序版本中修复的错误:https://github.com/intuit/karate/issues/464

您能否将空手道版本升级到0.8.0.1,然后重试。