You are here

public function WebDriverWebAssert::waitForButton in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/FunctionalJavascript/WebDriverWebAssert.php \Drupal\Tests\lightning_media\FunctionalJavascript\WebDriverWebAssert::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.

Overrides JSWebAssert::waitForButton

File

tests/src/FunctionalJavascript/WebDriverWebAssert.php, line 16

Class

WebDriverWebAssert
Contains asynchronous assertions.

Namespace

Drupal\Tests\lightning_media\FunctionalJavascript

Code

public function waitForButton($locator, $timeout = 10000) {
  $button = parent::waitForButton($locator, $timeout);
  Assert::assertNotEmpty($button);
  return $button;
}