dashed-circular-progress icon indicating copy to clipboard operation
dashed-circular-progress copied to clipboard

Espresso UI testing throws androidx.test.espresso.AppNotIdleException

Open joeyoggie opened this issue 5 years ago • 0 comments

Hello, I'm running an Espresso UI test, and whenever it reaches the fragment that has a RecyclerView that has this item in the adapter, the test freezes and fails.

It throws the following:

androidx.test.espresso.AppNotIdleException: Looped for 3041 iterations over 60 SECONDS.

This is the output of the test:

E/TestRunner: failed: mainActivityTest(com.vhorus.saloni.barberapp.tests.MainActivityOwnerTest) ----- begin exception ----- E/TestRunner: androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 247, 478 and precision: 16, 16' on view 'with string from resource id: <2131820718>[home_performance] value: الأداء'. at androidx.test.espresso.PerformException$Builder.build(PerformException.java:86) at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:87) at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:322) at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:178) at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:119) at com.vhorus.saloni.barberapp.tests.MainActivityOwnerTest.mainActivityTest(MainActivityOwnerTest.java:55) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at tools.fastlane.screengrab.locale.LocaleTestRule$1.evaluate(LocaleTestRule.java:32) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189) Caused by: androidx.test.espresso.AppNotIdleException: Looped for 3041 iterations over 60 SECONDS. The following Idle Conditions failed . at androidx.test.espresso.IdlingPolicy.handleTimeout(IdlingPolicy.java:59) at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:541) at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:484) at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent(UiControllerImpl.java:236) at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:162) at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:139) at androidx.test.espresso.action.Tap.sendSingleTap(Tap.java:170) at androidx.test.espresso.action.Tap.access$100(Tap.java:31) at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:47) at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:13

I also get this warning for the 60s duration before the test fails.

W/View: requestLayout() improperly called by androidx.appcompat.widget.AppCompatTextView{fa005a8 V.ED..... ........ 167,186-314,333 #7f0901a0 app:id/itemPercentageTextView_performanceItemPercentageFragment} during second layout pass: posting in next frame

joeyoggie avatar Dec 09 '19 14:12 joeyoggie