espresso-test-lib/EspressoInstrumentation/src/com/tomtom/espresso/test/CucumberHelperTestSteps.java
public static void checkViewWithIdIsCompletelyDisplayed(final int id) {
        int retries = 20;
        do {
            try {
                onView(withId(id)).check(matches(isCompletelyDisplayed()));
                return;
            } catch (final junit.framework.AssertionFailedError e) {
                try { // Retry every half a second during 10 seconds
                    Thread.sleep(RETRY_WAIT);
                } catch (final InterruptedException ex) {
                }
            }
        } while (--retries > 0);
        onView(withId(id)).check(matches(isCompletelyDisplayed()));
    }
/**
     * Test if some view is displayed and retry for 10 seconds in case it's asynchronously loaded
     *
     * @param id
     *            ID of the view item to test
     */
Test if some view is displayed and retry for 10 seconds in case it's asynchronously loaded
@param id
ID of the view item to test
Test if some view is displayed and retry for 10 seconds in case it ' s asynchronously loaded @param id ID of the view item to test
public static void checkViewWithIdIsCompletelyDisplayed(final int id) {
        int retries = 20;
        do {
            try {
                onView(withId(id)).check(matches(isCompletelyDisplayed()));
                return;
            } catch (final junit.framework.AssertionFailedError e) {
                try { 
                    Thread.sleep(RETRY_WAIT);
                } catch (final InterruptedException ex) {
                }
            }
        } while (--retries > 0);
        onView(withId(id)).check(matches(isCompletelyDisplayed()));
    }
public static void checkViewWithIdIsCompletelyDisplayed ( final int id ) { int retries = 20 ; do { try { onView ( withId ( id ) ) . check ( matches ( isCompletelyDisplayed ( ) ) ) ; return ; } catch ( final junit . framework . AssertionFailedError e ) { try { Thread . sleep ( RETRY_WAIT ) ; } catch ( final InterruptedException ex ) { } } } while ( -- retries > 0 ) ; onView ( withId ( id ) ) . check ( matches ( isCompletelyDisplayed ( ) ) ) ; }
Test if some view is displayed and retry for 10 seconds in case it's asynchronously loaded
 @param id
            ID of the view item to test
Test if some view is displayed and retry for 10 seconds in case it ' s asynchronously loaded @param id ID of the view item to test
// Retry every half a second during 10 seconds