Using Android Studio to run tests
In this section, we will look at how we can run one or multiple tests in Android Studio. Android Studio comes with a good set of shortcuts and visual tools to help with testing. If you want to create a new test for your class or go to existing tests for your class, you can use the Ctrl + Shift + T (Windows) or Command + Shift + T (macOS) shortcut. You will need to make sure that the contents of your class are currently in focus in the editor for the keyboard shortcut to take effect
To run tests, there are two options. The first is to right-click your file or the package and select the Run Tests in ‘…’ option. The other option comes in handy if you want to run a test suite independently. You can go to the particular test method and select the green icon near the name of the class, which will execute all the tests in the class.

Figure 9.2 – Running a group of tests
For an individual test, you can click the...