Added iShouldSeeAButton assertion

This commit is contained in:
Ingo Schommer 2013-04-09 09:39:06 +02:00
parent 7d6edccb0a
commit ba7dfcfd54

View File

@ -98,4 +98,14 @@ class CmsFormsContext extends BehatContext
$this->getMainContext()->assertElementContains('#' . $inputField->getAttribute('id'), $value); $this->getMainContext()->assertElementContains('#' . $inputField->getAttribute('id'), $value);
} }
/**
* @Given /^I should see a "([^"]*)" button$/
*/
public function iShouldSeeAButton($text)
{
$page = $this->getSession()->getPage();
$element = $page->find('named', array('link_or_button', "'$text'"));
assertNotNull($element, sprintf('%s button not found', $text));
}
} }