How can I view the IntelliJ IDEA “Test Runner Tab” when running tests from maven?

前端 未结 2 2026
别跟我提以往
别跟我提以往 2021-01-04 13:19

In IntelliJ IDEA when I normally run a unit test I got a dialog that shows me test progress and lets me easily go through the test results. However, I\'m using maven for my

相关标签:
2条回答
  • 2021-01-04 13:47

    I recently figured out as close as I think I'll be able to get to an answer. The tests themselves have to be run from intellij-idea. But I can still configure IntelliJ IDEA to run the build via maven first.

    Edit Run Debug Configuration

    As you can see in the Red Highlighted Box I've selected a saved maven build configuration for it to run. So as not to duplicate tests, and keep things simple its a simple mvn package -DskipTests type build. I'm still curious if the tests are any different having IntelliJ IDEA run them vs the maven-surefire-plugin but now I at least know that the build process is the same.

    0 讨论(0)
  • 2021-01-04 13:47

    You can run tests using the maven project window in IntelliJ View - Tool Windows - Maven Projects

    Then under the project or module you wish to test open the lifecycle goals and click test.

    This will run the currently configured test goal. Now the report is logged into the target directory

    I use https://github.com/destin/maven-test-support-plugin to view the test results.

    You can access this screen once the plugin is installed from the Project window again right click on the projects root and select "Show Test Results" (should be below the maven icon)

    Good luck

    0 讨论(0)
提交回复
热议问题