Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij does not run tests

After importing my project into Intellij and getting it to build successfully, I am trying to run some of my project's tests. I navigate to the test file and select Run -> Run. However, this does not run my tests, just opens a small "Edit Configurations" window, as the attached photo shows.

enter image description here

And, when I select Edit Configurations as prompted, JUnit is not to be found. The window is shown below.

enter image description here

What do I need to do to run the tests?

like image 372
mherzl Avatar asked Dec 16 '15 04:12

mherzl


People also ask

Why is IntelliJ not running tests?

Check in Project settings -> Modules that you test package is marked as Tests. Right click on the test class name either in the code window or in the project panel, and select Run <classname>. If you don't see the run menu in the popup then you haven't selected a test or you don't have junit plugin installed.

Why cant I press run on IntelliJ?

Try right-clicking within the file that contains a main method, and click "Run CLASSNAME. main()". That should generate a run configuration for the file that will let you use the green play button.


1 Answers

makre sure you IDEA have installed the Junit plugins and Junit jar in your classpath:enter image description here

and then just click this place to run test case:

enter image description here

like image 73
rayen Avatar answered Oct 04 '22 12:10

rayen