like a billion times!
These are the things I have learnt:
- Android/Studio use JUnit 3 so the constructor for your test suite MUST NOT have any parameters (aka don't let Studio create a constructor for you because it will add a parameter and JUnit will not be able to find your test suite):
- Your test needs to be in:
More info - The package of your test needs to be different from the package of the class you want to test, i.e: if the package for your activity is
then the test should be in - Don't bother trying to run it from the IDE (don't believe this)
- Start your emulator
- Go to <yourProjectDir> (or where your gradlew is)
- Run
./gradlew connectedInstrumentTest
- The results can be found at: