32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-25 17:51:07 +00:00

codestyle + fix windows webdriver load

This commit is contained in:
Jelle Kok 2019-08-13 04:18:48 +02:00
parent 8712d4033a
commit 3b155af6e9
No known key found for this signature in database
GPG Key ID: EC8776F3C011B1D1
3 changed files with 36 additions and 33 deletions

View File

@ -12,6 +12,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
use Joomla\Testing\Robo\Tasks\loadTasks;
use Robo\Tasks;
require_once 'vendor/autoload.php';
if (!defined('JPATH_BASE'))
@ -26,11 +29,11 @@ if (!defined('JPATH_BASE'))
*
* @since 1.0
*/
class RoboFile extends \Robo\Tasks
class RoboFile extends Tasks
{
// Load tasks from composer, see composer.json
use \Joomla\Testing\Robo\Tasks\loadTasks;
use \Joomla\Jorobo\Tasks\loadTasks;
use loadTasks;
use Joomla\Jorobo\Tasks\loadTasks;
/**
* File extension for executables
@ -77,23 +80,14 @@ class RoboFile extends \Robo\Tasks
/**
* Get the executable extension according to Operating System
*
* @return void
* @return string
*/
private function getExecutableExtension()
{
if ($this->isWindows())
{
// Check whether git.exe or git as command should be used,
// As on window both is possible
if (!$this->_exec('git.exe --version')->getMessage())
{
return '';
}
else
{
return '.exe';
}
}
return '';
}
@ -106,6 +100,7 @@ class RoboFile extends \Robo\Tasks
* - 'env': set a specific environment to get configuration from
*
* @return mixed
* @throws \Codeception\Exception\ConfigurationException
*/
public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
{
@ -166,6 +161,8 @@ class RoboFile extends \Robo\Tasks
* @param string $suite Optional name of the suite containing the tests, Acceptance by default.
*
* @return mixed
* @throws ReflectionException
* @throws \Codeception\Exception\ConfigurationException
*/
public function runTest($pathToTestFile = null, $suite = 'acceptance')
{
@ -441,6 +438,7 @@ class RoboFile extends \Robo\Tasks
* Runs Selenium Standalone Server.
*
* @return void
* @throws \Codeception\Exception\ConfigurationException
*/
public function runSelenium()
{
@ -448,7 +446,7 @@ class RoboFile extends \Robo\Tasks
{
// TODO: Move this logic to the selenium standalone server task in the parent joomla repo
$this->_exec('START java.exe -jar ' . $this->getWebDriver() .
' vendor\joomla-projects\selenium-server-standalone\bin\selenium-server-standalone.jar ');
' .\\vendor\\joomla-projects\\selenium-server-standalone\\bin\\selenium-server-standalone.jar ');
sleep(3);
}
else
@ -585,6 +583,7 @@ class RoboFile extends \Robo\Tasks
* @return string the webdriver string to use with selenium
*
* @since version
* @throws \Codeception\Exception\ConfigurationException
*/
public function getWebdriver()
{
@ -695,9 +694,9 @@ class RoboFile extends \Robo\Tasks
*
* @param String $target The target joomla instance
*
* @return void
* @since __DEPLOY_VERSION__
*
* @return void
*/
public function map($target)
{

View File

@ -25,6 +25,7 @@ class category extends \AcceptanceTester
* @param String $categoryName Name of the Category which is to be created
*
* @return void
* @throws \Exception
*/
public function createCategory($categoryName)
{
@ -50,6 +51,7 @@ class category extends \AcceptanceTester
* @param String $categoryName Name of the category which is to be trashed
*
* @return void
* @throws \Exception
*/
public function trashCategory($categoryName)
{
@ -69,6 +71,7 @@ class category extends \AcceptanceTester
* @param String $categoryName Name of the category which is to be deleted
*
* @return void
* @throws \Exception
*/
public function deleteCategory($categoryName)
{

View File

@ -20,6 +20,7 @@ class weblink extends \AcceptanceTester
* @param string $url The url for the weblink
* @param string $countClicks If not null, we set the "Count Clicks" weblink property to the given value.
*
* @throws \Exception
*/
public function createWeblink($title, $url, $countClicks = null)
{