Skip to content

Commit afe9083

Browse files
committed
MQE-510: Output from robo generate:tests contains --env chrome parameters
1 parent f371c4d commit afe9083

File tree

3 files changed

+9
-36
lines changed

3 files changed

+9
-36
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dev/tests/verification/_generated/functionalSuite1/sampleSuite3Cest.php:includeTest --env chrome
2-
dev/tests/verification/_generated/functionalSuite1/sampleSuite5Cest.php:additionalTest --env chrome
3-
dev/tests/verification/_generated/functionalSuite1/sampleSuiteCest.php:includeTest --env chrome
4-
dev/tests/verification/_generated/functionalSuite1/sampleSuite4Cest.php:includeTest --env chrome
1+
dev/tests/verification/_generated/functionalSuite1/sampleSuite3Cest.php:includeTest
2+
dev/tests/verification/_generated/functionalSuite1/sampleSuite5Cest.php:additionalTest
3+
dev/tests/verification/_generated/functionalSuite1/sampleSuiteCest.php:includeTest
4+
dev/tests/verification/_generated/functionalSuite1/sampleSuite4Cest.php:includeTest

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,14 @@ private function createCestFile($cestPhp, $filename)
121121
* to the createCestFile function.
122122
*
123123
* @param string $runConfig
124-
* @param string $env
125124
* @return void
126125
*/
127-
public function createAllCestFiles($runConfig = null, $env = null)
126+
public function createAllCestFiles($runConfig = null)
128127
{
129128
DirSetupUtil::createGroupDir($this->exportDirectory);
130129

131130
// create our manifest file here
132-
$testManifest = new TestManifest($this->exportDirectory, $runConfig, $env);
131+
$testManifest = new TestManifest($this->exportDirectory, $runConfig);
133132
$cestPhpArray = $this->assembleAllCestPhp($testManifest);
134133

135134
foreach ($cestPhpArray as $cestPhpFile) {

src/Magento/FunctionalTestingFramework/Util/TestManifest.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
class TestManifest
1212
{
1313
const SINGLE_RUN_CONFIG = 'singleRun';
14-
const DEFAULT_BROWSER = 'chrome';
1514
const TEST_MANIFEST_FILENAME = 'testManifest.txt';
1615

1716
/**
@@ -21,13 +20,6 @@ class TestManifest
2120
*/
2221
private $filePath;
2322

24-
/**
25-
* Test Manifest environment flag. This is added to each dir or file in order for tests to execute properly.
26-
*
27-
* @var string $environment
28-
*/
29-
private $environment = self::DEFAULT_BROWSER;
30-
3123
/**
3224
* Type of manifest to generate. (Currently describes whether to path to a dir or for each test).
3325
*
@@ -47,9 +39,8 @@ class TestManifest
4739
*
4840
* @param string $path
4941
* @param string $runConfig
50-
* @param string $env
5142
*/
52-
public function __construct($path, $runConfig, $env)
43+
public function __construct($path, $runConfig)
5344
{
5445
$this->relativeDirPath = substr($path, strlen(dirname(dirname(TESTS_BP))) + 1);
5546
$filePath = $path . DIRECTORY_SEPARATOR . self::TEST_MANIFEST_FILENAME;
@@ -58,10 +49,6 @@ public function __construct($path, $runConfig, $env)
5849
fclose($fileResource);
5950

6051
$this->runTypeConfig = $runConfig;
61-
62-
if ($env) {
63-
$this->environment = $env;
64-
}
6552
}
6653

6754
/**
@@ -87,7 +74,7 @@ public function recordCest($cestName, $tests)
8774

8875
foreach ($tests as $test) {
8976
$line = $this->relativeDirPath . DIRECTORY_SEPARATOR . $cestName . '.php:' . $test->getName();
90-
fwrite($fileResource, $this->appendDefaultBrowser($line) ."\n");
77+
fwrite($fileResource, $line . "\n");
9178
}
9279

9380
fclose($fileResource);
@@ -102,21 +89,8 @@ public function recordCest($cestName, $tests)
10289
public function recordPathToExportDir()
10390
{
10491
$fileResource = fopen($this->filePath, 'a');
105-
10692
$line = $this->relativeDirPath . DIRECTORY_SEPARATOR;
107-
fwrite($fileResource, $this->appendDefaultBrowser($line) ."\n");
108-
93+
fwrite($fileResource, $line . "\n");
10994
fclose($fileResource);
11095
}
111-
112-
/**
113-
* Function which appends the --env flag to the test. This is needed to properly execute all tests in codeception.
114-
*
115-
* @param string $line
116-
* @return string
117-
*/
118-
private function appendDefaultBrowser($line)
119-
{
120-
return "${line} --env " . $this->environment;
121-
}
12296
}

0 commit comments

Comments
 (0)