protected function AwaitTrait::awaitElement in Lightning Core 8.3
Same name and namespace in other branches
- 8.5 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
- 8 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
- 8.2 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
- 8.4 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
Waits for an element to exist.
Parameters
string $selector: The element's CSS selector.
int $timeout: (optional) How long, in seconds, to wait before timing out.
Return value
\Behat\Mink\Element\NodeElement The awaited element.
File
- tests/
contexts/ AwaitTrait.inc, line 45
Class
- AwaitTrait
- @internal This is an internal part of Lightning Core's testing system and may be changed or removed at any time without warning. It should not be extended, instantiated, or used in any way by external code! If you need to use this functionality,…
Namespace
Acquia\LightningExtension\ContextCode
protected function awaitElement($selector, $timeout = 10) {
$js = 'document.querySelector("' . addslashes($selector) . '")';
$this
->awaitExpression($js, $timeout);
return $this
->assertSession()
->elementExists('css', $selector);
}