Firstly, I've turned off all the animation settings:
- Window animation scale
- Transition animation scale
- Animator duration scale
Recently I need to add Espresso test cases for an old Android project(5 years+), and I don't have enough time to digging around all the custom views.
After reading many other posts here, I know that custom views might trigger this one, Espresso: AppNotIdleException
I did try to read the threads info as Espresso test error: AppNotIdleException and espresso onView inconsistent performance, but it seems that's not easy to fetch info from it(146 threads in my case):
I tried to search the android:repeatCount
in the code base(via This SO answer), once again, not related.
There're several QAs related to this issue, but it seems they're not applying to my specific case.
The layout file that I want to click is simple:
<RelativeLayout
android:id="@+id/home_tab_discover"
style="@style/home_tab_item">
<SomeCustomImageView
android:id="@+id/home_tab_icon_discover"
...
The espresso case:
@Test
fun test_shelf_enter() {
Espresso.onView(ViewMatchers.withId(R.id.home_tab_icon_discover)).perform(ViewActions.click())
}
Then it launch the app, and I did see all the elements in the activity, but the Espresso waited infinitely.