function JSWebAssert::waitForElement
Same name in other branches
- 9 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForElement()
- 8.9.x core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForElement()
- 10 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::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.
See also
\Behat\Mink\Element\ElementInterface::findAll()
9 calls to JSWebAssert::waitForElement()
- JSWebAssert::statusMessageContains in core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php - JSWebAssert::statusMessageContainsAfterWait in core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php - Asserts that a status message containing given string exists after wait.
- JSWebAssert::statusMessageExistsAfterWait in core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php - Asserts that a status message exists after wait.
- JSWebAssert::statusMessageNotContainsAfterWait in core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php - Asserts that no status message containing given string exists after wait.
- JSWebAssert::statusMessageNotExistsAfterWait in core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php - Asserts that a status message does not exist after wait.
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ JSWebAssert.php, line 145
Class
- JSWebAssert
- Defines a class with methods for asserting presence of elements during tests.
Namespace
Drupal\FunctionalJavascriptTestsCode
public function waitForElement($selector, $locator, $timeout = 10000) {
return $this->waitForHelper($timeout, function (Element $page) use ($selector, $locator) {
return $page->find($selector, $locator);
});
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.