MDL-66979 behat: Set script timeout with timeout factor

This commit is contained in:
Andrew Nicols 2021-01-28 15:27:49 +08:00
parent ec9bb74405
commit e631b8c5e1

View file

@ -290,13 +290,26 @@ EOF;
if ($session->isStarted()) {
$session->restart();
} else {
$session->start();
$this->start_session();
}
if ($this->running_javascript() && $this->getSession()->getDriver()->getWebDriverSessionId() === 'session') {
throw new DriverException('Unable to create a valid session');
}
}
/**
* Start the Session, applying any initial configuratino required.
*/
protected function start_session(): void {
$this->getSession()->start();
$this->getSession()->getDriver()->setTimeouts([
// The standard script timeout is 30000 ms.
// Use `get_real_timeout` to multiply this by the behat increased timeout factor.
'script' => self::get_real_timeout(30000),
]);
}
/**
* Restart the session before each non-javascript scenario.
*