You are here

public function FeatureContext::assertRegionElementClick in Acquia Lift Connector 7.2

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

@When I click :selector element in the :region region

Throws

\Exception If region or element within it cannot be found.

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

public function assertRegionElementClick($selector, $region) {
  $element = $this
    ->findElementInRegion($selector, $region);
  if (empty($element)) {
    throw new \Exception(sprintf('The element "%s" was not found in the region "%s" on the page %s', $selector, $region, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  $element
    ->click();
}