ExecutionHook with parallel runner

限于喜欢 提交于 2021-02-10 15:15:21

问题


I am using the parallel runner to run one of m feature files. It has 8 scenarios as of now. I wanted to integrate a third party reporting plugin (Extent report) to build out the reports. I planned to use the ExecutionHook interface to try and achieve this. Below are the issues i faced and havent found a even after looking at the documentation.

My issues

  1. I am creating a new test on the afterFeature method. This gives me 2 handles, Feature and ExecutionContext. However since the tests are running in parallel, the reporting steps are getting mixed on each other? How do i handle this? Any out of the box method i can use?
  2. To counter the above, i decided to build the whole report towards the end on the afterAll overridden method but here i am missing the execution context data so i cant use the context.getRequestBuilder() to get the urls and paths.

Any help would be great.


回答1:


Please focus on the 1.0 release: https://github.com/intuit/karate/wiki/1.0-upgrade-guide

Reasons:

  • it gives you a way to build the whole report at the end, and the Results object can iterate over all ScenarioResult instances
  • ExecutionHook has been changed to RuntimeHook, see example
  • yes, since tests can run in parallel, it is up to you to synchronize as the framework has to be high performance, but building reports at the end using the Results object is recommended instead of using the RuntimeHook


来源:https://stackoverflow.com/questions/65985989/executionhook-with-parallel-runner

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