You are here

protected function TableDragTest::findRowById in Drupal 10

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

string $table_id: The ID of the parent table. Defaults to 'tabledrag-test-table'.

Return value

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

6 calls to TableDragTest::findRowById()
ClaroTableDragTest::testNoDuplicates in core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php
Ensures that there are no duplicate tabledrag handles.
TableDragTest::assertKeyboardAccessibility in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Asserts accessibility through keyboard of a test draggable table.
TableDragTest::testDragAndDrop in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests draggable table drag'n'drop.
TableDragTest::testNestedDraggableTables in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests nested draggable tables through keyboard.
TableDragTest::testRootLeafDraggableRowsWithKeyboard in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests the root and leaf behaviors for rows.

... See full list

File

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

Class

TableDragTest
Tests draggable table.

Namespace

Drupal\FunctionalJavascriptTests\TableDrag

Code

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