Search code examples
androidunit-testingintellij-ideaandroid-testing

Android Studio Mark Directory as Test Sources Root


I've done something in build.gradle to remove the green highlighting of the androidTest.java package.

I don't know how to get it back.

IntelliJ has a "Mark directory as test sources root" option in the context menu but I can't find the equivalent in Android Studio.

Is there a way to define this folder so I can start testing? (If it means anything, the test java files all have an icon of a "J" with a red circle around it)


Solution

  • You can click on the folder and type Cmd + Shift + a to enter the action search and then by typing Mark directory as you will get the menu.