diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php index ca7b7baf9..a738e8652 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -98,4 +98,14 @@ class CmsFormsContext extends BehatContext $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)); + } }