public function waitFor(callable $lambda, $attempts = 10, $waitInterval = 1)
    {
        for ($i = 0; $i < $attempts; $i++) {
            try {
                if ($lambda($this) === true) {
                    return;
                }
            } catch (\Exception $e) {
                //Do nothing and pass on to next iteration
            }

            $this->wait($waitInterval);
        }

        throw new \Exception(
            "Step did not succeed after {$attempts} attempts."
        );
    }