2

I started using JakeWharton's DoubleExpresso library and I was able to set it up as per instructions but unfortunately it's not able to find test cases.

My gradle config looks like this:

androidTestCompile('com.jakewharton.espresso:espresso:1.1-r2') {
    exclude group:'com.google.guava', module:'guava'
}
androidTestCompile('com.jakewharton.espresso:espresso-support-v4:1.1-r2') {
    exclude group:'com.android.support', module:'support-v4'
    exclude group:'com.google.guava', module:'guava'
}

And my test case looks like this (src/androidTest/NavigationTest.java)

public class NavigationTest extends ActivityInstrumentationTestCase2<MainActivity> {

    public NavigationTest() {
        super(MainActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    @SmallTest
    public void testAddition() {
        assertEquals(1 + 1, 2);
    }
}

Any ideas why this test case is not being caught by Expresso?

Update: It works perfectly if I run it on command line, seems like this happens only on Android Studio.

Sunny
  • 286
  • 1
  • 4
  • 14
  • Have you configured the testInstrumentationRunner in your build.gradle file and your build configurations? For your build file, it should be in your defaultConfig and look like this: testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner". For your build config, it should go in the box titled "Specific instrumentation runner". – Maxwell Apr 28 '14 at 19:00

0 Answers0