From b70255da84ea3d433ea9db8a52e8682b129fc0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 29 Nov 2013 10:47:25 +0100 Subject: [PATCH] Should work better. --- test/Sauce.php | 45 +++++++++++++++++++------------------ test/config_local.php.sauce | 2 +- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/test/Sauce.php b/test/Sauce.php index ef7693d..c07ec5d 100644 --- a/test/Sauce.php +++ b/test/Sauce.php @@ -2,7 +2,7 @@ require_once 'vendor/autoload.php'; -class WebDriverDemo extends Sauce\Sausage\WebDriverTestCase +class Cops extends Sauce\Sausage\WebDriverTestCase { public static $browsers = array( // run FF15 on Windows 8 on Sauce @@ -74,17 +74,21 @@ class WebDriverDemo extends Sauce\Sausage\WebDriverTestCase public function setUp() { - $caps = $this->getDesiredCapabilities(); - $caps['build'] = getenv ("TRAVIS_JOB_NUMBER"); - //$caps['tunnel_id'] = getenv ("TRAVIS_JOB_NUMBER"); - $caps['name'] = "COPS "; - $this->setDesiredCapabilities($caps); - parent::setUp (); + if (isset ($_SERVER["TRAVIS_JOB_NUMBER"])) { + $caps = $this->getDesiredCapabilities(); + $caps['build'] = getenv ("TRAVIS_JOB_NUMBER"); + $this->setDesiredCapabilities($caps); + } + parent::setUp (); } public function setUpPage() { - $this->url('http://127.0.0.1:8888/index.php'); + if (isset ($_SERVER["TRAVIS_JOB_NUMBER"])) { + $this->url('http://127.0.0.1:8888/index.php'); + } else { + $this->url('http://cops-demo.slucas.fr/index.php'); + } } public function string_to_ascii($string) @@ -108,27 +112,24 @@ class WebDriverDemo extends Sauce\Sausage\WebDriverTestCase }; - $this->spinAssert("Home Title", $title_test, [ "COPS" ]); + $this->spinAssert("Home Title", $title_test, [ "COPS DEMO" ]); $author = $this->byXPath ('//h2[contains(text(), "Authors")]'); $author->click (); $this->spinAssert("Author Title", $title_test, [ "AUTHORS" ]); + } + + public function testCog() + { + $cog = $this->byId ("searchImage"); - // $cog = $this->byId ("searchImage"); - // try { - // $search = $this->byName ("query"); - // $this->fail (); - // } - // catch (Exception $e) { - // } + $search = $this->byName ("query"); + $this->assertFalse ($search->displayed ()); - // $search = $this->byName ("query"); - // $this->assertFalse ($search->displayed ()); + $cog->click (); - // $cog->click (); - - // $search = $this->byName ("query"); - // $this->assertTrue ($search->displayed ()); + $search = $this->byName ("query"); + $this->assertTrue ($search->displayed ()); } } diff --git a/test/config_local.php.sauce b/test/config_local.php.sauce index 0818b69..7e3c310 100644 --- a/test/config_local.php.sauce +++ b/test/config_local.php.sauce @@ -12,6 +12,6 @@ /* * Catalog's title */ - $config['cops_title_default'] = "COPS"; + $config['cops_title_default'] = "COPS DEMO"; // $config['cops_server_side_render'] = ".";