You are here

protected function MultiStepSelectionDisplayTest::waitSelectionDisplayAjaxCommands in Entity Browser 8.2

Same name and namespace in other branches
  1. 8 tests/src/FunctionalJavascript/MultiStepSelectionDisplayTest.php \Drupal\Tests\entity_browser\FunctionalJavascript\MultiStepSelectionDisplayTest::waitSelectionDisplayAjaxCommands()

Wait for Ajax Commands to finish.

Since commands are executed in batches, it can occur that one command is still running and new one will be collected for next batch. To ensure all of commands are executed, we have to add additional 200ms wait, before next batch is triggered.

It's related to: Drupal.entityBrowserCommandQueue.executeCommands

1 call to MultiStepSelectionDisplayTest::waitSelectionDisplayAjaxCommands()
MultiStepSelectionDisplayTest::testAjaxCommands in tests/src/FunctionalJavascript/MultiStepSelectionDisplayTest.php
Check that selection state in entity browser Inline Entity Form.

File

tests/src/FunctionalJavascript/MultiStepSelectionDisplayTest.php, line 57

Class

MultiStepSelectionDisplayTest
Test for multi_step_display selection display.

Namespace

Drupal\Tests\entity_browser\FunctionalJavascript

Code

protected function waitSelectionDisplayAjaxCommands() {
  $this
    ->waitForAjaxToFinish();
  $this
    ->getSession()
    ->wait(200);
  $this
    ->waitForAjaxToFinish();
}