Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Espresso not to wait for progress

By default espresso waits for the progress bar from my activity to finish loading before executing the next instructions.

I would like to force Espresso not to wait for it and execute the rest of instructions as the progress dialog is loading.

Any hits as to where I should look for that?

After some investigations I assume I must make use of the IdlingResource class.

like image 510
Adrian Olar Avatar asked Jan 11 '16 13:01

Adrian Olar


1 Answers

Check this answer:

The default timeout that Espresso will wait for all registered resources to become idle is one minute.

You can change this using the IdlingPolicies class to set an explicit timeout:

IdlingPolicies.setIdlingResourceTimeout(1, TimeUnit.HOURS);

From: Espresso how to wait for some time(1 hour)?

Instead of 1 hour try to set for example 1 second (I don't know if 0 is allowed).

You can also create a custom Idling Resource like it is explained here: Espresso: Thread.sleep( );

Hope it help

like image 146
piotrek1543 Avatar answered Sep 19 '22 16:09

piotrek1543