You are here

protected function TableDragTest::waitUntilDraggingCompleted in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php \Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest::waitUntilDraggingCompleted()
  2. 9 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 654

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()));
  }
}