You are here

protected function AwaitTrait::awaitExpression in Lightning Core 8.2

Same name and namespace in other branches
  1. 8.5 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitExpression()
  2. 8 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitExpression()
  3. 8.3 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitExpression()
  4. 8.4 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitExpression()

Waits for a JavaScript condition to become true.

Parameters

string $expression: The JavaScript expression to wait for.

int $timeout: (optional) How long, in seconds, to wait before timing out.

1 call to AwaitTrait::awaitExpression()
AwaitTrait::awaitElement in tests/contexts/AwaitTrait.inc
Waits for an element to exist.

File

tests/contexts/AwaitTrait.inc, line 18

Class

AwaitTrait

Namespace

Acquia\LightningExtension\Context

Code

protected function awaitExpression($expression, $timeout = 10) {
  try {
    $this
      ->getSession()
      ->wait($timeout * 1000, $expression);
  } catch (UnsupportedDriverActionException $e) {
    sleep($timeout);
  }
}