Testing Android Applications
With IntelliJ IDEA you can generate and run unit tests for your Android applications using Android Testing Framework.
When the Android project is created, IntelliJ IDEA creates the following test directories containing sample tests:
- test directory - for running Unit tests
- androidTest directory - for running Instrumented Unit tests
To execute unit tests, IntelliJ IDEA provides an Android-specific run configuration.
To run tests for an Android application
- Specify the tests that you want to run. Do one of the following:
- To run a single test, open it in the editor and select Run | name of the test from the context menu. IntelliJ IDEA creates a temporary run configuration for your test.
- To run all tests in a class or an entire test module, create an Android Test run/debug configuration.
- Select a run/debug configuration from the drop-down list on the main toolbar and start the test according to it.
- Monitor the test execution and view test results in the Test Runner tab of the Run tool window.
Last modified: 24 July 2018