Skip to content

Commit 641d68f

Browse files
authored
Merge pull request #1615 from magento-pangolin/oskar
Pangolins Sprint 11
2 parents c6e891d + 3e00eb9 commit 641d68f

File tree

52 files changed

+1272
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1272
-130
lines changed

dev/tests/acceptance/RoboFile.php

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class RoboFile extends \Robo\Tasks
1515

1616
/**
1717
* Duplicate the Example configuration files used to customize the Project for customization
18+
*
19+
* @return void
1820
*/
1921
function cloneFiles()
2022
{
@@ -26,6 +28,8 @@ function cloneFiles()
2628
/**
2729
* Clone the Example configuration files
2830
* Build the Codeception project
31+
*
32+
* @return void
2933
*/
3034
function buildProject()
3135
{
@@ -34,17 +38,43 @@ function buildProject()
3438
}
3539

3640
/**
37-
* Generate all Tests
41+
* Generate all Tests command.
42+
*
43+
* @param string[] $opts
44+
* @return void
3845
*/
39-
function generateTests()
46+
function generateTests($opts = ['config' => null, 'env' => 'chrome'])
4047
{
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']);
4350
$this->say("Generate Tests Command Run");
4451
}
4552

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+
4674
/**
4775
* Run all Functional tests using the Chrome environment
76+
*
77+
* @return void
4878
*/
4979
function chrome()
5080
{
@@ -53,6 +83,8 @@ function chrome()
5383

5484
/**
5585
* Run all Functional tests using the FireFox environment
86+
*
87+
* @return void
5688
*/
5789
function firefox()
5890
{
@@ -61,6 +93,8 @@ function firefox()
6193

6294
/**
6395
* Run all Functional tests using the PhantomJS environment
96+
*
97+
* @return void
6498
*/
6599
function phantomjs()
66100
{
@@ -69,6 +103,8 @@ function phantomjs()
69103

70104
/**
71105
* Run all Functional tests using the Chrome Headless environment
106+
*
107+
* @return void
72108
*/
73109
function headless()
74110
{
@@ -77,7 +113,9 @@ function headless()
77113

78114
/**
79115
* Run all Tests with the specified @group tag, excluding @group 'skip', using the Chrome environment
116+
*
80117
* @param string $args
118+
* @return void
81119
*/
82120
function group($args = '')
83121
{
@@ -86,7 +124,9 @@ function group($args = '')
86124

87125
/**
88126
* Run all Functional tests located under the Directory Path provided using the Chrome environment
127+
*
89128
* @param string $args
129+
* @return void
90130
*/
91131
function folder($args = '')
92132
{
@@ -95,6 +135,8 @@ function folder($args = '')
95135

96136
/**
97137
* Run all Tests marked with the @group tag 'example', using the Chrome environment
138+
*
139+
* @return void
98140
*/
99141
function example()
100142
{
@@ -103,6 +145,8 @@ function example()
103145

104146
/**
105147
* Generate the HTML for the Allure report based on the Test XML output - Allure v1.4.X
148+
*
149+
* @return void
106150
*/
107151
function allure1Generate()
108152
{
@@ -111,6 +155,8 @@ function allure1Generate()
111155

112156
/**
113157
* Generate the HTML for the Allure report based on the Test XML output - Allure v2.3.X
158+
*
159+
* @return void
114160
*/
115161
function allure2Generate()
116162
{
@@ -119,6 +165,8 @@ function allure2Generate()
119165

120166
/**
121167
* Open the HTML Allure report - Allure v1.4.xX
168+
*
169+
* @return void
122170
*/
123171
function allure1Open()
124172
{
@@ -127,6 +175,8 @@ function allure1Open()
127175

128176
/**
129177
* Open the HTML Allure report - Allure v2.3.X
178+
*
179+
* @return void
130180
*/
131181
function allure2Open()
132182
{
@@ -135,6 +185,8 @@ function allure2Open()
135185

136186
/**
137187
* Generate and open the HTML Allure report - Allure v1.4.X
188+
*
189+
* @return void
138190
*/
139191
function allure1Report()
140192
{
@@ -147,6 +199,8 @@ function allure1Report()
147199

148200
/**
149201
* Generate and open the HTML Allure report - Allure v2.3.X
202+
*
203+
* @return void
150204
*/
151205
function allure2Report()
152206
{
@@ -156,4 +210,14 @@ function allure2Report()
156210
$this->allure2Open();
157211
}
158212
}
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+
}
159223
}

0 commit comments

Comments
 (0)