Skip to content

Commit

Permalink
Merge branch 'MDL-48318-28' of git://github.com/lameze/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_28_STABLE
  • Loading branch information
David Monllao committed Dec 16, 2014
2 parents 73c991d + e784850 commit 43c3b0e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/tests/behat/behat_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,18 @@ protected function wait_for_pending_js() {
for ($i = 0; $i < self::EXTENDED_TIMEOUT * 10; $i++) {
$pending = '';
try {
$jscode = 'return ' . self::PAGE_READY_JS . ' ? "" : M.util.pending_js.join(":");';
$jscode =
'if (typeof M === "undefined") {
if (document.readyState === "complete") {
return "";
} else {
return "incomplete";
}
} else if (' . self::PAGE_READY_JS . ') {
return "";
} else {
return M.util.pending_js.join(":");
}';
$pending = $this->getSession()->evaluateScript($jscode);
} catch (NoSuchWindow $nsw) {
// We catch an exception here, in case we just closed the window we were interacting with.
Expand Down

0 comments on commit 43c3b0e

Please sign in to comment.