Using the Code Coverage devtool by selenium+maven

2019-03-21 16:38发布

问题:

Is it possible to use the Code Coverage devtool (from upcoming Chrome release) by selenium+maven automation?

E.g. like JaCoCo for java projects?

I.e. I imagine approximately such scenario for our web-product:

There is a test suite with several test cases.

  • The Chrome Code Coverage collection is enabled somehow from outside
  • Then test suite is executed (by maven): The each test case uses Selenium to run Chrome browser, executes testing scenario and close the webdriver (browser is closed).

  • Then, after the suite is finished the code coverage data (CSS/JS related) could be collected and could be viewed as a report later.