Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
RoboFile Class Reference
Inheritance diagram for RoboFile:

Public Member Functions

 buildProject ()
 
 generateTests (array $tests, $opts=[ 'config'=> null, 'force'=> false, 'nodes'=> null, 'lines'=> null, 'tests'=> null])
 
 generateSuite (array $args)
 
 group (array $args)
 
 allure1Generate ()
 
 allure2Generate ()
 
 allure1Open ()
 
 allure2Open ()
 
 allure1Report ()
 
 allure2Report ()
 

Detailed Description

This is project's console commands configuration for Robo task runner.

@codingStandardsIgnoreStart

See also
http://robo.li/

Definition at line 14 of file RoboFile.php.

Member Function Documentation

◆ allure1Generate()

allure1Generate ( )

Generate the HTML for the Allure report based on the Test XML output - Allure v1.4.X

Returns
\Robo\Result

Definition at line 96 of file RoboFile.php.

97  {
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 .'');
99  }

◆ allure1Open()

allure1Open ( )

Open the HTML Allure report - Allure v1.4.X

Returns
\Robo\Result

Definition at line 116 of file RoboFile.php.

117  {
118  return $this->_exec('allure report open --report-dir tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
119  }

◆ allure1Report()

allure1Report ( )

Generate and open the HTML Allure report - Allure v1.4.X

Returns
\Robo\Result

Definition at line 136 of file RoboFile.php.

137  {
138  $result1 = $this->allure1Generate();
139 
140  if ($result1->wasSuccessful()) {
141  return $this->allure1Open();
142  } else {
143  return $result1;
144  }
145  }
allure1Generate()
Definition: RoboFile.php:96
allure1Open()
Definition: RoboFile.php:116

◆ allure2Generate()

allure2Generate ( )

Generate the HTML for the Allure report based on the Test XML output - Allure v2.3.X

Returns
\Robo\Result

Definition at line 106 of file RoboFile.php.

107  {
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');
109  }

◆ allure2Open()

allure2Open ( )

Open the HTML Allure report - Allure v2.3.X

Returns
\Robo\Result

Definition at line 126 of file RoboFile.php.

127  {
128  return $this->_exec('allure open --port 0 tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
129  }

◆ allure2Report()

allure2Report ( )

Generate and open the HTML Allure report - Allure v2.3.X

Returns
\Robo\Result

Definition at line 152 of file RoboFile.php.

153  {
154  $result1 = $this->allure2Generate();
155 
156  if ($result1->wasSuccessful()) {
157  return $this->allure2Open();
158  } else {
159  return $result1;
160  }
161  }
allure2Generate()
Definition: RoboFile.php:106
allure2Open()
Definition: RoboFile.php:126

◆ buildProject()

buildProject ( )

Duplicate the Example configuration files for the Project. Build the Codeception project.

Returns
void

Definition at line 24 of file RoboFile.php.

25  {
26  passthru($this->getBaseCmd("build:project"));
27  }
passthru($command, &$return_var=null)

◆ generateSuite()

generateSuite ( array  $args)

Generate a suite based on name(s) passed in as args.

Parameters
array$args
Exceptions
Exception
Returns
\Robo\Result

Definition at line 69 of file RoboFile.php.

70  {
71  if (empty($args)) {
72  throw new Exception("Please provide suite name(s) after generate:suite command");
73  }
74  $baseCmd = $this->getBaseCmd("generate:suite");
75  return $this->taskExec($baseCmd)->args($args)->run();
76  }

◆ generateTests()

generateTests ( array  $tests,
  $opts = [ 'config' =,
null  ,
'force'  ,
false  ,
'nodes'  ,
null  ,
'lines'  ,
null  ,
'tests'  ,
null]   
)

Generate all Tests in PHP OR Generate set of tests via passing array of tests

Parameters
array$tests
array$opts
Returns
\Robo\Result

Definition at line 36 of file RoboFile.php.

43  {
44  $baseCmd = $this->getBaseCmd("generate:tests");
45 
46  $mftfArgNames = ['config', 'nodes', 'lines', 'tests'];
47  // append arguments to the end of the command
48  foreach ($opts as $argName => $argValue) {
49  if (in_array($argName, $mftfArgNames) && $argValue !== null) {
50  $baseCmd .= " --$argName $argValue";
51  }
52  }
53 
54  // use a separate conditional for the force flag (casting bool to string in php is hard)
55  if ($opts['force']) {
56  $baseCmd .= ' --force';
57  }
58 
59  return $this->taskExec($baseCmd)->args($tests)->run();
60  }

◆ group()

group ( array  $args)

Run all Tests with the specified @group tag'.

Parameters
array$args
Returns
\Robo\Result

Definition at line 84 of file RoboFile.php.

85  {
86  $args = array_merge($args, ['-k']);
87  $baseCmd = $this->getBaseCmd("run:group");
88  return $this->taskExec($baseCmd)->args($args)->run();
89  }

The documentation for this class was generated from the following file: