From 4291ad3e8e1893bc6393df7f4b05fa9c2495817c Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 13 Aug 2015 15:56:22 +0800 Subject: [PATCH] MDL-51102 behat: Add a non-JS version of wait --- lib/tests/behat/behat_general.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index e467d458d13..bd28bf6544e 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -244,12 +244,11 @@ class behat_general extends behat_base { * @param int $seconds */ public function i_wait_seconds($seconds) { - - if (!$this->running_javascript()) { - throw new DriverException('Waits are disabled in scenarios without Javascript support'); + if ($this->running_javascript()) { + $this->getSession()->wait($seconds * 1000, false); + } else { + sleep($seconds); } - - $this->getSession()->wait($seconds * 1000, false); } /**