function TableDragTest::findRowById

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

Finds a row in the test table by the row ID.

Parameters

string $id: The ID of the row.

Return value

\Behat\Mink\Element\NodeElement The row element.

3 calls to TableDragTest::findRowById()
TableDragTest::testKeyboardAccessibility in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests accessibility through keyboard of the tabledrag functionality.
TableDragTest::testRootLeafDraggableRowsWithKeyboard in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests the root and leaf behaviors for rows.
TableDragTest::testTableDragChangedWarning in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests the warning that appears upon making changes to a tabledrag table.

File

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

Class

TableDragTest
Tests draggable table.

Namespace

Drupal\FunctionalJavascriptTests\TableDrag

Code

protected function findRowById($id) {
    $xpath = "//table[@id='tabledrag-test-table']/tbody/tr[.//input[@name='table[{$id}][id]']]";
    $row = $this->getSession()
        ->getPage()
        ->find('xpath', $xpath);
    $this->assertNotEmpty($row);
    return $row;
}

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