You are here

protected function StockWebDriverTestBase::waitForAjaxToFinish in Commerce Stock 8

Waits for jQuery to become active and animations to complete.

File

tests/src/FunctionalJavascript/StockWebDriverTestBase.php, line 175

Class

StockWebDriverTestBase
Defines base class for commerce stock test cases.

Namespace

Drupal\Tests\commerce_stock\FunctionalJavascript

Code

protected function waitForAjaxToFinish() {
  $condition = "(0 === jQuery.active && 0 === jQuery(':animated').length)";
  $this
    ->assertJsCondition($condition, 10000);
}