Closed S2606 closed 7 years ago
Try registering an IdlingResource like file IdlingResourceMenuActivityTest.
private IdlingResource mIdlingResource;
// Registers any resource that needs to be synchronized with Espresso before the test is run. @Before public void registerIdlingResource() { mIdlingResource = mActivityTestRule.getActivity().getIdlingResource(); // To prove that the test fails, omit this call: Espresso.registerIdlingResources(mIdlingResource); }
@After public void unregisterIdlingResource() { if (mIdlingResource != null) { Espresso.unregisterIdlingResources(mIdlingResource); } }
I think this error happens because MenuActivity.java simulates a large file download at onStart() registering a mIdlingResource so if you try to run a test without using an IdlingResource the test will fail.
Thanks @luishts for helping me
@S2606, your welcome! I had the same problem and I'm glad that it helped.
on running the test on an emulator, a error android.support.test.espresso.PerformException: Error performing 'load adapter data' on view 'with id: com.example.android.teatime:id/tea_grid_view'. occurs.