You are here

protected function UpdateTestBase::findUpdateElementByLabel in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()
  2. 9 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()

Finds an update page element by label.

Parameters

string $label: The label for the update, for example "Recommended version:" or "Latest version:".

Return value

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

File

core/modules/update/tests/src/Functional/UpdateTestBase.php, line 278

Class

UpdateTestBase
Defines some shared functions used by all update tests.

Namespace

Drupal\Tests\update\Functional

Code

protected function findUpdateElementByLabel($label) {
  $update_elements = $this
    ->getSession()
    ->getPage()
    ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"{$label}\")");
  $this
    ->assertCount(1, $update_elements);
  return $update_elements[0];
}