You are here

public function ViewsExposedGroupsTestBase::clickExposedFormOptionsLink in Views exposed groups 3.0.x

Follows the exposed form options link by name.

Views wraps some links in spans, which means that clickLink is not possible to use.

Parameters

string $label: Text between the anchor tags.

int $index: Link position counting from zero.

Return value

string Page contents on success.

1 call to ViewsExposedGroupsTestBase::clickExposedFormOptionsLink()
ViewsExposedGroupsInheritedPropertiesTest::testViewsUi in tests/src/Functional/ViewsExposedGroupsInheritedPropertiesTest.php
Asserts form sets values for inherited properties.

File

tests/src/Functional/ViewsExposedGroupsTestBase.php, line 129

Class

ViewsExposedGroupsTestBase
Base test class for views_exposed_groups module tests.

Namespace

Drupal\Tests\views_exposed_groups\Functional

Code

public function clickExposedFormOptionsLink($label = '', $index = 0) {
  $url_before = $this
    ->getUrl();
  $urls = $this
    ->xpath('//a/span[normalize-space(text())=:label]/..', [
    ':label' => 'Grouped form',
  ]);
  $this
    ->assertTrue(isset($urls[$index]), 'Found link with label ' . $label);
  $url_target = $this
    ->getAbsoluteUrl($urls[$index]['href']);
  return $this
    ->drupalGet($url_target);
}