Skip to content

Commit eb0b1cd

Browse files
committed
Merge branch 'develop' into db_mftf_testlist_md
2 parents 7fe94f7 + 656f819 commit eb0b1cd

File tree

9 files changed

+41
-13
lines changed

9 files changed

+41
-13
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
2.4.3
5+
-----
6+
* Customizability
7+
* Use of `_CREDS` has been extended to `<magentoCLI>` and `<createData>` actions
8+
* Traceability
9+
* A Test step is now generated and injected in the allure report when a test is reported as `BROKEN`.
10+
11+
### Fixes
12+
* `static-checks` command now properly returns `1` if any static check failed.
13+
* MFTF Console Printer class correctly utilizes `--steps` and other flags passed directly to `codecept commands`.
14+
* `*source` actions correctly print when using `userInput` or `html` attributes.
15+
* XML Comments should no longer throw an error in parsing when used outside `test/actionGroup`
16+
17+
### GitHub Issues/Pull requests:
18+
* [#703](https://github.com/magento/magento2-functional-testing-framework/pull/403) -- SMALL_CHANGE: Minor change suggested
19+
420
2.4.2
521
-----
622
* Traceability

bin/mftf

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
try {
3030
$application = new Symfony\Component\Console\Application();
3131
$application->setName('Magento Functional Testing Framework CLI');
32-
$application->setVersion('2.4.2');
32+
$application->setVersion('2.4.3');
3333
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3434
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3535
foreach ($commandList->getCommands() as $command) {

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.4.2",
5+
"version": "2.4.3",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/verification/Resources/BasicFunctionalTest.txt

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class BasicFunctionalTestCest
9494
$I->dontSeeInField(".functionalTestSelector"); // stepKey: dontSeeInFieldKey1
9595
$I->dontSeeInPageSource("Cosmo Kramer"); // stepKey: dontSeeInPageSourceKey1
9696
$I->dontSeeInPageSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInPageSourceKey2
97+
$I->dontSeeInPageSource("Cosmo Kramer"); // stepKey: dontSeeInPageSourceKey3
98+
$I->dontSeeInPageSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInPageSourceKey4
99+
$I->dontSeeInPageSource("foo"); // stepKey: dontSeeInPageSourceKey5
100+
$I->dontSeeInPageSource("<p>foo</p>"); // stepKey: dontSeeInPageSourceKey6
97101
$I->dontSeeInSource("Cosmo Kramer"); // stepKey: dontSeeInSourceKey1
98102
$I->dontSeeInSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInSourceKey2
99103
$I->dontSeeInTitle("someInput"); // stepKey: dontSeeInTitleKey1

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

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
<dontSeeInField selector=".functionalTestSelector" stepKey="dontSeeInFieldKey1" />
5353
<dontSeeInPageSource html="Cosmo Kramer" stepKey="dontSeeInPageSourceKey1"/>
5454
<dontSeeInPageSource html="&#60;p&#62;Jerry Seinfeld&#60;&#47;p&#62;" stepKey="dontSeeInPageSourceKey2"/>
55+
<dontSeeInPageSource userInput="Cosmo Kramer" stepKey="dontSeeInPageSourceKey3"/>
56+
<dontSeeInPageSource userInput="&#60;p&#62;Jerry Seinfeld&#60;&#47;p&#62;" stepKey="dontSeeInPageSourceKey4"/>
57+
<dontSeeInPageSource userInput="bar" html="foo" stepKey="dontSeeInPageSourceKey5"/>
58+
<dontSeeInPageSource userInput="&#60;p&#62;bar&#60;&#47;p&#62;" html="&#60;p&#62;foo&#60;&#47;p&#62;" stepKey="dontSeeInPageSourceKey6"/>
5559
<dontSeeInSource html="Cosmo Kramer" stepKey="dontSeeInSourceKey1"/>
5660
<dontSeeInSource html="&#60;p&#62;Jerry Seinfeld&#60;&#47;p&#62;" stepKey="dontSeeInSourceKey2"/>
5761
<dontSeeInTitle userInput="someInput" stepKey="dontSeeInTitleKey1"/>

etc/config/command.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
1212
$tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class);
1313

14-
$tokenPassedIn = urldecode($_POST['token'] ?? "");
15-
$command = urldecode($_POST['command'] ?? "");
16-
$arguments = urldecode($_POST['arguments'] ?? "");
14+
$tokenPassedIn = urldecode($_POST['token']);
15+
$command = urldecode($_POST['command']);
16+
$arguments = urldecode($_POST['arguments']);
1717

1818
// Token returned will be null if the token we passed in is invalid
1919
$tokenFromMagento = $tokenModel->loadByToken($tokenPassedIn)->getToken();
@@ -22,12 +22,7 @@
2222
$magentoBinary = $php . ' -f ../../../../bin/magento';
2323
$valid = validateCommand($magentoBinary, $command);
2424
if ($valid) {
25-
// Turn string into array for symfony escaping
26-
$commandParts = array_filter(explode(" ", $command));
27-
$argumentParts = array_filter(explode(" ", $arguments));
28-
$magentoBinaryParts = array_filter(explode(" ", $magentoBinary));
29-
$commandArray = array_merge($magentoBinaryParts, $commandParts);
30-
$process = new Symfony\Component\Process\Process($commandArray);
25+
$process = new Symfony\Component\Process\Process($magentoBinary . " $command" . " $arguments");
3126
$process->setIdleTimeout(60);
3227
$process->setTimeout(0);
3328
$idleTimeout = false;

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,12 @@
172172
</xs:annotation>
173173
<xs:simpleContent>
174174
<xs:extension base="xs:string">
175-
<xs:attribute ref="html" use="required"/>
175+
<!--
176+
For backwards compatibility we accept both html and userInput.
177+
If html is specified, then html is used. Otherwise userInput is used.
178+
-->
179+
<xs:attribute ref="html"/>
180+
<xs:attribute ref="userInput"/>
176181
<xs:attributeGroup ref="commonActionAttributes"/>
177182
</xs:extension>
178183
</xs:simpleContent>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

+4
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
11741174
case "dontSeeInPageSource":
11751175
case "seeInSource":
11761176
case "dontSeeInSource":
1177+
//TODO: Deprecate allowed usage of userInput in dontSeeInPageSource
1178+
if ($html === null && $input !== null) {
1179+
$html = $input;
1180+
}
11771181
$testSteps .= $this->wrapFunctionCall($actor, $actionObject, $html);
11781182
break;
11791183
case "conditionalClick":

0 commit comments

Comments
 (0)