Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pivotaljohn/ccd15700b1ce88ef30abcbe1abddc553 to your computer and use it in GitHub Desktop.
Save pivotaljohn/ccd15700b1ce88ef30abcbe1abddc553 to your computer and use it in GitHub Desktop.
When you don't setup Espresso correctly
Getting this output
```
Testing started at 2:24 PM ...
05/09 14:24:43: Launching GreetingScreenTest
$ adb push /Users/pivotal/workspace/guards-android/modules/greeting/build/outputs/apk/greeting-debug-androidTest-unaligned.apk /data/local/tmp/com.reelsecurity.guardapp.greeting.test
$ adb shell pm install -r "/data/local/tmp/com.reelsecurity.guardapp.greeting.test"
pkg: /data/local/tmp/com.reelsecurity.guardapp.greeting.test
Success
Running tests
$ adb shell am instrument -w -r -e debug false -e class com.reelsecurity.guardapp.greeting.GreetingScreenTest com.reelsecurity.guardapp.greeting.test/android.test.InstrumentationTestRunner
Client not ready yet..Test running started
junit.framework.AssertionFailedError: No tests found in com.reelsecurity.guardapp.greeting.GreetingScreenTest
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1873)
Tests ran to completion.
```
We hadn't followed all these steps:
https://google.github.io/android-testing-support-library/docs/espresso/setup/
specifically were missing:
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment