function JSWebAssert::waitForHelper

Same name in other branches
  1. 9 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.

5 calls to JSWebAssert::waitForHelper()
JSWebAssert::statusMessageNotContains in core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
Asserts that a status message containing a given string does not exist.
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 229

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.