function BrowserTestBaseTest::testClickLink

Tests clickLink() functionality.

File

core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php, line 178

Class

BrowserTestBaseTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

public function testClickLink() {
  $this->drupalGet('test-page');
  $this->clickLink('Visually identical test links');
  $this->assertStringContainsString('user/login', $this->getSession()
    ->getCurrentUrl());
  $this->drupalGet('test-page');
  $this->clickLink('Visually identical test links', 0);
  $this->assertStringContainsString('user/login', $this->getSession()
    ->getCurrentUrl());
  $this->drupalGet('test-page');
  $this->clickLink('Visually identical test links', 1);
  $this->assertStringContainsString('user/register', $this->getSession()
    ->getCurrentUrl());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.