Search code examples
intellij-ideajunitcode-coveragetest-suite

Is it possible to run Code Coverage on JUnit Test Suite in Intellij?


Is it possible to run JUnit Code Coverage on a TestSuite in Intellij ? I am using Intellij 2020.1

I am able to run Code Coverage on JUnit tests when running it from Intellij against the Test Directory - just right-click and select 'Run Tests in xxxx with Coverage'.... that works fine...and you can see the output from this on the right hand side of the screenshot below.

When I run the TestSuite however - I dont see any Code Coverage stats and cant see how to generate them. The screenshot below shows the Run Configuration form for the TestSuite and shows the middle tab for Code Coverage. Does this form tab need to be configured ?

enter image description here


Solution

  • please see @Olga's comment above - this functionality should work using the same approach as for a normal JUnit Test class....i.e. right-click over the Test Suite name in the Project Folders pane and select the 'Run XXX with Code Coverage' option.