mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-06-03 06:50:49 +00:00
windows robo support
This commit is contained in:
parent
3d6e027f5e
commit
36499e5533
15
README.md
15
README.md
|
@ -12,3 +12,18 @@ $ composer install
|
||||||
$ vendor/bin/robo
|
$ vendor/bin/robo
|
||||||
$ vendor/bin/robo test:acceptance
|
$ vendor/bin/robo test:acceptance
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
For Windows:
|
||||||
|
Create a symbolic link from your tests\joomla-cms3 to a subfolder of your web server. For example, I'm creating a link between the tests folder of my weblinks folder and the tests folder of my web server:
|
||||||
|
mklink /J C:\wamp\www\tests\joomla-cms3 C:\Users\Nicolas\Documents\GitHub\weblinks\tests\joomla-cms3
|
||||||
|
|
||||||
|
Go in the folder of weblinks, for example:
|
||||||
|
cd C:\Users\Nicolas\Documents\GitHub\weblinks
|
||||||
|
|
||||||
|
Then, run the command:
|
||||||
|
composer update
|
||||||
|
|
||||||
|
That will add all the dependencies for the testing of weblinks
|
||||||
|
You can then run the command:
|
||||||
|
vendor\bin\robo.bat test:acceptance
|
||||||
|
|
40
RoboFile.php
40
RoboFile.php
|
@ -15,7 +15,14 @@ class RoboFile extends \Robo\Tasks
|
||||||
|
|
||||||
// load tasks from composer, see composer.json
|
// load tasks from composer, see composer.json
|
||||||
use \joomla_projects\robo\loadTasks;
|
use \joomla_projects\robo\loadTasks;
|
||||||
|
|
||||||
|
private $extension = '';
|
||||||
|
|
||||||
|
public function setExecExtension(){
|
||||||
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
|
$this->extension = '.exe';
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Executes Selenium System Tests in your machine
|
* Executes Selenium System Tests in your machine
|
||||||
*
|
*
|
||||||
|
@ -25,41 +32,58 @@ class RoboFile extends \Robo\Tasks
|
||||||
*/
|
*/
|
||||||
public function testAcceptance($seleniumPath = null)
|
public function testAcceptance($seleniumPath = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$this->setExecExtension();
|
||||||
|
|
||||||
// Get Joomla Clean Testing sites
|
// Get Joomla Clean Testing sites
|
||||||
if (is_dir('tests/joomla-cms3')) {
|
if (is_dir('tests/joomla-cms3')) {
|
||||||
$this->taskDeleteDir('tests/joomla-cms3')->run();
|
$this->taskDeleteDir('tests/joomla-cms3')->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_exec('git 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');
|
$this->say('Joomla CMS site created at tests/joomla-cms3');
|
||||||
|
|
||||||
if (!$seleniumPath) {
|
if (!$seleniumPath) {
|
||||||
if (!file_exists('selenium-server-standalone.jar')) {
|
if (!file_exists('selenium-server-standalone.jar')) {
|
||||||
$this->say('Downloading Selenium Server, this may take a while.');
|
$this->say('Downloading Selenium Server, this may take a while.');
|
||||||
$this->taskExec('wget')
|
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{
|
||||||
|
$this->taskExec('wget')
|
||||||
->arg('http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar')
|
->arg('http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar')
|
||||||
->arg('-O selenium-server-standalone.jar')
|
->arg('-O selenium-server-standalone.jar')
|
||||||
->printed(false)
|
->printed(false)
|
||||||
->run();
|
->run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$seleniumPath = 'selenium-server-standalone.jar';
|
$seleniumPath = 'selenium-server-standalone.jar';
|
||||||
}
|
}
|
||||||
|
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||||
|
$seleniumPath = "java -jar $seleniumPath >> selenium.log 2>&1 &";
|
||||||
|
}else{
|
||||||
|
$seleniumPath = "START java.exe -jar .\\" . $seleniumPath;
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure we have Composer
|
// Make sure we have Composer
|
||||||
if (!file_exists('./composer.phar')) {
|
if (!file_exists('./composer.phar')) {
|
||||||
$this->_exec('curl -sS https://getcomposer.org/installer | php');
|
$this->_exec('curl'.$this->extension.' -sS https://getcomposer.org/installer | php');
|
||||||
}
|
}
|
||||||
$this->taskComposerUpdate()->run();
|
$this->taskComposerUpdate()->run();
|
||||||
|
|
||||||
// Running Selenium server
|
// Running Selenium server
|
||||||
$this->_exec("java -jar $seleniumPath >> selenium.log 2>&1 &");
|
$this->_exec($seleniumPath);
|
||||||
|
|
||||||
$this->taskWaitForSeleniumStandaloneServer()
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
|
sleep(10);
|
||||||
|
}else{
|
||||||
|
$this->taskWaitForSeleniumStandaloneServer()
|
||||||
->run()
|
->run()
|
||||||
->stopOnFail();
|
->stopOnFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Loading Symfony Command and running with passed argument
|
// Loading Symfony Command and running with passed argument
|
||||||
$this->_exec('php vendor/bin/codecept build');
|
$this->_exec('php'.$this->extension.' vendor/bin/codecept build');
|
||||||
|
|
||||||
$this->taskCodecept()
|
$this->taskCodecept()
|
||||||
->suite('acceptance')
|
->suite('acceptance')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user