After updating Android Studio to Chipmunk we can't start our UI tests located in differen folder than androidTest from AndroidStudio itself anymore.
We get instead an error message:
Error running "...Test"
Class "..." not found in module 'OurApp:app'
As mentioned above our tests are not located in androidTest folder, but in sharedTestDebug instead. However it wasn't a problem with prior versions of Android Studio until Chipmunk.
We also add this folders in our build.gradle
sourceSets {
String sharedTestDebugDir = 'src/sharedTestDebug/java'
String sharedTestDir = 'src/sharedTest/java'
androidTest {
java.srcDirs += sharedTestDir
java.srcDirs += sharedTestDebugDir
}
}
Another finding: we are only not able to start single tests. if we start running all tests from AS, it works.
update
Also found out that in "Edit configurations" we are not able to select any instrumented test other then from androidTest folder
update2
same behavior in the dolphin and electric eel versions :(
if you want to run a single instrumented tests you need to select module to run the test from. Unfortunately in the selection you can only select the module with corresponding androidTest folder.
update3 It seems to be a known issue :(
I found a workaround to let run single instrumentation tests again
I created a symbol link referencing from the folder where our tests located to androidTestDebug. For that I ran following command from the src-folder:
To have it also in git I called
and then
Maybe someone else will find another solution.