1

In my Espresso (2.2.2) testcase I perform a simple click:

// go to checkout
    onView(withId(com.highstreet.core.R.id.checkout_button))
            .perform(click());

What happens when the button is clicked, is that an new layout is loaded with a ProgressBar in it. when the checkout fragment has finished loading, the ProgressBar is hidden, by setting its visibility to GONE. But it remains present in the layout. The test fails after the default timeout of 60 seconds with an AppNotIdleException. I found out that the ProgressBar is blocking the idle test, since removing it from the layout lets the test pass. What is the best way to deal with this? My device has animations turned off in developer options.

As suggested here: ProgressBars and Espresso , replacing the animation drawable is appealing, but note that the progressbar is not available in the view hierarchy yet when I click the button.

Community
  • 1
  • 1
Nino van Hooff
  • 3,677
  • 1
  • 36
  • 52

0 Answers0