public function TestSubContext::getRegion in Panopoly 8.2
Same name and namespace in other branches
- 7 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 - Asserts the image alt text in a region.
- TestSubContext::assertNotRegionElementTextAttribute in modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test.behat.inc - Tests for element content and attributes in 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 - Tests for element content in region.
- TestSubContext::assertRegionMatchesText in modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test.behat.inc - Asserts that the region contains text matching specified pattern.
File
- modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test.behat.inc, line 95 - Provide Behat step-definitions for generic Panopoly tests.
Class
- TestSubContext
- Behat sub-context for Panopoly.
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;
}