Skip to content

Commit 0017f8a

Browse files
committed
MQE-802: Make ActionObject list of allowed characters comprehensive
- test case updated to catch {{data.array[0]}} references. Updated actionObject to properly resolve the above.
1 parent ffc0f71 commit 0017f8a

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

dev/tests/verification/Resources/CharacterReplacementTest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class CharacterReplacementTestCest
2727
*/
2828
public function CharacterReplacementTest(AcceptanceTester $I)
2929
{
30+
$I->click("#element");
31+
$I->fillField("#element", "7700 West Parmer Lane");
3032
$I->click("#element .abcdefghijklmnopqrstuvwxyz1234567890");
3133
$I->click("#element .`~!@#$%^&*()-_=+{}[]|\;:\".,></?()3., ");
3234
$I->click("#element .words, and, commas, and, spaces");

dev/tests/verification/TestModule/Data/ReplacementData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
<data key="lastname">Doe</data>
1515
<data key="middlename">Tiberius</data>
1616
<data key="favoriteIndex">0</data>
17+
<array key="street">
18+
<item>7700 West Parmer Lane</item>
19+
</array>
1720
</entity>
1821
<entity name="uniqueData" type="simpleData">
1922
<data key="firstname" unique="prefix">John</data>

dev/tests/verification/TestModule/Section/SampleSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="SampleSection">
1212
<element name="simpleElement" type="button" selector="#element"/>
13+
<element name="underscore_element" type="button" selector="#element"/>
1314
<element name="simpleElementOneParam" type="button" selector="#element .{{var1}}" parameterized="true"/>
1415
<element name="oneParamElement" type="button" selector="#element .{{var1}}" parameterized="true"/>
1516
<element name="twoParamElement" type="button" selector="#{{var1}} .{{var2}}" parameterized="true"/>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1111
<test name="CharacterReplacementTest">
12+
<click stepKey="charsInSectionElement" selector="{{SampleSection.underscore_element}}"/>
13+
<fillField stepKey="charsInDataRef" selector="{{SampleSection.underscore_element}}" userInput="{{simpleData.street[0]}}"/>
1214
<click stepKey="allChars1" selector="{{SampleSection.oneParamElement('abcdefghijklmnopqrstuvwxyz1234567890')}}"/>
1315
<click stepKey="allChars2" selector="{{SampleSection.oneParamElement('`~!@#$%^&amp;*()-_=+{}[]|\;:&quot;.,&gt;&lt;/?()$213., ')}}"/>
1416
<click stepKey="allChars3" selector="{{SampleSection.oneParamElement('words, and, commas, and, spaces')}}"/>

src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ActionObject
3232
const ACTION_ATTRIBUTE_URL = 'url';
3333
const ACTION_ATTRIBUTE_SELECTOR = 'selector';
3434
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/';
35-
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w]+\.[\w]+}}/';
35+
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w]+\.[\w\[\]]+}}/';
3636
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN_WITH_PARAMS= '/{{[\w]+\.[\w]+\(.+\)}}/';
3737

3838
/**

0 commit comments

Comments
 (0)