We already executed our tests through the Android Studio. However, once you write them all, you will want to run them all at once. You can run all the unit tests for all build variants, but only for a certain flavor or build type. The same applies for instrumentation tests. We will show you several examples to do so using existing build variants for the Journaler application.
Running tests
Running unit tests
Open the terminal and navigate to the root package of the project. To run all unit tests, execute the following command line:
$ ./gtradlew test
This will run all the unit tests we wrote. The testing will fail since NoteTest uses content provider. For this, it's required to be executed with the proper Runner class...