30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-06-03 06:50:49 +00:00

Let this file looks good :)

This commit is contained in:
zero-24 2015-05-30 22:11:54 +02:00
parent 8b0c36d93e
commit 42ec255422

View File

@ -7,22 +7,29 @@
*
* @see http://robo.li/
*/
require_once 'vendor/autoload.php';
require_once 'vendor/autoload.php';
class RoboFile extends \Robo\Tasks
{
// load tasks from composer, see composer.json
// Load tasks from composer, see composer.json
use \joomla_projects\robo\loadTasks;
private $extension = '';
public function setExecExtension(){
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
/**
* Set the Executeextension
*
* @return void
*/
public function setExecExtension()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$this->extension = '.exe';
}
}
/**
* Executes Selenium System Tests in your machine
*
@ -32,23 +39,29 @@ class RoboFile extends \Robo\Tasks
*/
public function testAcceptance($seleniumPath = null)
{
$this->setExecExtension();
// Get Joomla Clean Testing sites
if (is_dir('tests/joomla-cms3')) {
if (is_dir('tests/joomla-cms3'))
{
$this->taskDeleteDir('tests/joomla-cms3')->run();
}
$this->_exec('git'.$this->extension.' clone -b staging --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/joomla-cms3');
$this->_exec('git' . $this->extension . ' clone -b staging --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/joomla-cms3');
$this->say('Joomla CMS site created at tests/joomla-cms3');
if (!$seleniumPath) {
if (!file_exists('selenium-server-standalone.jar')) {
if (!$seleniumPath)
{
if (!file_exists('selenium-server-standalone.jar'))
{
$this->say('Downloading Selenium Server, this may take a while.');
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$this->_exec('curl.exe -sS http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar > selenium-server-standalone.jar');
}else{
}
else
{
$this->taskExec('wget')
->arg('http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar')
->arg('-O selenium-server-standalone.jar')
@ -56,32 +69,41 @@ class RoboFile extends \Robo\Tasks
->run();
}
}
$seleniumPath = 'selenium-server-standalone.jar';
}
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
{
$seleniumPath = "java -jar $seleniumPath >> selenium.log 2>&1 &";
}else{
}
else
{
$seleniumPath = "START java.exe -jar .\\" . $seleniumPath;
}
// Make sure we have Composer
if (!file_exists('./composer.phar')) {
if (!file_exists('./composer.phar'))
{
$this->_exec('curl'.$this->extension.' -sS https://getcomposer.org/installer | php');
}
$this->taskComposerUpdate()->run();
// Running Selenium server
$this->_exec($seleniumPath);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
sleep(10);
}else{
}
else
{
$this->taskWaitForSeleniumStandaloneServer()
->run()
->stopOnFail();
}
// Loading Symfony Command and running with passed argument
$this->_exec('php'.$this->extension.' vendor/bin/codecept build');