diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt
index c16a6a26e..043a71c94 100644
--- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt
+++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt
@@ -29,6 +29,6 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest
*/
public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I)
{
- $I->see("John".msq("UniquePerson"), "#element .test1");
+ $I->see("John" . msq("UniquePerson"), "#element .test1");
}
}
diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt
index 98c561e3c..fb10e7847 100644
--- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt
+++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt
@@ -29,6 +29,6 @@ class ActionGroupWithSingleParameterSelectorFromPassedArgumentCest
*/
public function ActionGroupWithSingleParameterSelectorFromPassedArgument(AcceptanceTester $I)
{
- $I->see("Doe", "#element .John".msq("UniquePerson"));
+ $I->see("Doe", "#element .John" . msq("UniquePerson"));
}
}
diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt
index a6d620a2c..d5121931c 100644
--- a/dev/tests/verification/Resources/DataReplacementTest.txt
+++ b/dev/tests/verification/Resources/DataReplacementTest.txt
@@ -33,20 +33,22 @@ class DataReplacementTestCest
$I->conditionalClick("Doe", "#John", true);
$I->amOnUrl("John.html");
$I->searchAndMultiSelectOption("#selector", ["John", "Doe"]);
- $I->fillField("#selector", "StringBefore ".msq("uniqueData")."John StringAfter");
- $I->fillField("#".msq("uniqueData")."John", "input");
- $I->dragAndDrop("#".msq("uniqueData")."John", msq("uniqueData")."John");
- $I->conditionalClick(msq("uniqueData")."John", "#".msq("uniqueData")."John", true);
- $I->amOnUrl(msq("uniqueData")."John.html");
- $I->searchAndMultiSelectOption("#selector", [msq("uniqueData")."John", "Doe"]);
- $I->fillField("#selector", "StringBefore Doe".msq("uniqueData")." StringAfter");
- $I->fillField("#Doe".msq("uniqueData"), "input");
- $I->dragAndDrop("#Doe".msq("uniqueData"), "Doe".msq("uniqueData"));
- $I->conditionalClick("Doe".msq("uniqueData"), "#Doe".msq("uniqueData"), true);
- $I->amOnUrl("Doe".msq("uniqueData").".html");
- $I->searchAndMultiSelectOption("#selector", ["John", "Doe".msq("uniqueData")]);
- $I->searchAndMultiSelectOption("#selector", [msq("uniqueData")."John", "Doe".msq("uniqueData")]);
- $I->selectMultipleOptions("#Doe".msq("uniqueData"), "#element", [msq("uniqueData")."John", "Doe".msq("uniqueData")]);
+ $I->fillField("#selector", "StringBefore " . msq("uniqueData") . "John StringAfter");
+ $I->fillField("#" . msq("uniqueData") . "John", "input");
+ $I->dragAndDrop("#" . msq("uniqueData") . "John", msq("uniqueData") . "John");
+ $I->conditionalClick(msq("uniqueData") . "John", "#" . msq("uniqueData") . "John", true);
+ $I->amOnUrl(msq("uniqueData") . "John.html");
+ $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe"]);
+ $I->click("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John");
+ $I->click("#Doe" . msq("uniqueData") . "#Doe" . msq("uniqueData"));
+ $I->fillField("#selector", "StringBefore Doe" . msq("uniqueData") . " StringAfter");
+ $I->fillField("#Doe" . msq("uniqueData"), "input");
+ $I->dragAndDrop("#Doe" . msq("uniqueData"), "Doe" . msq("uniqueData"));
+ $I->conditionalClick("Doe" . msq("uniqueData"), "#Doe" . msq("uniqueData"), true);
+ $I->amOnUrl("Doe" . msq("uniqueData") . ".html");
+ $I->searchAndMultiSelectOption("#selector", ["John", "Doe" . msq("uniqueData")]);
+ $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]);
+ $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]);
$I->fillField(".selector", "0");
}
}
diff --git a/dev/tests/verification/Resources/ParameterArrayTest.txt b/dev/tests/verification/Resources/ParameterArrayTest.txt
index 2e196225d..f60478037 100644
--- a/dev/tests/verification/Resources/ParameterArrayTest.txt
+++ b/dev/tests/verification/Resources/ParameterArrayTest.txt
@@ -32,19 +32,19 @@ class ParameterArrayTestCest
$simpleDataKey = new DataPersistenceHandler($simpleParamData, []);
$simpleDataKey->createEntity();
$I->searchAndMultiSelectOption("#selector", ["name"]);
- $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData")."prename"]);
- $I->searchAndMultiSelectOption("#selector", ["postname".msq("simpleParamData")]);
+ $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData") . "prename"]);
+ $I->searchAndMultiSelectOption("#selector", ["postname" . msq("simpleParamData")]);
$I->searchAndMultiSelectOption("#selector", [$simpleDataKey->getCreatedDataByName('name')]);
$I->searchAndMultiSelectOption("#selector", ["name", $simpleDataKey->getCreatedDataByName('name')]);
$I->searchAndMultiSelectOption("#selector", ['someKey' => $simpleDataKey->getCreatedDataByName('name')]);
$I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]);
- $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData")."prename"]);
- $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname".msq("simpleParamData")]);
+ $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData") . "prename"]);
+ $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname" . msq("simpleParamData")]);
$I->unselectOption("#selector", ['foo']);
$I->unselectOption("#selector", ['foo', 'bar']);
$I->unselectOption("#selector", ["name"]);
- $I->unselectOption("#selector", [msq("simpleParamData")."prename"]);
- $I->unselectOption("#selector", ["postname".msq("simpleParamData")]);
+ $I->unselectOption("#selector", [msq("simpleParamData") . "prename"]);
+ $I->unselectOption("#selector", ["postname" . msq("simpleParamData")]);
$I->unselectOption("#selector", [$simpleDataKey->getCreatedDataByName('name')]);
$I->unselectOption("#selector", ["name", $simpleDataKey->getCreatedDataByName('name')]);
}
diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt
index b89eb130b..07a8e7400 100644
--- a/dev/tests/verification/Resources/SectionReplacementTest.txt
+++ b/dev/tests/verification/Resources/SectionReplacementTest.txt
@@ -38,14 +38,14 @@ class SectionReplacementTestCest
$I->click("#John .Doe");
$I->click("#John-Doe .Tiberius");
$I->click("#John-Doe .John [Tiberius]");
- $I->click("#element .".msq("uniqueData")."John");
- $I->click("#".msq("uniqueData")."John .stringLiteral2");
- $I->click("#".msq("uniqueData")."John-stringLiteral2 .stringLiteral3");
- $I->click("#".msq("uniqueData")."John-stringLiteral2 .");
- $I->click("#element .Doe".msq("uniqueData"));
- $I->click("#Doe".msq("uniqueData")." .stringLiteral2");
- $I->click("#Doe".msq("uniqueData")."-stringLiteral2 .stringLiteral3");
- $I->click("#Doe".msq("uniqueData")."-stringLiteral2 .Doe");
+ $I->click("#element ." . msq("uniqueData") . "John");
+ $I->click("#" . msq("uniqueData") . "John .stringLiteral2");
+ $I->click("#" . msq("uniqueData") . "John-stringLiteral2 .stringLiteral3");
+ $I->click("#" . msq("uniqueData") . "John-stringLiteral2 ." . msq("uniqueData") . "John [stringLiteral3]");
+ $I->click("#element .Doe" . msq("uniqueData"));
+ $I->click("#Doe" . msq("uniqueData") . " .stringLiteral2");
+ $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .stringLiteral3");
+ $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .Doe" . msq("uniqueData") . " [stringLiteral3]");
$I->amGoingTo("create entity that has the stepKey: createdData");
$simpleData = DataObjectHandler::getInstance()->getObject("simpleData");
$createdData = new DataPersistenceHandler($simpleData, []);
@@ -60,7 +60,7 @@ class SectionReplacementTestCest
$I->click("#John-Doe .John [Tiberius]");
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .John");
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .{$data}");
- $I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .".msq("uniqueData")."John");
- $I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .Doe".msq("uniqueData"));
+ $I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " ." . msq("uniqueData") . "John");
+ $I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .Doe" . msq("uniqueData"));
}
}
diff --git a/dev/tests/verification/TestModule/Test/DataReplacementTest.xml b/dev/tests/verification/TestModule/Test/DataReplacementTest.xml
index 7aadebb47..f12c70b26 100644
--- a/dev/tests/verification/TestModule/Test/DataReplacementTest.xml
+++ b/dev/tests/verification/TestModule/Test/DataReplacementTest.xml
@@ -22,6 +22,8 @@
+
+
diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index e10626f64..81e055fe6 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -1576,26 +1576,17 @@ private function addUniquenessToParamArray($input)
*/
private function addUniquenessFunctionCall($input)
{
- $output = '';
-
- preg_match('/' . EntityDataObject::CEST_UNIQUE_FUNCTION . '\("[\w]+"\)/', $input, $matches);
- if (!empty($matches)) {
- $parts = preg_split('/' . EntityDataObject::CEST_UNIQUE_FUNCTION . '\("[\w]+"\)/', $input, -1);
- for ($i = 0; $i < count($parts); $i++) {
- $parts[$i] = $this->stripWrappedQuotes($parts[$i]);
- }
- if (!empty($parts[0])) {
- $output = $this->wrapWithDoubleQuotes($parts[0]);
- }
- $output .= $output === '' ? $matches[0] : '.' . $matches[0];
- if (!empty($parts[1])) {
- $output .= '.' . $this->wrapWithDoubleQuotes($parts[1]);
- }
- } else {
- $output = $this->wrapWithDoubleQuotes($input);
+ $output = $this->wrapWithDoubleQuotes($input);
+
+ //Match on msq(\"entityName\")
+ preg_match_all('/' . EntityDataObject::CEST_UNIQUE_FUNCTION . '\(\\\\"[\w]+\\\\"\)/', $output, $matches);
+ foreach (array_unique($matches[0]) as $match) {
+ preg_match('/\\\\"([\w]+)\\\\"/', $match, $entityMatch);
+ $entity = $entityMatch[1];
+ $output = str_replace($match, '" . msq("' . $entity . '") . "', $output);
}
-
- return $output;
+ // trim unnecessary "" . and . ""
+ return preg_replace('/(?(?