Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA Test Coverage window doesn't show

I'm using Spring Boot project with the last version of IntelliJ IDEA (2018.2.1 Ultimate Edition).

When I run all my test with coverage the Coverage window doesn't show, and there's no percentage beside my main classes.

I've tried enabling the coverage window by going to View -> Tool Windows -> Coverage, but the coverage tab is disabled (not clickable).

enter image description here

If I remember correctly the coverage was working fine before I update IntelliJ. Is that a bug with the last version ?

Edit
the coverage plugin is already installed
enter image description here

like image 599
K. Ayoub Avatar asked Aug 10 '18 16:08

K. Ayoub


3 Answers

Potentially the Coverage plugin is installed but disabled on your machine e.g. IntelliJ wasn't restarted after plugin was enabled. Try restarting after double checking that Coverage plugin is enabled. As per IntelliJ Code Coverage docs:

Prerequisite

Make sure the Code Coverage plugin is enabled. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins settings page as described in Managing Plugins. If the plugin is disabled, the code coverage tabs will not be visible in the run/debug configuration dialogs.

Try opening Settings > Build, Execution, Deployment > Coverage and check the "Activate Coverage View" checkbox. After that run another test with Coverage.

like image 89
Karol Dowbecki Avatar answered Oct 06 '22 19:10

Karol Dowbecki


It's not a problem with JDK or latest version of IntelliJ.

Here is the step you follow and see the coverage window. Run project with coverage, sometimes coverage window not shown if you are unable to see coverage window then

  • press shift+f9
  • then press on stop and rerun

After this, your coverage window is shown.

Still, if you are unable to see coverage window then please double check is coverage view enable or not follow these steps:

  • press ctrl+alt+s
  • extend build, execution and deployment
  • press coverage
  • select first radio box and activate coverage view
  • press apply and then ok

Again follow the above step run with coverage, press shift+f9 etc.

Hope this help.

like image 22
Ammar Ali Avatar answered Oct 06 '22 19:10

Ammar Ali


Try and go to

Run-->edit configurations-->select code coverage ( then you can select IDEA/EMMA/...)
like image 25
iamsankalp89 Avatar answered Oct 06 '22 17:10

iamsankalp89