tntim96 / JSCover

JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage
GNU General Public License v2.0
399 stars 84 forks source link

How to embed in a TestNG @BeforeSuite method #233

Closed ph-hs closed 8 years ago

ph-hs commented 8 years ago

I'm orchestrating the starting of an embedded Jetty in a @BeforeSuite method (TestNG). The same test invocation is coordinating a WebDriver instance for automated clicking of the web application being tested.

I'm like to be able to similarly instantiate the JSCover proxy in the @BeforeSuite method, and in an @AfterSuite method collect the coverage result, and spit out XML/txt for later reporting.

How to do that?

Is jscover.Main the class I need to be inspired by - the whole lifecycle apparent in there?

tntim96 commented 8 years ago

Take a look at the samples at https://github.com/tntim96/JSCover-samples. The JUnit examples should be easily converted to TestNG.

ph-hs commented 8 years ago

Thanks - that helped