$this->
assertSession()->
elementsCount('xpath', '//div[@class="layout-content"]//table/thead/tr/th', 3
);
// Test the contents of each th cell.
$this->
assertSession()->
elementTextEquals('xpath', '//div[@class="layout-content"]//table/thead/tr/th[1]', 'Name'
);
$this->
assertSession()->
elementTextEquals('xpath', '//div[@class="layout-content"]//table/thead/tr/th[2]', 'Weight'
);
$this->
assertSession()->
elementTextEquals('xpath', '//div[@class="layout-content"]//table/thead/tr/th[3]', 'Operations'
);
// Look for test shortcuts in the table.
$weight =
count($shortcuts);
$edit =
[];
foreach ($shortcuts as $shortcut) { $title =
$shortcut->
getTitle();
// Confirm that a link to the shortcut is found within the table.
$this->
assertSession()->
linkExists($title);
// Look for a test shortcut weight select form element.
$this->
assertSession()->
fieldExists('shortcuts[links][' .
$shortcut->
id() . '][weight]'
);
// Change the weight of the shortcut.
$edit['shortcuts[links][' .
$shortcut->
id() . '][weight]'
] =
$weight;
$weight--;
}