From 9d73942bbd2ccb3ddc14db8eb5f0ba4378e0b6b0 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 2 Oct 2013 17:10:13 +0200 Subject: [PATCH] BasicContext->stepPageCantBeFound --- .../BehatExtension/Context/BasicContext.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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?)$/ */