Skip to content

Commit

Permalink
[4.0] Fixed running single system tests (#20036)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesh authored and rdeutz committed Mar 31, 2018
1 parent a4667f3 commit 0d72e1c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class RoboFile extends \Robo\Tasks
{
use JoomlaRobo\Tasks;

/**
* Path to the Selenium folder#
*
* @var string
* @since 3.7.3
*/
const SELENIUM_FOLDER = __DIR__ . '/libraries/vendor/joomla-projects/selenium-server-standalone';

/**
* Path to the vendor folder
*
Expand Down Expand Up @@ -265,7 +273,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])

$this->createTestingSite($opts['use-htaccess']);

$this->taskRunSelenium(__DIR__ . '/libraries/vendor/joomla-projects/selenium-server-standalone', $this->getWebdriver())->run();
$this->taskRunSelenium(self::SELENIUM_FOLDER, $this->getWebdriver())->run();

sleep(3);

Expand Down Expand Up @@ -313,7 +321,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
*/
public function runTest($pathToTestFile = null, $suite = 'acceptance')
{
$this->taskRunSelenium('libraries/vendor/joomla-projects/selenium-server-standalone/bin', $this->getWebdriver());
$this->taskRunSelenium(self::SELENIUM_FOLDER, $this->getWebdriver());

// Make sure to run the build command to generate AcceptanceTester
$path = $this->vendorPath . 'bin/codecept';
Expand All @@ -325,7 +333,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance')

$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$this->vendorPath . $suite,
$this->testsPath . '/' . $suite,
RecursiveDirectoryIterator::SKIP_DOTS
),
RecursiveIteratorIterator::SELF_FIRST
Expand Down Expand Up @@ -357,7 +365,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance')
$test = $tests[$testNumber];
}

$pathToTestFile = $this->vendorPath . 'joomla/test-system/' . $suite . '/' . $test;
$pathToTestFile = $this->testsPath . '/' . $suite . '/' . $test;

// Loading the class to display the methods in the class

Expand All @@ -369,7 +377,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance')

if (isset($fileName[1]) && strripos($fileName[1], 'cest'))
{
require $this->vendorPath . $suite . '/' . $test;
require $this->testsPath . '/' . $suite . '/' . $test;

$className = explode(".", $fileName[1]);
$class_methods = get_class_methods($className[0]);
Expand Down

0 comments on commit 0d72e1c

Please sign in to comment.