You are here

public function FeatureContext::assertLinkVisibleRegion in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 behat-tests/features/bootstrap/FeatureContext.php \FeatureContext::assertLinkVisibleRegion()

@Then I should visibly see the link :link in the :region( region)

Throws

\Exception If region or link within it cannot be found or is hidden.

File

behat-tests/features/bootstrap/FeatureContext.php, line 525

Class

FeatureContext
Defines application features from the specific context.

Code

public function assertLinkVisibleRegion($link, $region) {
  $results = $this
    ->findLinksInRegion($link, $region);
  if (empty($results)) {
    throw new \Exception(sprintf('No link to "%s" in the "%s" region on the page %s', $link, $region, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  foreach ($results as $result) {
    if ($result
      ->isVisible()) {
      return;
    }
  }
  throw new \Exception(sprintf('No link to "%s" is visible in the "%s" region on the page %s', $link, $region, $this
    ->getSession()
    ->getCurrentUrl()));
}