protected function WebTestBase::clickLinkPartialName in Drupal 8
Follows a link by partial name.
If the link is discovered and clicked, the test passes. Fail otherwise.
Parameters
string|\Drupal\Component\Render\MarkupInterface $label: Text between the anchor tags, uses starts-with().
int $index: Link position counting from zero.
Return value
string|bool Page contents on success, or FALSE on failure.
See also
::clickLink()
File
- core/
modules/ simpletest/ src/ WebTestBase.php, line 1714
Class
- WebTestBase
- Test case for typical Drupal tests.
Namespace
Drupal\simpletestCode
protected function clickLinkPartialName($label, $index = 0) {
return $this
->clickLinkHelper($label, $index, '//a[starts-with(normalize-space(), :label)]');
}