From 42eb4c2a703f488d31ef02c1b1ca85619a95aff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 12 Dec 2013 21:53:45 +0100 Subject: [PATCH] Organize a little the test to avoid timing bugs. --- test/Sauce.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/Sauce.php b/test/Sauce.php index 7c52811..984f335 100644 --- a/test/Sauce.php +++ b/test/Sauce.php @@ -137,23 +137,25 @@ class Cops extends Sauce\Sausage\WebDriverTestCase $search = $this->byName ("query"); $this->assertTrue ($search->displayed ()); } - + public function testFilter() { - // Click on the wrench to enable tag filtering - $this->byClassName ("icon-wrench")->click (); - - $this->byId ("html_tag_filter")->click (); - - // Go back to home screen - $this->byClassName ("icon-home")->click (); - $driver = $this; $title_test = function($value) use ($driver) { $text = $driver->byXPath('//h1')->text (); return $text == $value; }; + // Click on the wrench to enable tag filtering + $this->byClassName ("icon-wrench")->click (); + + $this->byId ("html_tag_filter")->click (); + + // Go back to home screen + $this->byClassName ("icon-home")->click (); + + $this->spinAssert("Home Title", $title_test, [ "COPS DEMO" ]); + // Go on the recent page $author = $this->byXPath ('//h2[contains(text(), "Recent")]'); $author->click ();