I’ve been looking for a solution to this for a while and finally found something that works for me.
This will allow you to put common testing classes in another module.
android {
...
sourceSets {
androidTest.java.srcDirs += ["${project('match the module name that is currently in the dependencies').projectDir}/src/androidTest/java"]
}
}
So for the example above it would probably look something like
androidTest.java.srcDirs += ["${project(':appbase').projectDir}/src/androidTest/java"]