diff --git a/RoboFile.php b/RoboFile.php index 7eeac57..5b68639 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -171,6 +171,45 @@ class RoboFile extends \Robo\Tasks $pathToTestFile = 'tests/' . $suite . '/' . $test; + //loading the class to display the methods in the class + require 'tests/' . $suite . '/' . $test; + + //logic to fetch the class name from the file name + $fileName = explode("/", $test); + $className = explode(".", $fileName[1]); + + //if the selected file is cest only than we will give the option to execute individual methods, we don't need this in cept file + $i = 1; + if (strripos($className[0], 'cest')) + { + $class_methods = get_class_methods($className[0]); + $this->say('[' . $i . '] ' . 'All'); + $methods[$i] = 'All'; + $i++; + foreach ($class_methods as $method_name) + { + + $reflect = new ReflectionMethod($className[0], $method_name); + if(!$reflect->isConstructor()) + { + if ($reflect->isPublic()) + { + $this->say('[' . $i . '] ' . $method_name); + $methods[$i] = $method_name; + $i++; + } + } + } + $this->say(''); + $methodNumber = $this->ask('Please choose the method in the test that you would want to run...'); + $method = $methods[$methodNumber]; + } + + if(isset($method) && $method != 'All') + { + $pathToTestFile = $pathToTestFile . ':' . $method; + } + $this->taskCodecept() ->test($pathToTestFile) ->arg('--steps') diff --git a/composer.lock b/composer.lock index 2ac7273..e603d79 100644 --- a/composer.lock +++ b/composer.lock @@ -499,18 +499,16 @@ ], "authors": [ { - "name": "Henrik Bjornskov", - "email": "henrik@bjrnskov.dk", - "homepage": "http://henrik.bjrnskov.dk" + "name": "Yaroslav Kiliba", + "email": "om.dattaya@gmail.com" }, { "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "email": "ever.zet@gmail.com" }, { - "name": "Yaroslav Kiliba", - "email": "om.dattaya@gmail.com" + "name": "Henrik Bjrnskov", + "email": "henrik@bjrnskov.dk" } ], "description": "Resource Watcher.", @@ -527,12 +525,12 @@ "source": { "type": "git", "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0" + "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0056ff0018c529cc2a143f6d78004bce8f9d5b0", - "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/cdc02b3e3d7c112d83d625db7ea410dac4ce3142", + "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142", "shasum": "" }, "require": { @@ -570,7 +568,7 @@ "acceptance testing", "joomla" ], - "time": "2015-10-31 11:00:18" + "time": "2015-10-31 15:09:12" }, { "name": "joomla-projects/robo",