You are here

public function JSWebAssert::waitForButton in Drupal 10

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

Waits for a button (input[type=submit|image|button|reset], button) with specified locator and returns it.

Parameters

string $locator: The button ID, value or alt string.

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 185

Class

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

Namespace

Drupal\FunctionalJavascriptTests

Code

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