I'm writing UI tests for my application using Espresso. I'd like to test the fact that if I click the back button while a server request is in progress the app must remain where it is.
It seems not to be possible due to the espresso's architecture that makes the tests execution wait if some background operation (like AsyncTask) has been fired.
So, how can I test the following scenario:
- click on a button that fires an AsyncTask
- test that while the task is running and I press back button, the app stays there?
Is it possibile?
thank you