0

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.

Ross Keth
  • 53
  • 4
  • check out discussions at this link: https://stackoverflow.com/questions/21417954/espresso-thread-sleep – mbob Feb 08 '18 at 15:03
  • Thanks @mbob, however, this is the opposite of what I want. In the original question, they were asking how to "wait" till something is finished, however, mine is to delay or stop something from returning – Ross Keth Feb 12 '18 at 17:05

0 Answers0