protected function WebTestBase::clickLink in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::clickLink()
Follows a link by complete name.
Will click the first link found with this link text by default, or a later one if an index is given. Match is case sensitive with normalized space. The label is translated label.
If the link is discovered and clicked, the test passes. Fail otherwise.
Parameters
string|\Drupal\Component\Render\MarkupInterface $label: Text between the anchor tags.
int $index: Link position counting from zero.
Return value
string|bool Page contents on success, or FALSE on failure.
115 calls to WebTestBase::clickLink()
- AggregatorAdminTest::testSettingsPage in core/
modules/ aggregator/ src/ Tests/ AggregatorAdminTest.php - Tests the settings form to ensure the correct default values are used.
- AggregatorTestBase::updateFeedItems in core/
modules/ aggregator/ src/ Tests/ AggregatorTestBase.php - Updates the feed items.
- AnalyzeTest::testAnalyzeBasic in core/
modules/ views_ui/ src/ Tests/ AnalyzeTest.php - Tests that analyze works in general.
- BlockContentCreationTest::testBlockContentCreationMultipleViewModes in core/
modules/ block_content/ src/ Tests/ BlockContentCreationTest.php - Creates a "Basic page" block with multiple view modes.
- BlockContentListTest::testListing in core/
modules/ block_content/ src/ Tests/ BlockContentListTest.php - Tests the custom block listing page.
File
- core/
modules/ simpletest/ src/ WebTestBase.php, line 2439 - Contains \Drupal\simpletest\WebTestBase.
Class
- WebTestBase
- Test case for typical Drupal tests.
Namespace
Drupal\simpletestCode
protected function clickLink($label, $index = 0) {
return $this
->clickLinkHelper($label, $index, '//a[normalize-space()=:label]');
}