Does anybody knows how to run tests with coverage using Gradle in IntelliJ IDEA? It seems that the option is missing from contextual menu and if invoked from left side of the screen the following problem is reported:
Error running **TestClass**
Cannot find runner for **TestClass**
No Gradle targets are run before import and Build, Execution, Deployment > Build Tools > Gradle > Runner > Delegate IDE build/run actions to gradle option is enabled.
If you want to reopen the Coverage tool window, select Run | Show Code Coverage Data from the main menu, or press Ctrl+Alt+F6 . The report shows the percentage of the code that has been executed or covered by tests. You can see the coverage result for classes, methods, and lines.
Use the command ./gradlew test to run all tests.
How to generate a Test Report. Gradle generates a Test Report automatically when it runs the entire Test Suite. To do the same, run ./gradlew test (or gradlew. bat test from Windows), or run the test Gradle task from your IDE.
Code coverage is not supported for Gradle test runner in IntelliJ IDEA at the moment, please follow the related request for updates:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With