Skip to content

Commit 7a45291

Browse files
committed
MQE-1886: Ability to use grab data between ActionGroups
added functional test.
1 parent 324bb68 commit 7a45291

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ReturnValueActionGroup">
11+
<comment userInput="Action group to demonstrate returning values." stepKey="comment"/>
12+
<executeJS function="return 'test'" stepKey="testVariable"/>
13+
<return value="{$testVariable}" stepKey="returnVar"/>
14+
</actionGroup>
15+
</actionGroups>

dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,15 @@
4646
<argument name="test" value="{{HelperData.entityField}}" />
4747
<argument name="entityTest" value="HelperData" />
4848
</actionGroup>
49-
5049
<assertEqualsCanonicalizing stepKey="assertMergedArray">
5150
<actualResult type="array">{{ExtendedMessageData.numbers}}</actualResult>
5251
<expectedResult type="array">["Something New", "0", "1", "2", "3", "TESTING CASE"]</expectedResult>
5352
</assertEqualsCanonicalizing>
53+
54+
<actionGroup ref="ReturnValueActionGroup" stepKey="actionGroupValue"/>
55+
<assertEquals stepKey="assertActionGroupValue">
56+
<expectedResult type="variable">actionGroupValue</expectedResult>
57+
<actualResult type="string">test</actualResult>
58+
</assertEquals>
5459
</test>
5560
</tests>

dev/tests/verification/Tests/ActionGroupGenerationTest.php

-11
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,4 @@ public function testActionGroupWithActionStepKeyReferencesInSelectors()
228228
{
229229
$this->generateAndCompareTest('ActionGroupWithParameterizedElementsWithStepKeyReferences');
230230
}
231-
232-
/**
233-
* Test generation of a test referencing an action group that returns a value.
234-
*
235-
* @throws \Exception
236-
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
237-
*/
238-
public function testActionGroupReturningValue()
239-
{
240-
$this->generateAndCompareTest('ActionGroupReturningValueTest');
241-
}
242231
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
<xs:attribute name="value" use="required" type="xs:string">
364364
<xs:annotation>
365365
<xs:documentation>
366-
Value to be returned.
366+
Value or variable to be returned.
367367
</xs:documentation>
368368
</xs:annotation>
369369
</xs:attribute>

0 commit comments

Comments
 (0)