src/Concerns/WaitsForElements.php
public function waitForReload($callback = null, $seconds = null)
    {
        $token = Str::random();

        $this->driver->executeScript("window['{$token}'] = {};");

        if ($callback) {
            $callback($this);
        }

        return $this->waitUsing($seconds, 100, function () use ($token) {
            return $this->driver->executeScript("return typeof window['{$token}'] === 'undefined';");
        }, 'Waited %s seconds for page reload.');
    }
public function waitForReload($callback = null, $seconds = null)
    {
        $token = Str::random();

        $this->driver->executeScript("window['{$token}'] = {};");

        if ($callback) {
            $callback($this);
        }

        return $this->waitUsing($seconds, 100, function () use ($token) {
            return $this->driver->executeScript("return typeof window['{$token}'] === 'undefined';");
        }, 'Waited %s seconds for page reload.');
    }
public function waitForReload ( $ callback = null , $ seconds = null ) { $ token = Str :: random ( ) ; $ this -> driver -> executeScript ( "window['{$token}'] = {};" ) ; if ( $ callback ) { $ callback ( $ this ) ; } return $ this -> waitUsing ( $ seconds , 100 , function ( ) use ( $ token ) { return $ this -> driver -> executeScript ( "return typeof window['{$token}'] === 'undefined';" ) ; } , 'Waited %s seconds for page reload.' ) ; }
Wait for the current page to reload.

@param  Closure  $callback
@param  int  $seconds
@return $this
@throws \Facebook\WebDriver\Exception\TimeOutException
Wait for the current page to reload .