You are here

public function FeatureContext::assertNotLinkVisibleRegion in Acquia Lift Connector 7.2

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

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

Throws

\Exception If link is found in region and is visible.

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

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