udacity / AdvancedAndroid_TeaTime

115 stars 307 forks source link

android.support.test.espresso.IdlingResourceTimeoutException: #12

Closed ZubairKh closed 6 years ago

ZubairKh commented 6 years ago
android.support.test.espresso.IdlingResourceTimeoutException: Wait for [SimpleIdlingResource] to become idle timed out
at dalvik.system.VMStack.getThreadStackTrace(Native Method)

After following all the instructions, I am getting above exception while Running the test

IdlingResourceMenuActivityTest
at com.example.android.teatime.IdlingResourceMenuActivityTest.idlingResourceTest(IdlingResourceMenuActivityTest.java:40)

And Line 40 of the code wrote exactly as you've guided or written in your sample

onData(anything()).inAdapterView(withId(R.id.tea_grid_view)).atPosition(0).perform(click());

can you guide me solve this issue?

Thanks

ZubairKh commented 6 years ago

Resolved this issue. In SimpleIdlingResource.java

@Override
    public boolean isIdleNow() {
        return mIsIdleNow.get();
    }

I was forgot to write mIsIdleNow.get(); it was return false; previously. Now Test run successfully :-)