简体   繁体   中英

Jenkins test coverage report for JavaScript tests

We run a CI environment with Jenkins and the Project is in ExtJS 3.2. I am not able to find a clear line on how to setup the test coverage for JS code in Jenkins. We write UI tests using selenium and Cucumber. The build file has a UI tests target which is run every time the CI machine runs a build. I am not able to find a plugin that will give me or publish the coverage report of these tests that have been run as a resulting atrifact in Jenkins. Or please help me out if there is some other way to achieve the same thing.

I think you can use JSCover to generate code coverage when using Selenium:

  • Start JSCover java web service
  • Let Selenium hit the JSCover web-app and start the collector, also see the manual of JSCover about automated tests.
  • Run the Selenium tests in a new window or iFrame
  • Collect the coverage data and store it somewhere
  • Process the data into a nice report (possible with genhtml )

If you start a new browser for each Cucumber scenario/feature, then you need to save the coverage data between each scenario/feature, combine them after all features are done and then process them into a nice report. JSCover supports merging of multiple data sources and creating LCOV reports.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM