You are here

protected function AwaitTrait::awaitExpression in Lightning Core 8.3

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.2 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 25

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\Context

Code

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