Class WaitHelper


  • public class WaitHelper
    extends Object
    Helper class for waiting.
    • Method Detail

      • waitFor

        public static void waitFor​(long milliSeconds)
        Wait until a given time.
        Parameters:
        milliSeconds - time in milliseconds
      • waitUntil

        public static void waitUntil​(BooleanSupplier predicate,
                                     int timeoutAfterSec,
                                     String jobDescription)
        Wait until the given supplier gives true.

        This method checks the predicate every 200 ms.

        Parameters:
        predicate - function that tells if waiting should be over
        timeoutAfterSec - maximum number of seconds to wait
        jobDescription - name of the condition to wait on. Used in the timeout exception.