You are here

public function WebDriverWebAssert::waitForElement 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::waitForElement()

Waits for the specified selector and returns it when available.

Parameters

string $selector: The selector engine name. See ElementInterface::findAll() for the supported selectors.

string|array $locator: The selector locator.

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::waitForElement

See also

\Behat\Mink\Element\ElementInterface::findAll()

File

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

Class

WebDriverWebAssert
Contains asynchronous assertions.

Namespace

Drupal\Tests\lightning_media\FunctionalJavascript

Code

public function waitForElement($selector, $locator, $timeout = 10000) {
  $element = parent::waitForElement($selector, $locator, $timeout);
  Assert::assertNotEmpty($element);
  return $element;
}