From 2f6676760f4872e6db340582a1cca53915abf301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 29 Nov 2013 15:35:12 +0100 Subject: [PATCH] Try to correctly set the home page. --- test/Sauce.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/Sauce.php b/test/Sauce.php index c07ec5d..db778eb 100644 --- a/test/Sauce.php +++ b/test/Sauce.php @@ -89,6 +89,14 @@ class Cops extends Sauce\Sausage\WebDriverTestCase } else { $this->url('http://cops-demo.slucas.fr/index.php'); } + + $driver = $this; + $title_test = function($value) use ($driver) { + $text = $driver->byXPath('//h1')->text (); + return $text == $value; + }; + + $this->spinAssert("Home Title", $title_test, [ "COPS DEMO" ]); } public function string_to_ascii($string) @@ -110,10 +118,7 @@ class Cops extends Sauce\Sausage\WebDriverTestCase $text = $driver->byXPath('//h1')->text (); return $text == $value; }; - - $this->spinAssert("Home Title", $title_test, [ "COPS DEMO" ]); - $author = $this->byXPath ('//h2[contains(text(), "Authors")]'); $author->click ();