是否有像call karate.callSingle()这样的函数在执行结束时调用功能文件? [英] Is there a function like call karate.callSingle() to call a feature file at the end of execution?

查看:92
本文介绍了是否有像call karate.callSingle()这样的函数在执行结束时调用功能文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用karate.callSingle()我可以创建一些可用于不同功能的全局资源.我想在每次自动化运行结束时删除这些资源.是否有类似于karate.callSingle()的函数,这样我可以使用该函数调用功能文件(此功能删除所有全局资源),并且此功能文件将在每次自动化结束时执行.这对于并行执行也将有所帮助.

解决方案

通常,开始时最好依赖钩子,因为钩子最后一次失败的风险是,否则您的测试套件将无法完成. /p>

做到这一点很容易,只需在并行运行器的测试运行结束时使用Java,这与在此处生成黄瓜报告的方式非常相似: 解决方案

Normally it is better to rely on hooks at the start, because of the risk that the hook failed the last time - or your test suite did not complete.

Achieving this is easy, just use Java at the end of the test-run in your parallel-runner, very similar to how the cucumber-reports are generated here: DemoTestParallel.java

Results results = Runner.parallel(getClass(), 5);
MyUtils.cleanUp();

这篇关于是否有像call karate.callSingle()这样的函数在执行结束时调用功能文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆