IntelliJ IDEA 2020.1 Help

Create run/debug configurations for tests

  1. Select Run | Edit Configuration from the main menu.

  2. In the Run/Debug Configurations dialog, click the Add New Configuration button on the toolbar or press Alt+Insert.

  3. Select the testing framework that you use from the list (for example, the JUnit icon JUnit or the TestNG icon TestNG).

  4. A new configuration page opens. Name this configuration.

  5. From the Test kind list, select the scope for your tests: for an individual method or a class, for all tests in a package or a directory.

  6. Depending on the selected test kind, specify the items that you want to run with this configuration.

    For example, if you have seleted Method, specify the class and the method that IntelliJ IDEA is going to run in this configuration.

    JUnit run/debug configuration for a method
  7. (Optionally) Switch to the Code Coverage tab and select a coverage runner.

  8. Apply the changes and close the dialog.

For more information on specific options in the run/debug configurations dialog, refer to the corresponding pages JUnit or TestNG.

If you want to change the default run/debug configuration template for tests, refer to Run/debug configuration templates.

Last modified: 25 May 2020