Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Selenium2Driver.php

function Selenium2Driver::wait

Overrides CoreDriver::wait

File

vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php, line 1101

Class

Selenium2Driver
Selenium2 driver.

Namespace

Behat\Mink\Driver

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal