You are here

public function FeatureContext::assertElementWithIDHasClass in Acquia Lift Connector 7

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

@Then I should see element with :id id in :region region with the :class class

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

public function assertElementWithIDHasClass($id, $region, $class) {
  $element = $this
    ->findElementInRegion($id, $region);
  if (empty($element)) {
    throw new \Exception(sprintf('The element with %s was not found in region %s on the page %s', $id, $region, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  if (!$element
    ->hasClass($class)) {
    throw new \Exception(sprintf('The element with id %s in region %s on page %s does not have class %s', $id, $region, $this
      ->getSession()
      ->getCurrentUrl(), $class));
  }
}