/** * @see Behat\Mink\Driver\DriverInterface::click() */ public function click($xpath) { $this->browser->click(SeleniumLocator::xpath($xpath)); $readyState = $this->browser->getEval('window.document.readyState'); if ($readyState == 'loading' || $readyState == 'interactive') { $this->browser->waitForPageToLoad($this->timeout); } }
/** * {@inheritdoc} */ public function wait($timeout, $condition) { $condition = 'with (selenium.browserbot.getCurrentWindow()) { ' . "\n" . $condition . "\n }"; try { $this->browser->waitForCondition($condition, $timeout); } catch (SeleniumException $e) { // ignore error } return $this->browser->getEval($condition) == 'true'; }