function JSWebAssert::waitForHelper

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

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.