Skip to content

Instantly share code, notes, and snippets.

View lhridley's full-sized avatar

Lisa Ridley lhridley

  • Chattanooga, Tennessee
View GitHub Profile
@lhridley
lhridley / FeatureContext -- see a form within a region
Last active August 29, 2015 14:10
Drupal Behat Custom Steps
/**
* @Then /^I should see the "([^"]*)" form in the "([^"]*)" region$/
*/
public function iShouldSeeTheFormInTheRegion($form_id, $region) {
$regionObj = $this->getRegion($region);
$selectElement = $regionObj->find('xpath','//form[@id = "'. $form_id .'" or @name = "' . $form_id . '"]');
if (empty($selectElement)) {
throw new \Exception(sprintf("No form '%s' is present in the '%s' region", $form_id, $region));
}