code: function wait(testCallback, waitCallback) {
            if (!testCallback()) {
              // Wait for timeout
              if ((new Date().getTime()) - startTime < maxLoadTime) {
                Delay.setTimeout(waitCallback);
              } else {
                failed();
              }
            }
          }
docs: Calls the waitCallback until the test returns true or the timeout occurs