You are here

public function JSWebAssert::waitForLink in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForLink()
  2. 9 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForLink()

Waits for a link with specified locator and returns it when available.

Parameters

string $locator: The link ID, title, text or image alt.

int $timeout: (Optional) Timeout in milliseconds, defaults to 10000.

Return value

\Behat\Mink\Element\NodeElement|null The page element node if found, NULL if not.

File

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

Class

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

Namespace

Drupal\FunctionalJavascriptTests

Code

public function waitForLink($locator, $timeout = 10000) {
  return $this
    ->waitForElement('named', [
    'link',
    $locator,
  ], $timeout);
}