Is there a function like call karate.callSingle() to call a feature file at the end of execution?

扶醉桌前 提交于 2019-12-08 10:17:20

问题


Using karate.callSingle() I am able to create some global resources which are used across different features . I want to delete these resources at the end of each automation run . Is there a function similar to karate.callSingle()such that I can call a feature file(This feature deletes all the global resources) using that function and this feature file will be executed at the end of each automation. This will be helpful in parallel execution also.


回答1:


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();


来源:https://stackoverflow.com/questions/55987283/is-there-a-function-like-call-karate-callsingle-to-call-a-feature-file-at-the

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!