package de.nenick.espressomacchiato.tools;

public class EspWait {

    public static void forDelay(int milliseconds) {
        try {
            Thread.sleep(milliseconds);
        } catch (InterruptedException e) {
            throw new IllegalStateException(e);
        }
    }
}

@@ -37,16 +37,70 @@
 tools;%0A%0A
+import android.support.test.InstrumentationRegistry;%0A%0A
 public c
@@ -327,11 +327,125 @@
  %7D%0A    %7D
+%0A%0A    public static void forIdle() %7B%0A        InstrumentationRegistry.getInstrumentation().waitForIdleSync();%0A    %7D
 %0A%7D%0A

add wait for idle tool