function UpdateTestBase::findUpdateElementByLabel
Same name in other branches
- 9 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()
- 8.9.x core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()
- 10 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:".
int $index: (optional) The index of the element.
Return value
\Behat\Mink\Element\NodeElement The update element.
2 calls to UpdateTestBase::findUpdateElementByLabel()
- UpdateContribTest::assertCoreCompatibilityMessage in core/
modules/ update/ tests/ src/ Functional/ UpdateContribTest.php - Asserts that a core compatibility message is correct for an update.
- UpdateTestBase::assertVersionUpdateLinks in core/
modules/ update/ tests/ src/ Functional/ UpdateTestBase.php - Asserts that an update version has the correct links.
File
-
core/
modules/ update/ tests/ src/ Functional/ UpdateTestBase.php, line 297
Class
- UpdateTestBase
- Defines some shared functions used by all update tests.
Namespace
Drupal\Tests\update\FunctionalCode
protected function findUpdateElementByLabel($label, int $index = 0) {
$update_elements = $this->getSession()
->getPage()
->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"{$label}\")");
$this->assertGreaterThanOrEqual($index, count($update_elements));
return $update_elements[$index];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.