You are here

public function TestSubContext::getRegion in Panopoly 7

Same name and namespace in other branches
  1. 8.2 modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc \TestSubContext::getRegion()

Get a region by name.

Parameters

string $region: The name of the region from the behat.yml file.

Return value

Behat\Mink\Element\Element An element representing the region.

6 calls to TestSubContext::getRegion()
TestSubContext::assertAltRegion in modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc
@Then /^I should see the image alt "(?P<text>(?:[^"]|\\")*)" in the "(?P<region>[^"]*)" region$/
TestSubContext::assertNotRegionElementTextAttribute in modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc
@Then I should not see :text in the :tag element with the :attribute attribute set to :value in the :region region
TestSubContext::assertNotRegionMatchesText in modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc
Asserts that the region does not contain text matching specified pattern.
TestSubContext::assertRegionElementText in modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc
@Then I should see :text in the :tag element in the :region region
TestSubContext::assertRegionMatchesText in modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc
Asserts that the region contains text matching specified pattern.

... See full list

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc, line 87
Provide Behat step-definitions for generic Panopoly tests.

Class

TestSubContext

Code

public function getRegion($region) {
  $session = $this
    ->getSession();
  $regionObj = $session
    ->getPage()
    ->find('region', $region);
  if (!$regionObj) {
    throw new \Exception(sprintf('No region "%s" found on the page %s.', $region, $session
      ->getCurrentUrl()));
  }
  return $regionObj;
}