private function FeatureContext::getRegions in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 behat-tests/features/bootstrap/FeatureContext.php \FeatureContext::getRegions()
Helper function to retrieve a region defined in the configuration file that may consist of multiple elements matching the selector.
Parameters
$region: The region identifier to load.
Return value
\Behat\Mink\Element\NodeElement|null The region element node or null if not found.
Throws
\Exception If the region cannot be found on the current page.
1 call to FeatureContext::getRegions()
- FeatureContext::assertMenuCount in behat-tests/features/ bootstrap/ FeatureContext.php 
- @Then I should see :count for the :type count
File
- behat-tests/features/ bootstrap/ FeatureContext.php, line 735 
Class
- FeatureContext
- Defines application features from the specific context.
Code
private function getRegions($region) {
  $mink = $this
    ->getMink();
  $regions = $mink
    ->getSession()
    ->getPage()
    ->findAll('region', $region);
  if (empty($regions)) {
    throw new \Exception(sprintf('The region %s was not found on the page %s', $region, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  return $regions;
}