Posts

Showing posts with the label espresso

Espresso & Progress bar Dialog: The epic conflict

If you are trying to test your app that has a ProgressDialog in it, STOP RIGHT THERE! You are gonna be in a world of pain, when your tests keep failing for no apparent reason after failing to find the progressDialog that is vividly visible on the screen. The problem isn't in your code. It's the shortcoming of the Espresso Testing Framework. The framework can't really handle the animations of the progress dialog. I am still digging around the exact reason, however from the little bit of research I have figured out that the drawable animation of the circle gives the impression of non idle state to the Espresso framework. So what does it mean? It means Espresso keeps waiting for the app to enter the idle state and as long as the progress dialog is visible on the screen, the app stays in the busy state. By the time animation ends, the progress dialog is gone. When the app enters the idle state and espresso comes out of the waiting loop to start running tests, it fails toex