简体   繁体   English

如何在Intellij IDEA中更改默认测试框架?

[英]How to change default test framework in Intellij IDEA?

Situation is the following: I've succesfully created tests in IntellijIDEA with JUnit . 情况如下:我已经成功地使用JUnitIntellijIDEA创建了测试。 Then when I rightclick on test folder to run tests I accidentally have chosen TestNG instead of JUnit . 然后,当我右键单击测试文件夹以运行测试时,我不小心选择了TestNG而不是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 现在,当我尝试通过右键单击tests文件夹并单击Run“All tests”来运行测试时,它会尝试在TestNG运行它们,但是没有为TestNG配置测试这就是为什么我有

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. 只需删除项目的“运行配置”对话框中自动创建的TestNG运行/调试配置(运行|编辑配置...操作)。 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. UPD:自2017.3版以来,您可以将suggest.all.run.configurations.from.context属性设置为( 帮助|编辑自定义属性操作)为true,然后IDE将显示可用于当前上下文的所有配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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