@@ -15,6 +15,8 @@ class RoboFile extends \Robo\Tasks
15
15
16
16
/**
17
17
* Duplicate the Example configuration files used to customize the Project for customization
18
+ *
19
+ * @return void
18
20
*/
19
21
function cloneFiles ()
20
22
{
@@ -26,6 +28,8 @@ function cloneFiles()
26
28
/**
27
29
* Clone the Example configuration files
28
30
* Build the Codeception project
31
+ *
32
+ * @return void
29
33
*/
30
34
function buildProject ()
31
35
{
@@ -34,17 +38,43 @@ function buildProject()
34
38
}
35
39
36
40
/**
37
- * Generate all Tests
41
+ * Generate all Tests command.
42
+ *
43
+ * @param string[] $opts
44
+ * @return void
38
45
*/
39
- function generateTests ()
46
+ function generateTests ($ opts = [ ' config ' => null , ' env ' => ' chrome ' ] )
40
47
{
41
- require 'tests/ functional/ _bootstrap.php ' ;
42
- \Magento \FunctionalTestingFramework \Util \TestGenerator::getInstance ()->createAllCestFiles ();
48
+ require 'tests ' . DIRECTORY_SEPARATOR . ' functional ' . DIRECTORY_SEPARATOR . ' _bootstrap.php ' ;
49
+ \Magento \FunctionalTestingFramework \Util \TestGenerator::getInstance ()->createAllCestFiles ($ opts [ ' config ' ], $ opts [ ' env ' ] );
43
50
$ this ->say ("Generate Tests Command Run " );
44
51
}
45
52
53
+ /**
54
+ * Generate a suite based on name(s) passed in as args
55
+ *
56
+ * @param string[] args
57
+ * @return void
58
+ * @throws Exception
59
+ */
60
+ function generateSuite (array $ args )
61
+ {
62
+ if (empty ($ args )) {
63
+ throw new Exception ("Please provide suite name(s) after generate:suite command " );
64
+ }
65
+
66
+ require 'tests ' . DIRECTORY_SEPARATOR . 'functional ' . DIRECTORY_SEPARATOR . '_bootstrap.php ' ;
67
+ $ sg = \Magento \FunctionalTestingFramework \Suite \SuiteGenerator::getInstance ();
68
+
69
+ foreach ($ args as $ arg ) {
70
+ $ sg ->generateSuite ($ arg );
71
+ }
72
+ }
73
+
46
74
/**
47
75
* Run all Functional tests using the Chrome environment
76
+ *
77
+ * @return void
48
78
*/
49
79
function chrome ()
50
80
{
@@ -53,6 +83,8 @@ function chrome()
53
83
54
84
/**
55
85
* Run all Functional tests using the FireFox environment
86
+ *
87
+ * @return void
56
88
*/
57
89
function firefox ()
58
90
{
@@ -61,6 +93,8 @@ function firefox()
61
93
62
94
/**
63
95
* Run all Functional tests using the PhantomJS environment
96
+ *
97
+ * @return void
64
98
*/
65
99
function phantomjs ()
66
100
{
@@ -69,6 +103,8 @@ function phantomjs()
69
103
70
104
/**
71
105
* Run all Functional tests using the Chrome Headless environment
106
+ *
107
+ * @return void
72
108
*/
73
109
function headless ()
74
110
{
@@ -77,7 +113,9 @@ function headless()
77
113
78
114
/**
79
115
* Run all Tests with the specified @group tag, excluding @group 'skip', using the Chrome environment
116
+ *
80
117
* @param string $args
118
+ * @return void
81
119
*/
82
120
function group ($ args = '' )
83
121
{
@@ -86,7 +124,9 @@ function group($args = '')
86
124
87
125
/**
88
126
* Run all Functional tests located under the Directory Path provided using the Chrome environment
127
+ *
89
128
* @param string $args
129
+ * @return void
90
130
*/
91
131
function folder ($ args = '' )
92
132
{
@@ -95,6 +135,8 @@ function folder($args = '')
95
135
96
136
/**
97
137
* Run all Tests marked with the @group tag 'example', using the Chrome environment
138
+ *
139
+ * @return void
98
140
*/
99
141
function example ()
100
142
{
@@ -103,6 +145,8 @@ function example()
103
145
104
146
/**
105
147
* Generate the HTML for the Allure report based on the Test XML output - Allure v1.4.X
148
+ *
149
+ * @return void
106
150
*/
107
151
function allure1Generate ()
108
152
{
@@ -111,6 +155,8 @@ function allure1Generate()
111
155
112
156
/**
113
157
* Generate the HTML for the Allure report based on the Test XML output - Allure v2.3.X
158
+ *
159
+ * @return void
114
160
*/
115
161
function allure2Generate ()
116
162
{
@@ -119,6 +165,8 @@ function allure2Generate()
119
165
120
166
/**
121
167
* Open the HTML Allure report - Allure v1.4.xX
168
+ *
169
+ * @return void
122
170
*/
123
171
function allure1Open ()
124
172
{
@@ -127,6 +175,8 @@ function allure1Open()
127
175
128
176
/**
129
177
* Open the HTML Allure report - Allure v2.3.X
178
+ *
179
+ * @return void
130
180
*/
131
181
function allure2Open ()
132
182
{
@@ -135,6 +185,8 @@ function allure2Open()
135
185
136
186
/**
137
187
* Generate and open the HTML Allure report - Allure v1.4.X
188
+ *
189
+ * @return void
138
190
*/
139
191
function allure1Report ()
140
192
{
@@ -147,6 +199,8 @@ function allure1Report()
147
199
148
200
/**
149
201
* Generate and open the HTML Allure report - Allure v2.3.X
202
+ *
203
+ * @return void
150
204
*/
151
205
function allure2Report ()
152
206
{
@@ -156,4 +210,14 @@ function allure2Report()
156
210
$ this ->allure2Open ();
157
211
}
158
212
}
213
+
214
+ /**
215
+ * Run the Pre-Install Check Script
216
+ *
217
+ * @return void
218
+ */
219
+ function preInstall ()
220
+ {
221
+ $ this ->_exec ('php pre-install.php ' );
222
+ }
159
223
}
0 commit comments