Skip to content

Commit 7cc6d1c

Browse files
authored
MQE-463: Bad output with parameterized persisted unique data when using selector1 and selector2 attributes
- Added addUniquenessFunctionCall to selector1/2 attributes.
1 parent b641df8 commit 7cc6d1c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

dev/tests/verification/Resources/PersistedReplacementCest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ class PersistedReplacementCest
6565
$I->click("#element ." . $uniqueData->getCreatedDataByName('firstname'));
6666
$I->click("#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
6767
$I->click("#" . $uniqueData->getCreatedDataByName('firstname'));
68+
$I->dragAndDrop($uniqueData->getCreatedDataByName('firstname'), $uniqueData->getCreatedDataByName('firstname'));
69+
$I->dragAndDrop("#element ." . $uniqueData->getCreatedDataByName('firstname'), "#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
6870
}
6971
}

dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
<click selector="{{SampleSection.oneParamElement($uniqueData.firstname$)}}" mergeKey="h3"/>
5858
<click selector="{{SampleSection.twoParamElement($uniqueData.firstname$,'success')}}" mergeKey="h4"/>
5959
<click selector="#$uniqueData.firstname$" mergeKey="h5"/>
60+
61+
<!-- selector1/2 replacement -->
62+
<dragAndDrop selector1="$uniqueData.firstname$" selector2="$uniqueData.firstname$" mergeKey="j1"/>
63+
<dragAndDrop selector1="{{SampleSection.oneParamElement($uniqueData.firstname$)}}" selector2="{{SampleSection.twoParamElement($uniqueData.firstname$,'success')}}" mergeKey="j2"/>
64+
6065
</test>
6166
</cest>
6267
</config>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
391391
}
392392

393393
if (isset($customActionAttributes['selector1'])) {
394-
$selector1 = $this->wrapWithDoubleQuotes($customActionAttributes['selector1']);
394+
$selector1 = $this->addUniquenessFunctionCall($customActionAttributes['selector1']);
395395
}
396396

397397
if (isset($customActionAttributes['selector2'])) {
398-
$selector2 = $this->wrapWithDoubleQuotes($customActionAttributes['selector2']);
398+
$selector2 = $this->addUniquenessFunctionCall($customActionAttributes['selector2']);
399399
}
400400

401401
if (isset($customActionAttributes['x'])) {

0 commit comments

Comments
 (0)