In the new version of Android Studio, 2.3 Canary, I no longer have the "Run with Coverage..." option for tests.
Does anyone know if the option was somehow integrated into another mechanism, or was it removed altogether?
I hope not, that would be really bad, as I strongly relied on it when doing TDD with Robolectric :-( While the option to put a picture in the editor background is nice - having a cat stare at me for 8h is cool - not getting coverage reports is a rather high price to pay... :-(
View test coverage To run tests with coverage, follow the same steps as described in Run tests, only instead of clicking Run , click Run test-name with coverage . In the Project window, this option might be hidden behind More Run/Debug.
Android Studio has a built-in feature that allows you to run tests with code coverage. Simply navigate to the src/test/java folder and right click. Then select Run 'Tests in 'java'' with Coverage (awkward use of single quotes theirs not mine).
To add a testing source set for your build variant in Android Studio, follow these steps: In the Project window on the left, click the drop-down menu and select the Project view. Within the appropriate module folder, right-click the src folder and click New > Directory.
Testing is an integral part of the app development process. By running tests against your app consistently, you can verify your app's correctness, functional behavior, and usability before you release it publicly. You can manually test your app by navigating through it.
The option is back in Android Studio 2.3 Canary 3! :D
EDIT:
However, it seems broken :-( After running it once the IDE decided to say I have no tests in the suite :-(
However, there is a way to enable it in 2.3.2:
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