Skip to content

Commit 4cf1663

Browse files
authored
Merge branch 'develop' into MQE-1078
2 parents 7cb065f + ffd4cd0 commit 4cf1663

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

dev/tests/functional/_bootstrap.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,13 @@
2929
foreach ($_ENV as $key => $var) {
3030
defined($key) || define($key, $var);
3131
}
32+
33+
defined('MAGENTO_CLI_COMMAND_PATH') || define(
34+
'MAGENTO_CLI_COMMAND_PATH',
35+
'dev/tests/acceptance/utils/command.php'
36+
);
37+
$env->setEnvironmentVariable('MAGENTO_CLI_COMMAND_PATH', MAGENTO_CLI_COMMAND_PATH);
38+
39+
defined('MAGENTO_CLI_COMMAND_PARAMETER') || define('MAGENTO_CLI_COMMAND_PARAMETER', 'command');
40+
$env->setEnvironmentVariable('MAGENTO_CLI_COMMAND_PARAMETER', MAGENTO_CLI_COMMAND_PARAMETER);
3241
}

dev/tests/verification/Resources/BasicFunctionalTest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class BasicFunctionalTestCest
105105
$grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector");
106106
$grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector");
107107
$grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector");
108-
$magentoCli1 = $I->magentoCLI("maintenance:enable");
108+
$magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\"");
109109
$I->comment($magentoCli1);
110110
$I->makeScreenshot("screenShotInput");
111111
$I->maximizeWindow();

dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<grabMultiple selector=".functionalTestSelector" stepKey="grabMultipleKey1" />
6767
<grabTextFrom selector=".functionalTestSelector" stepKey="grabTextFromKey1" />
6868
<grabValueFrom selector=".functionalTestSelector" stepKey="grabValueFromKey1" />
69-
<magentoCLI command="maintenance:enable" stepKey="magentoCli1"/>
69+
<magentoCLI command="maintenance:enable" arguments="&quot;stuffHere&quot;" stepKey="magentoCli1"/>
7070
<makeScreenshot userInput="screenShotInput" stepKey="makeScreenshotKey1"/>
7171
<maximizeWindow stepKey="maximizeWindowKey1"/>
7272
<moveBack stepKey="moveBackKey1"/>

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,22 @@ public function scrollToTopOfPage()
457457
/**
458458
* Takes given $command and executes it against exposed MTF CLI entry point. Returns response from server.
459459
* @param string $command
460+
* @param string $arguments
460461
* @return string
461462
*/
462-
public function magentoCLI($command)
463+
public function magentoCLI($command, $arguments = null)
463464
{
464465
$apiURL = $this->config['url'] . getenv('MAGENTO_CLI_COMMAND_PATH');
465466
$executor = new CurlTransport();
466-
$executor->write($apiURL, [getenv('MAGENTO_CLI_COMMAND_PARAMETER') => $command], CurlInterface::POST, []);
467+
$executor->write(
468+
$apiURL,
469+
[
470+
getenv('MAGENTO_CLI_COMMAND_PARAMETER') => $command,
471+
'arguments' => $arguments
472+
],
473+
CurlInterface::POST,
474+
[]
475+
);
467476
$response = $executor->read();
468477
$executor->close();
469478
return $response;

src/Magento/FunctionalTestingFramework/Test/etc/Actions/customActions.xsd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
</xs:documentation>
4343
</xs:annotation>
4444
</xs:attribute>
45+
<xs:attribute type="xs:string" name="arguments">
46+
<xs:annotation>
47+
<xs:documentation>
48+
Arguments for Magento CLI command, will not be escaped.
49+
</xs:documentation>
50+
</xs:annotation>
51+
</xs:attribute>
4552
<xs:attributeGroup ref="commonActionAttributes"/>
4653
</xs:extension>
4754
</xs:simpleContent>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
488488
$dependentSelector = null;
489489
$visible = null;
490490
$command = null;
491+
$arguments = null;
491492
$sortOrder = null;
492493
$storeCode = null;
493494

@@ -503,6 +504,9 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
503504
if (isset($customActionAttributes['command'])) {
504505
$command = $this->addUniquenessFunctionCall($customActionAttributes['command']);
505506
}
507+
if (isset($customActionAttributes['arguments'])) {
508+
$arguments = $this->addUniquenessFunctionCall($customActionAttributes['arguments']);
509+
}
506510

507511
if (isset($customActionAttributes['attribute'])) {
508512
$attribute = $customActionAttributes['attribute'];
@@ -1218,7 +1222,8 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
12181222
$stepKey,
12191223
$actor,
12201224
$actionObject,
1221-
$command
1225+
$command,
1226+
$arguments
12221227
);
12231228
$testSteps .= sprintf(
12241229
"\t\t$%s->comment(\$%s);\n",

0 commit comments

Comments
 (0)