From 3dff408ec6ac1d360dbf66a5095a1bf78ec61f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 12 Apr 2014 10:51:26 +0200 Subject: [PATCH] Should help to reduce false positive. --- test/Sauce.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Sauce.php b/test/Sauce.php index 5ecae18..552fc6a 100644 --- a/test/Sauce.php +++ b/test/Sauce.php @@ -148,9 +148,15 @@ class Cops extends Sauce\Sausage\WebDriverTestCase return $text == $value; }; + $element_present = function ($using, $id) use ($driver) { + $elements = $driver->elements ($driver->using($using)->value($id)); + return count($elements) == 1; + }; + // Click on the wrench to enable tag filtering $this->byClassName ("icon-wrench")->click (); + $this->spinWait ("", $element_present, [ "id", "html_tag_filter"]); $this->byId ("html_tag_filter")->click (); // Go back to home screen