You are here

public function FeatureContext::assertRegionVariationHasLinkDisabled in Acquia Lift Connector 7.2

@Then :variation_set set :variation variation :link link is disabled

Throws

\Exception If the menu or link cannot be found.

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

public function assertRegionVariationHasLinkDisabled($variation_set, $variation, $link) {
  $css = $this
    ->getVariationLinkCss($variation_set, $variation, $link);

  // Now find the link and return it.
  $element = $this
    ->findElementInRegion($css, 'lift_tray');
  if (empty($element)) {
    throw new \Exception(sprintf('Cannot load the link "%s" for set "%s" and variation "%s" on page %s using selector %s.', $link, $variation_set, $variation, $this
      ->getSession()
      ->getCurrentUrl(), $css));
  }
  if (!$element
    ->hasClass('acquia-lift-disabled')) {
    throw new \Exception(sprintf('The link "%s" for set "%s" and variation "%s" on page %s using selector %s is not disabled.', $link, $variation_set, $variation, $this
      ->getSession()
      ->getCurrentUrl(), $css));
  }
  return $element;
}