简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM