我关闭了开发者选项的所有动画.但是当我尝试点击其中一个按钮时,我仍然会遇到此异常.
我的应用确实是活跃的,并没有完全闲置,但我无法改变它.
android.support.test.espresso.AppNotIdleException: Looped for 6930
iterations over 60 SECONDS. The following Idle Conditions failed .
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:92)
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:56)
at android.support.test.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:184)
at android.support.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:115)
at android.support.test.espresso.ViewInteraction.perform(ViewInteraction.java:87)
Run Code Online (Sandbox Code Playgroud) 在使用 espresso 时,我经常遇到这样的情况:espresso 被卡住(例如 on onView(withId(R.id.somebutton)).perform(click()))等待所有资源空闲,据我所知,这些资源可以是动画、后台任务、队列中的可运行项等。目前我收到的唯一消息是:
E/TestRunner: androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 359, 1291 and precision: 16, 16' on view 'with id: com.example:id/somebutton'.
(...)
Caused by: androidx.test.espresso.AppNotIdleException: Looped for 7 iterations over 60 SECONDS. The following Idle Conditions failed .
Run Code Online (Sandbox Code Playgroud)
该应用程序非常复杂,有什么可以帮助缩小导致 espresso 认为该应用程序不空闲的原因吗?
android android-testing android-espresso android-orchestrator