function JSWebAssert::waitForHelper

Same name and namespace in other branches
  1. 10 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForHelper()
  2. 11.x core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForHelper()

Wraps waits in a function to catch curl exceptions to continue waiting.

Parameters

int $timeout: Timeout in milliseconds.

callable $callback: Callback, which result is both used as waiting condition and returned.

Return value

mixed The result of $callback.

4 calls to JSWebAssert::waitForHelper()
JSWebAssert::waitForElement in core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
Waits for the specified selector and returns it when available.
JSWebAssert::waitForElementRemoved in core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
Looks for the specified selector and returns TRUE when it is unavailable.
JSWebAssert::waitForElementVisible in core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
Waits for the specified selector and returns it when available and visible.
JSWebAssert::waitForText in core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
Waits for the specified text and returns TRUE when it is available.

File

core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php, line 157

Class

JSWebAssert
Defines a class with methods for asserting presence of elements during tests.

Namespace

Drupal\FunctionalJavascriptTests

Code

private function waitForHelper(int $timeout, callable $callback) {
    return $this->session
        ->getPage()
        ->waitFor($timeout / 1000, $callback);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.