Skip to content

Commit

Permalink
MDL-51102 behat: Add a non-JS version of wait
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Aug 17, 2015
1 parent f5e48d2 commit 14d5445
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/tests/behat/behat_general.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,11 @@ public function click_link($link) {
* @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);
}

/**
Expand Down

0 comments on commit 14d5445

Please sign in to comment.