Skip to content

Instantly share code, notes, and snippets.

@lhridley
Last active August 29, 2015 14:10
Show Gist options
  • Save lhridley/ad4318d8ad900cc054df to your computer and use it in GitHub Desktop.
Save lhridley/ad4318d8ad900cc054df to your computer and use it in GitHub Desktop.
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));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment