protected function AwaitTrait::awaitElement in Lightning Core 8
Same name and namespace in other branches
- 8.5 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
- 8.2 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitElement()
- 8.3 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 38
Class
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);
}