Reputation: 139
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.
Upvotes: 0
Views: 665
Reputation: 58098
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();
Upvotes: 1