You are here

protected function WebTestBase::clickLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

... See full list

File

core/modules/simpletest/src/WebTestBase.php, line 2439
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function clickLink($label, $index = 0) {
  return $this
    ->clickLinkHelper($label, $index, '//a[normalize-space()=:label]');
}