MDL-37750 behat: Waiting for DOM ready

This commit is contained in:
David Monllao
2013-02-08 17:11:27 +08:00
parent ff48a235a9
commit d56ae59b47
+2 -11
View File
@@ -52,11 +52,6 @@ use Behat\Behat\Event\StepEvent as StepEvent;
*/
class behat_hooks extends behat_base {
/**
* @var string The last visited URL.
*/
private $lasturl = null;
/**
* Gives access to moodle codebase, ensures all is ready and sets up the test lock.
*
@@ -162,12 +157,8 @@ class behat_hooks extends behat_base {
return;
}
// Wait until the page is ready if we are in a new URL.
$currenturl = $this->getSession()->getCurrentUrl();
if (is_null($this->lasturl) || $currenturl !== $this->lasturl) {
$this->lasturl = $currenturl;
$this->getSession()->wait(self::TIMEOUT, '(document.readyState === "complete")');
}
// Wait until the page is ready.
$this->getSession()->wait(self::TIMEOUT, '(document.readyState === "complete")');
}
}