Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default test framework in Intellij IDEA?

Situation is the following: I've succesfully created tests in IntellijIDEA with JUnit. Then when I rightclick on test folder to run tests I accidentally have chosen TestNG instead of JUnit. Now when I try to run tests by right click on tests folder and clicking Run"All tests" it tries to run them in TestNG, but tests are not configured for TestNG that's why I have

Test framework quit unexpectedly, No tests found in the package error

I searched through the internet, but didn't find anything on how to change testing framework by default. Can anyone help?

like image 501
president Avatar asked Feb 14 '18 12:02

president


1 Answers

Just delete the automatically created TestNG Run/Debug Configuration (Run | Edit Configurations... action) in Run Configurations dialog for the project. Then you will again have the option to choose test framework.

UPD: Since 2017.3 version there is suggest.all.run.configurations.from.context property which you can set (Help | Edit Custom Properties action) to true, then IDE will show you all the configurations that are available for current context.

like image 194
Andrey Avatar answered Sep 23 '22 09:09

Andrey