5

I am new to automation testing. I wanted to run a specific test class even though i am having the test suite, it gives me output as

"Client not ready yet..Test running started... Tests ran to completion...Empty test suite.."

I have searched and found many solutions too. but none of them worked for me. I will appreciate if I get any help in this. here is the test file.

 package com.smsbits.veridoc.activity;

@RunWith(AndroidJUnit4.class)
public class TempActivityEspressoTest {
public Resources resources;

@Rule
public ActivityTestRule mActivityRule = new ActivityTestRule<>(TempActivity.class);

@Before
public void init() {
    resources = mActivityRule.getActivity().getResources();
}

@Test
public void testCheckInputs() {
    onView(withId(R.id.btnchange)).perform(click());
    onView(withId(R.id.tvrandom)).check(ViewAssertions.matches(withText("hello")));
}} 

here is my gradle file.

android {  
... 
packagingOptions {
    ...
    exclude 'META-INF/XXX'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/DEPENDENCIES'
}

defaultConfig {
    ...
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

testOptions {
    unitTests.returnDefaultValues = true
}

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}

 }

dependencies{
...
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile "org.robolectric:robolectric:3.0"
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
    exclude group: 'javax.inject'
})
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2' //intents support
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
}
Riddhi Daftary
  • 301
  • 3
  • 14

1 Answers1

0

Try making a new Android Instrumented Tests configuration manually in Edit Configuration https://stackoverflow.com/a/53715513/967131

Chad Schultz
  • 7,770
  • 6
  • 57
  • 96