Skip to content

Commit 365bf6b

Browse files
committed
MQE-496: Allow passing multiple ActionGroup arguments into parameterized selector.
- CR Changes.
1 parent 656cf29 commit 365bf6b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ private function replaceAttributeArguments($arguments, $attributeValue, $matches
139139

140140
$attributeValue = $this->replaceAttributeArgumentInVariable($mainValue, $arguments, $attributeValue);
141141

142+
// Split on commas, trim all values, and finally filter out all FALSE values
142143
$argumentList = array_filter(array_map('trim', explode(',', $possibleArguments)));
143144

144145
foreach ($argumentList as $argumentValue) {

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ private function resolveTestVariable($inputString, $args)
913913
*/
914914
private function replaceMatchesIntoArg($matches, &$outputArg, $delimiter)
915915
{
916+
// Remove Duplicate $matches from array. Duplicate matches are replaced all in one go.
916917
$matches = array_unique($matches);
917918
foreach ($matches as $match) {
918919
$replacement = null;
@@ -951,17 +952,12 @@ private function processQuoteBreaks($match, $argument, $replacement)
951952
$outputArg = $argument;
952953
$beforeIndex = strpos($outputArg, $match) - 1;
953954
$afterIndex = $beforeIndex + strlen($match) + 1;
954-
$quoteBefore = true;
955-
$quoteAfter = true;
956955

957-
// Determine if there is a Single quote before/after the $match, and if there is only 1 quote before/after.
958-
if ($argument[$beforeIndex] != '"' || substr_count($argument, '"', 0, $beforeIndex+1)>1) {
959-
$quoteBefore = false;
960-
}
961-
if ($argument[$afterIndex] != '"' || substr_count($argument, '"', $afterIndex)>1) {
962-
$quoteAfter = false;
963-
}
964-
//Remove quotes at either end of argument if they aren't necessary. Add quote breaking if needed
956+
// Determine if there is a " before/after the $match, and if there is only one " before/after match.
957+
$quoteBefore = $argument[$beforeIndex] == '"' && substr_count($argument, '"', 0, $beforeIndex+1)<1;
958+
$quoteAfter = $argument[$afterIndex] == '"' && substr_count($argument, '"', $afterIndex)<1;
959+
960+
//Remove quotes at either end of argument if they aren't necessary. Add double-quote concatenation if needed.
965961
if ($quoteBefore) {
966962
$outputArg = substr($outputArg, 0, $beforeIndex) . substr($outputArg, $beforeIndex+1);
967963
$afterIndex--;

0 commit comments

Comments
 (0)