Skip to content

Commit 3ba4a6d

Browse files
authored
MQE-410: [Generator] Bad output with Parameterized Persisted Unique data
- Changed selector resolution to call uniquenessFunctionCall. Solves issue with safe backwards compatibility. - Generator was stripping ' from selector strings like: #'{{name}}', turning that into #{{name}} when resolved.
1 parent 72dab13 commit 3ba4a6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
397397
if (isset($customActionAttributes['selectorArray'])) {
398398
$selector = $customActionAttributes['selectorArray'];
399399
} elseif (isset($customActionAttributes['selector'])) {
400-
$selector = $this->wrapWithDoubleQuotes($customActionAttributes['selector']);
400+
$selector = $this->addUniquenessFunctionCall($customActionAttributes['selector']);
401401
}
402402

403403
if (isset($customActionAttributes['selector1'])) {
@@ -1050,7 +1050,7 @@ private function wrapWithDoubleQuotes($input)
10501050
}
10511051

10521052
/**
1053-
* Strip beginning and ending quotes of input string.
1053+
* Strip beginning and ending double quotes of input string.
10541054
*
10551055
* @param string $input
10561056
* @return string
@@ -1060,10 +1060,10 @@ private function stripWrappedQuotes($input)
10601060
if (empty($input)) {
10611061
return '';
10621062
}
1063-
if (substr($input, 0, 1) === '"' || substr($input, 0, 1) === "'") {
1063+
if (substr($input, 0, 1) === '"') {
10641064
$input = substr($input, 1);
10651065
}
1066-
if (substr($input, -1, 1) === '"' || substr($input, -1, 1) === "'") {
1066+
if (substr($input, -1, 1) === '"') {
10671067
$input = substr($input, 0, -1);
10681068
}
10691069
return $input;

0 commit comments

Comments
 (0)