Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio add test folder or module to existing project [duplicate]

Tags:

android

junit

I want to add testing to my android app in Android Studio 1.4. When I try to create and add them to /test folder under a root folder they aren't executed. Also, I tried to create a separate module for tests but there are no Test Module in a wizard. How can I add and run Junit tests? Thank you in advance.

like image 401
Margarita Spasskaya Avatar asked Oct 06 '15 14:10

Margarita Spasskaya


People also ask

Can I duplicate a project in Android Studio?

Select your project then go to Refactor -> Copy... . Android Studio will ask you the new name and where you want to copy the project. Provide the same. After the copying is done, open your new project in Android Studio.

How do I create a test folder on android?

Right click on src folder and select create directory and android studio will show you folder like "test/java", "test/kotlin", "androidTest/java" etc. Just select one, simple.

Can I delete the test folder in Android Studio?

Yes You can delete them ,you can go to build. gradle and then remove following dependencies which comes preloaded in any new android project. and then click on the androidTest and Test package and Press Delete they will be removed !


1 Answers

https://stackoverflow.com/a/28630023/4955008 This helped me a lot, Studio recognized folder as a test and it passed.

like image 173
Margarita Spasskaya Avatar answered Oct 09 '22 06:10

Margarita Spasskaya