You are here

protected function TableDragTest::findRowById in Drupal 8

Same name and namespace in other branches
  1. 9 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;
}