function Selenium2Driver::wait
Overrides CoreDriver::wait
File
-
vendor/
lullabot/ mink-selenium2-driver/ src/ Selenium2Driver.php, line 1101
Class
- Selenium2Driver
- Selenium2 driver.
Namespace
Behat\Mink\DriverCode
public function wait(int $timeout, string $condition) {
$script = 'return (' . rtrim($condition, " \t\n\r;") . ');';
$start = microtime(true);
$end = $start + $timeout / 1000.0;
do {
$result = $this->getWebDriverSession()
->execute(array(
'script' => $script,
'args' => array(),
));
if ($result) {
break;
}
usleep(10000);
} while (microtime(true) < $end);
return (bool) $result;
}