gotwarlost / istanbul-middleware

Connect middleware for server side code coverage using istanbul
Other
178 stars 96 forks source link

Configuring istanbul with selenium tests #37

Open abhibang opened 7 years ago

abhibang commented 7 years ago

I’m new to the entire concept of capturing JS coverage. The way I intend to use Istanbul is to check how many lines of my JS code is being hit by my tests running in a browser, thus using code coverage to improvise my test coverage. Can somebody guide me to an example of how to integrate Istanbul to capture JS coverage for the test running using selenium webdriver.

grawk commented 7 years ago

Doing something similar as well. Essentially:

  1. setup this middleware
  2. run selenium automation
  3. gather coverage metrics from the endpoint you defined in step 1

How you gather may vary. You could use your selenium automation scripts to gather the report. you could also curl the report.

abhibang commented 7 years ago

@grawk , All the working scenarios coated are for NodeJS application. Is it possible to use istanbul-middleware to capture JS coverage for Java application.