From f1c7b7745ad75613d1b2f83b39110c21aabc5cc5 Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Fri, 1 Sep 2017 01:11:19 +0200 Subject: [PATCH] update tests --- .travis.yml | 18 +++++++------ RoboFile.php | 27 +++++++------------ tests/acceptance.suite.dist.yml | 2 +- .../acceptance/install/InstallJoomlaCest.php | 21 --------------- .../install/InstallWeblinksCest.php | 6 ++++- 5 files changed, 25 insertions(+), 49 deletions(-) delete mode 100644 tests/acceptance/install/InstallJoomlaCest.php diff --git a/.travis.yml b/.travis.yml index 26a692d..606480b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,14 @@ -sudo: true +# Forces new Travis-CI Infrastructure +sudo: false + language: php -dist: trusty + +addons: + chrome: stable + apt: + packages: + - xvfb + - fluxbox env: global: @@ -14,8 +22,6 @@ matrix: env: RUN_PHPCS="yes" - php: 7.0 sudo: true - addons: - firefox: "47.0.1" - php: 7.1 - php: hhvm sudo: true @@ -57,10 +63,6 @@ before_script: - sudo apt-get install fluxbox -y --force-yes - fluxbox & - sleep 3 # give fluxbox some time to start -# Install Chrome -- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -- sudo dpkg -i google-chrome*.deb -- export CHROME_BIN=/usr/bin/google-chrome # Composer - composer install diff --git a/RoboFile.php b/RoboFile.php index 61c36e7..35d4b85 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -33,6 +33,7 @@ class RoboFile extends \Robo\Tasks { // Load tasks from composer, see composer.json use \Joomla\Jorobo\Tasks\loadTasks; + use \Joomla\Testing\Robo\Tasks\LoadTasks; /** * File extension for executables @@ -298,16 +299,13 @@ class RoboFile extends \Robo\Tasks */ public function runSelenium() { - if (!$this->isWindows()) - { - $this->_exec("vendor/bin/selenium-server-standalone " . $this->getWebDriver() . ' >> selenium.log 2>&1 &'); - } - else - { - $this->_exec("START java.exe -jar " . $this->getWebDriver() . ' vendor\joomla-projects\selenium-server-standalone\bin\selenium-server-standalone.jar '); - } - - sleep(3); + $this->taskSeleniumStandaloneServer() + ->setBinary('vendor/bin/selenium-server-standalone') + ->setWebdriver($this->getWebDriver()) + ->runSelenium() + ->waitForSelenium() + ->run() + ->stopOnFail(); } /** @@ -329,14 +327,7 @@ class RoboFile extends \Robo\Tasks $this->getComposer(); - if ($this->isWindows()) - { - $this->taskComposerInstall('composer')->run(); - } - else - { - $this->taskComposerInstall('composer.phar')->run(); - } + $this->taskComposerInstall('composer')->run(); $this->runSelenium(); diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml index 57d1837..bc29f4d 100644 --- a/tests/acceptance.suite.dist.yml +++ b/tests/acceptance.suite.dist.yml @@ -13,7 +13,7 @@ modules: config: JoomlaBrowser: url: 'http://localhost/tests/joomla' # the url that points to the joomla installation at /tests/system/joomla-cms - browser: 'firefox' + browser: 'chrome' window_size: 1280x1024 username: 'admin' # UserName for the Administrator password: 'admin' # Password for the Administrator diff --git a/tests/acceptance/install/InstallJoomlaCest.php b/tests/acceptance/install/InstallJoomlaCest.php deleted file mode 100644 index 71938db..0000000 --- a/tests/acceptance/install/InstallJoomlaCest.php +++ /dev/null @@ -1,21 +0,0 @@ -am('Administrator'); - $I->installJoomlaRemovingInstallationFolder(); - $I->doAdministratorLogin(); - $I->disableStatistics(); - $I->setErrorReportingToDevelopment(); - } -} diff --git a/tests/acceptance/install/InstallWeblinksCest.php b/tests/acceptance/install/InstallWeblinksCest.php index 6d839cd..18a0715 100644 --- a/tests/acceptance/install/InstallWeblinksCest.php +++ b/tests/acceptance/install/InstallWeblinksCest.php @@ -12,7 +12,11 @@ class InstallWeblinksCest { public function installJoomla(\AcceptanceTester $I) { + $I->am('Administrator'); + $I->installJoomlaRemovingInstallationFolder(); $I->doAdministratorLogin(); + $I->disableStatistics(); + $I->setErrorReportingToDevelopment(); } /** @@ -21,7 +25,7 @@ class InstallWeblinksCest public function installWeblinks(\AcceptanceTester $I) { $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); - + $I->doAdministratorLogin(); // URL where the package file to install is located (mostly the same as joomla-cms) $I->installExtensionFromFileUpload('pkg-weblinks-current.zip'); $I->doAdministratorLogout();