graphql - Karate-afterFeature - 主功能文件不能使用 Karate-afterFeature 调用另一个功能文件
问题描述
afterFeature
我对空手道配置有疑问。
我想在每个场景之后从单独的功能文件中调用一个清理步骤。因此,我配置了一个afterFeature
js 函数,它应该使用 karatescall
函数调用该清理功能。
在前面的callonce
步骤中工作正常,但我对afterFeature
.
这是我如何配置的代码afterFeature
:
* def result = callonce read('../callOnceCreateCompanyForBrowse.feature')
* def id = result.response.data.createCompanyEvent.id
* configure afterFeature = function(){ karate.call('../../deleteCompanyEvent.feature', {id : id}); }
解决方案
建议,而不是相对路径(很难正确)使用classpath:
前缀。
* configure afterFeature = function(){ karate.call('classpath:com/myco/deleteCompanyEvent.feature', { id: id }) }
编辑:看起来解决方案是使用跑步者而不是直接运行该功能。
推荐阅读
- java - PageRequest:页面值重叠
- javascript - 使用 nextjs 中的 setAppLanguage 更改语言时查询为空
- javascript - 如何将商品添加到购物车
- string - 删除字符串中的回文子串以创建最短字符串
- php - $request->input 返回 null laravel 8
- javascript - 新版本中的 D3 事件
- javascript - 等待所有承诺完成,然后执行其余代码
- databricks - 在 Azure Databricks 中每隔一天安排一次作业
- r - 我可以转置单列吗?
- node.js - 如何将存储在 MS SQL Server 2012 中的图像作为图像数据类型加载到 nodejs 服务器中,然后在标记中的客户端网页中呈现