If you have created an Android Studio project using the project wizard, then the basic test case for both test types will have been created automatically. The wizard will also include the necessary Gradle dependencies. If you are using a project created any other way, you will need to create a test directory structure and include Gradle dependencies by hand. These steps are outlined as follows:
- Inside your module/src directory, create a new folder alongside src/main called src/test.
- Inside this test directory, recreate the folder structure inside your main directory, for example:
- This directory is where you will place your test classes, and it will now be accessible from the IDE's project ...