dsl - 为什么我们在空手道报告中使用 karate.abort() 将“跳过步骤”视为“失败的步骤”?
问题描述
对于我的测试场景,我正在使用“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
解决方案
这是在补丁版本中修复的错误:https ://github.com/intuit/karate/issues/464
你能不能把你的空手道版本升级到 0.8.0.1 再试一次。
推荐阅读
- excel - Excel:从另一个单元格获取行号以计算平均值
- python-3.x - 通过 Jenkins 连接到远程 API 时 Python 请求抛出连接错误
- ldap - ldapsearch 和范围限制
- javascript - 在兄弟组件之间传递数据
- sql - 当 JOIN 是多列时处理从另一个表进行 UPDATEing
- javascript - 无法使用 ejs 在 Javascript 中获取 Node js 响应对象
- java - jmx-exporter 无法从 activemq 中抓取指标
- azure-data-factory - 具有参数化数据集和参数化链接服务的 Azure 数据流
- python - 在 3D plot python 中绘制平面上的 1D 高斯分布
- sql - 为什么我不能使用“$System.TMSCHEMA_TABLES”选择多个列?