I have a button in my app that triggers an asynctask. When testing, I want to create a race condition(e.g. the network is slow).
So I want to test this following sequences:
Click button A and before it finishes(return of onPostExecute), do something else.
The problem is that for tools like Espresso, they only have idlingresource to wait till the return of onPostExecute but they cannot delay the return.