Skip to content

Commit 932c435

Browse files
committed
MQE-1373: Cannot Use Data Returned By Test Actions As Substitutable Value Inside Parameterized Selector From Within Action Group
to replace custom field key in create data fixed regex to include action group parameter references fixed test generator to make full word replacement of stepKey references
1 parent a626fb8 commit 932c435

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function resolveAttributesWithArguments($arguments, $attributes)
226226
// $regexPattern match on: $matches[0] {{section.element(arg.field)}}
227227
// $matches[1] = section.element
228228
// $matches[2] = arg.field
229-
$regexPattern = '/{{([^(}]+)\(*([^)}]+)*\)*}}/';
229+
$regexPattern = '/{{([^(}]+)\(*([^)]+)*?\)*}}/';
230230

231231
$newActionAttributes = [];
232232
foreach ($attributes as $attributeKey => $attributeValue) {

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ private function resolveStepKeyReferences($input, $actionGroupOrigin, $matchAll
14831483
. $stepKey . $testInvocationKey . "', 'field', 'test')";
14841484

14851485
if (strpos($output, $stepKeyVarRef) !== false) {
1486-
$output = str_replace($stepKeyVarRef, $stepKeyVarRef . $testInvocationKey, $output);
1486+
$output = preg_replace('/\B\\' .$stepKeyVarRef. '\b/', $stepKeyVarRef . $testInvocationKey, $output);
14871487
}
14881488

14891489
if (strpos($output, $persistedVarRef) !== false) {

0 commit comments

Comments
 (0)