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

Breadcrumb

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

function Element::waitFor

Overrides ElementInterface::waitFor

File

vendor/behat/mink/src/Element/Element.php, line 109

Class

Element
Base element.

Namespace

Behat\Mink\Element

Code

public function waitFor($timeout, callable $callback) {
    $start = microtime(true);
    $end = $start + $timeout;
    do {
        $result = call_user_func($callback, $this);
        if ($result) {
            break;
        }
        usleep(10000);
    } while (microtime(true) < $end);
    return $result;
}

API Navigation

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