7 use Symfony\Component\Yaml\Yaml;
16 use Robo\Task\Base\loadShortcuts;
26 passthru($this->getBaseCmd(
"build:project"));
44 $baseCmd = $this->getBaseCmd(
"generate:tests");
46 $mftfArgNames = [
'config',
'nodes',
'lines',
'tests'];
48 foreach (
$opts as $argName => $argValue) {
49 if (in_array($argName, $mftfArgNames) && $argValue !==
null) {
50 $baseCmd .=
" --$argName $argValue";
56 $baseCmd .=
' --force';
59 return $this->taskExec($baseCmd)->args($tests)->run();
72 throw new Exception(
"Please provide suite name(s) after generate:suite command");
74 $baseCmd = $this->getBaseCmd(
"generate:suite");
75 return $this->taskExec($baseCmd)->args($args)->run();
86 $args = array_merge($args, [
'-k']);
87 $baseCmd = $this->getBaseCmd(
"run:group");
88 return $this->taskExec($baseCmd)->args($args)->run();
98 return $this->_exec(
'allure generate tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-results'. DIRECTORY_SEPARATOR .
' -o tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-report'. DIRECTORY_SEPARATOR .
'');
108 return $this->_exec(
'allure generate tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-results'. DIRECTORY_SEPARATOR .
' --output tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-report'. DIRECTORY_SEPARATOR .
' --clean');
118 return $this->_exec(
'allure report open --report-dir tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-report'. DIRECTORY_SEPARATOR .
'');
128 return $this->_exec(
'allure open --port 0 tests'. DIRECTORY_SEPARATOR .
'_output'. DIRECTORY_SEPARATOR .
'allure-report'. DIRECTORY_SEPARATOR .
'');
140 if ($result1->wasSuccessful()) {
156 if ($result1->wasSuccessful()) {
169 private function getBaseCmd($command)
171 $this->writeln(
"\033[01;31m Use of robo will be deprecated with next major release, please use <root>/vendor/bin/mftf $command \033[0m");
173 return realpath(
'../../../vendor/bin/mftf') .
" $command";
generateSuite(array $args)
defined('TESTS_BP')||define('TESTS_BP' __DIR__
generateTests(array $tests, $opts=[ 'config'=> null, 'force'=> false, 'nodes'=> null, 'lines'=> null, 'tests'=> null])
passthru($command, &$return_var=null)