Organize a little the test to avoid timing bugs.
This commit is contained in:
parent
0130e33c82
commit
42eb4c2a70
|
@ -137,23 +137,25 @@ class Cops extends Sauce\Sausage\WebDriverTestCase
|
||||||
$search = $this->byName ("query");
|
$search = $this->byName ("query");
|
||||||
$this->assertTrue ($search->displayed ());
|
$this->assertTrue ($search->displayed ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFilter()
|
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;
|
$driver = $this;
|
||||||
$title_test = function($value) use ($driver) {
|
$title_test = function($value) use ($driver) {
|
||||||
$text = $driver->byXPath('//h1')->text ();
|
$text = $driver->byXPath('//h1')->text ();
|
||||||
return $text == $value;
|
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
|
// Go on the recent page
|
||||||
$author = $this->byXPath ('//h2[contains(text(), "Recent")]');
|
$author = $this->byXPath ('//h2[contains(text(), "Recent")]');
|
||||||
$author->click ();
|
$author->click ();
|
||||||
|
|
Loading…
Reference in a new issue