function TableDragTest::waitUntilDraggingCompleted

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php \Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest::waitUntilDraggingCompleted()
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php \Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest::waitUntilDraggingCompleted()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php \Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest::waitUntilDraggingCompleted()

Waits until the dragging operations are finished on a row handle.

Parameters

\Behat\Mink\Element\NodeElement $handle: The draggable row handle element.

Throws

\Exception Thrown when the dragging operations are not completed on time.

1 call to TableDragTest::waitUntilDraggingCompleted()
TableDragTest::moveRowWithKeyboard in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Moves a row through the keyboard.

File

core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php, line 463

Class

TableDragTest
Tests draggable table.

Namespace

Drupal\FunctionalJavascriptTests\TableDrag

Code

protected function waitUntilDraggingCompleted(NodeElement $handle) {
    $class_removed = $this->getSession()
        ->getPage()
        ->waitFor(1, function () use ($handle) {
        return !$handle->hasClass($this::DRAGGING_CSS_CLASS);
    });
    if (!$class_removed) {
        throw new \Exception(sprintf('Dragging operations did not complete on time on handle %s', $handle->getXpath()));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.