From b885a0d196382b9ef64ce710be81869334621632 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 10 Jan 2016 20:25:42 +0100 Subject: test sausage --- .travis.yml | 27 ++++++-- build.xml | 2 +- composer.json | 3 +- tests/test_tools/PradoGenericSelenium2Test.php | 93 ++++++++++---------------- 4 files changed, 62 insertions(+), 63 deletions(-) diff --git a/.travis.yml b/.travis.yml index 246ab67f..1826b236 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,36 @@ language: php +sudo: false + php: - 5.5 - 5.6 - - 7.0 + - 7 + - hhvm + +matrix: + allow_failures: + - php: hhvm + fast_finish: true + +addons: + sauce_connect: true + +cache: + directories: + - $HOME/.composer/cache + +before_install: + - composer selfupdate + +install: + - composer install before_script: - - composer self-update - - composer install --prefer-source - export PATH=./bin/:$PATH script: - phing coverage after_script: - - php ./bin/coveralls -v + - php ./bin/coveralls -v \ No newline at end of file diff --git a/build.xml b/build.xml index 708b18cd..793c983b 100644 --- a/build.xml +++ b/build.xml @@ -135,8 +135,8 @@ For all PRADO developers: - test : run unit tests (results are under /build/test-reports) + - functionaltest : run functional tests (requires Selenium Server) - coverage : run unit tests collecting coverage informations - - functionaltest : run funcitonal tests (requires Selenium Server) - lint : run lint on framework - lint-demos : run lint on demos diff --git a/composer.json b/composer.json index 470c1ac0..c61935ab 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,8 @@ "phpunit/phpunit-story": "*", "phing/phing" : "2.*", "apigen/apigen": "4.*", - "satooshi/php-coveralls": "dev-master" + "satooshi/php-coveralls": "dev-master", + "sauce/sausage": ">=0.15.2" }, "provide" : { "pradosoft/prado" : "3.3.0" diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php index 33ab21e1..d181b744 100755 --- a/tests/test_tools/PradoGenericSelenium2Test.php +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -1,60 +1,43 @@ 'Firefox on OSX', - 'browserName' => '*firefox', - 'host' => '127.0.0.1', - 'port' => 4444, - ), -*/ - array( - 'name' => 'Chrome on OSX', - 'browserName' => 'chrome', - 'sessionStrategy' => 'shared', - 'host' => '127.0.0.1', - 'port' => 4444, - ), -/* - array( - 'name' => 'Safari on OSX', - 'browserName' => 'safari', - 'sessionStrategy' => 'shared', - 'host' => '127.0.0.1', - 'port' => 4444, - ), -*/ -/* - array( - 'name' => 'Firefox on WindowsXP', - 'browserName' => '*firefox', - 'host' => '127.0.0.1', - 'port' => 4445, - ), - array( - 'name' => 'Internet Explorer 8 on WindowsXP', - 'browserName' => '*iehta', - 'host' => '127.0.0.1', - 'port' => 4445, - ) -*/ - ); - - static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/'; - - static $timeout=5; //seconds - - protected function setUp() - { - self::shareSession(true); - $this->setBrowserUrl(static::$baseurl); - $this->setSeleniumServerRequestsTimeout(static::$timeout); - } + protected $start_url = 'http://saucelabs.com/test/guinea-pig'; + public static $browsers = array( + // run FF15 on Windows 8 on Sauce + array( + 'browserName' => 'firefox', + 'desiredCapabilities' => array( + 'version' => '15', + 'platform' => 'Windows 2012', + ) + ), + // run Chrome on Linux on Sauce + array( + 'browserName' => 'chrome', + 'desiredCapabilities' => array( + 'platform' => 'Linux' + ) + ), + // run Mobile Safari on iOS + //array( + //'browserName' => '', + //'desiredCapabilities' => array( + //'app' => 'safari', + //'device' => 'iPhone Simulator', + //'version' => '6.1', + //'platform' => 'Mac 10.8', + //) + //)//, + // run Chrome locally + //array( + //'browserName' => 'chrome', + //'local' => true, + //'sessionStrategy' => 'shared' + //) + ); protected function assertAttribute($idattr, $txt) { @@ -273,8 +256,4 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase } $this->assertFalse($found, "Failed asserting that page source does not contain $text"); } - - - - } -- cgit v1.2.3