为什么我们在空手道报告中将 "skipping the steps" 视为 "failed steps" 和 karate.abort()?
why do we consider "skipping the steps" as "failed steps" with karate.abort() in karate report?
对于我的测试场景,我使用 "karate.abort()" 函数,如果满足条件,它会跳过下面的步骤。
但由于跳过了步骤,这将我的完整测试标记为失败。
如果调用 karate.abort() 并跳过后续步骤,是否有任何方法可以将测试用例标记为已通过?
示例:
场景大纲:Lambda API ARN 无效时的注册
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
这是一个已在补丁版本中修复的错误:https://github.com/intuit/karate/issues/464
你能不能把你的空手道版本升级到 0.8.0.1 然后再试一次。
对于我的测试场景,我使用 "karate.abort()" 函数,如果满足条件,它会跳过下面的步骤。 但由于跳过了步骤,这将我的完整测试标记为失败。
如果调用 karate.abort() 并跳过后续步骤,是否有任何方法可以将测试用例标记为已通过?
示例:
场景大纲:Lambda API ARN 无效时的注册
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
这是一个已在补丁版本中修复的错误:https://github.com/intuit/karate/issues/464
你能不能把你的空手道版本升级到 0.8.0.1 然后再试一次。