diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index d2f0bea4c7586..36f6a7eb3531c 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -303,11 +303,13 @@ protected function restart_session(): void { 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), - ]); + if ($this->running_javascript()) { // Goutte driver doesn't implement this. + $this->getSession()->getDriver()->setTimeouts([ + // The standard script timeout is 30000 ms. (aka, 30 seconds). + // Use `get_real_timeout` to multiply this by the behat increased timeout factor. + 'script' => self::get_real_timeout(30) * 1000, + ]); + } } /**