diff --git a/src/SilverStripe/BehatExtension/Context/BasicContext.php b/src/SilverStripe/BehatExtension/Context/BasicContext.php index 33555e8..fe22501 100644 --- a/src/SilverStripe/BehatExtension/Context/BasicContext.php +++ b/src/SilverStripe/BehatExtension/Context/BasicContext.php @@ -253,6 +253,20 @@ JS; } } + /** + * @Given /^the page can't be found/ + */ + public function stepPageCantBeFound() + { + $page = $this->getSession()->getPage(); + assertTrue( + // Content from ErrorPage default record + $page->hasContent('Page not found') + // Generic ModelAsController message + || $page->hasContent('The requested page could not be found') + ); + } + /** * @Given /^I wait (?:for )?([\d\.]+) second(?:s?)$/ */