protected function AwaitTrait::awaitAjax in Lightning Core 8.2
Same name and namespace in other branches
- 8.5 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitAjax()
- 8 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitAjax()
- 8.3 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitAjax()
- 8.4 tests/contexts/AwaitTrait.inc \Acquia\LightningExtension\Context\AwaitTrait::awaitAjax()
Waits for AJAX to finish.
If the Mink context is unavailable, or the current driver does not support waiting for a JavaScript condition, waits $timeout seconds and returns.
Parameters
int $timeout: (optional) How many seconds to wait.
1 call to AwaitTrait::awaitAjax()
- ViewsContext::applyExposedFilters in tests/
contexts/ ViewsContext.behat.inc - Submits exposed Views filters.
File
- tests/
contexts/ AwaitTrait.inc, line 54
Class
Namespace
Acquia\LightningExtension\ContextCode
protected function awaitAjax($timeout = 10) {
/** @var MinkContext $context */
$context = $this
->getContext(MinkContext::class);
if ($context) {
try {
return $context
->iWaitForAjaxToFinish();
} catch (UnsupportedDriverActionException $e) {
// Fall through to sleep().
}
}
sleep($timeout);
}