function JSWebAssert::waitForButton

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForButton()
  2. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForButton()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForButton()

Waits for the button specified by the 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 244

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);
}

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