From d55e0d5719c4ffdb93d99d5b9ab835729e9436c6 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 20:47:07 +0530 Subject: [PATCH 01/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- .../Util/TestGenerator.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index d95526676..60e6da423 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -344,6 +344,28 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) } foreach ($testObjects as $test) { + + // Throw exception if found duplicate arguments in helper or actionGroup + $allTag = @(array) next($test); + $arrStores = []; + foreach ($allTag as $value) { + $allArgs = (array) $value; + if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { + if (isset(array_values($allArgs)[3]['arguments']) && array_values($allArgs)[2] == 'actionGroup') { + $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); + } else if (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { + $arrStores[] = array_keys(array_values($allArgs)[3]); + } + } + } + $err = []; + foreach ($arrStores as $arrStore) { + if (count(array_unique($arrStore)) != count($arrStore)) { + $err = 'Duplicate argument not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + } + try { // Reset flag for new test $removeLastTest = false; From 59996cb8d27db3c9e6c4b5f996f878f0cd4014ad Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 20:51:56 +0530 Subject: [PATCH 02/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 60e6da423..2319fbaac 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -349,11 +349,11 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) $allTag = @(array) next($test); $arrStores = []; foreach ($allTag as $value) { - $allArgs = (array) $value; + $allArgs = (array) $value; if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { if (isset(array_values($allArgs)[3]['arguments']) && array_values($allArgs)[2] == 'actionGroup') { $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); - } else if (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { + } elseif (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { $arrStores[] = array_keys(array_values($allArgs)[3]); } } From 9ef5fae0fe56f88abd394dd643ae5a9c8a809eb4 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 20:55:33 +0530 Subject: [PATCH 03/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 2319fbaac..e575a7b7e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -342,9 +342,7 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) foreach ($filters as $filter) { $filter->filter($testObjects); } - foreach ($testObjects as $test) { - // Throw exception if found duplicate arguments in helper or actionGroup $allTag = @(array) next($test); $arrStores = []; From 7103f7dc0d611ca8df5f3cfe7eb2f4486364544d Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 21:01:49 +0530 Subject: [PATCH 04/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- .../Util/TestGenerator.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index e575a7b7e..af513dc52 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -348,11 +348,13 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) $arrStores = []; foreach ($allTag as $value) { $allArgs = (array) $value; - if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { - if (isset(array_values($allArgs)[3]['arguments']) && array_values($allArgs)[2] == 'actionGroup') { - $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); - } elseif (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { - $arrStores[] = array_keys(array_values($allArgs)[3]); + if (isset(array_values($allArgs)[2])) { + if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { + if (isset(array_values($allArgs)[3]['arguments']) && array_values($allArgs)[2] == 'actionGroup') { + $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); + } elseif (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { + $arrStores[] = array_keys(array_values($allArgs)[3]); + } } } } From 915733df4ec8afefcae9b60f27c568f37e857a9d Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 21:03:41 +0530 Subject: [PATCH 05/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index af513dc52..2123b2417 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -350,7 +350,7 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) $allArgs = (array) $value; if (isset(array_values($allArgs)[2])) { if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { - if (isset(array_values($allArgs)[3]['arguments']) && array_values($allArgs)[2] == 'actionGroup') { + if (isset(array_values($allArgs)[3]['arguments'])) { $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); } elseif (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { $arrStores[] = array_keys(array_values($allArgs)[3]); From 31f861a1260332f79f202baf9c4f85b4f3e5a772 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 22 Nov 2022 21:06:35 +0530 Subject: [PATCH 06/94] ACQE-2580: Helpers & ActionGroups Allow Duplicate Argument Names to be Passed --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 2123b2417..de7a97ba9 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -343,7 +343,7 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) $filter->filter($testObjects); } foreach ($testObjects as $test) { - // Throw exception if found duplicate arguments in helper or actionGroup + // Throw exception if duplicate arguments found in helper or actionGroup $allTag = @(array) next($test); $arrStores = []; foreach ($allTag as $value) { From 6ec40a4b2b303ce92d6c61b3e64b8d056938c5f7 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 00:53:30 +0530 Subject: [PATCH 07/94] ACQE-2580: new changes --- .../Util/TestGenerator.php | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index de7a97ba9..56dc2129f 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -259,6 +259,21 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) */ public function assembleTestPhp($testObject) { + // Throw exception if duplicate arguments found in helper or actionGroup + $fileToArr = file($testObject->getFilename()); + $argArr = []; + foreach ($fileToArr as $key => $fileVal) { + if (strpos($fileVal," $arrVal) { + if ( @$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + } + $this->customHelpers = []; $usePhp = $this->generateUseStatementsPhp(); @@ -343,29 +358,6 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore) $filter->filter($testObjects); } foreach ($testObjects as $test) { - // Throw exception if duplicate arguments found in helper or actionGroup - $allTag = @(array) next($test); - $arrStores = []; - foreach ($allTag as $value) { - $allArgs = (array) $value; - if (isset(array_values($allArgs)[2])) { - if (array_values($allArgs)[2] == 'actionGroup' || array_values($allArgs)[2] == 'helper') { - if (isset(array_values($allArgs)[3]['arguments'])) { - $arrStores[] = array_keys(array_values($allArgs)[3]['arguments']); - } elseif (isset(array_values($allArgs)[3]) && array_values($allArgs)[2] == 'helper') { - $arrStores[] = array_keys(array_values($allArgs)[3]); - } - } - } - } - $err = []; - foreach ($arrStores as $arrStore) { - if (count(array_unique($arrStore)) != count($arrStore)) { - $err = 'Duplicate argument not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - } - try { // Reset flag for new test $removeLastTest = false; From e0a7b26c20db4654c2d2c57711150092c3167902 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 00:56:23 +0530 Subject: [PATCH 08/94] ACQE-2580: new changes --- .../FunctionalTestingFramework/Util/TestGenerator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 56dc2129f..bed4486f6 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -263,17 +263,17 @@ public function assembleTestPhp($testObject) $fileToArr = file($testObject->getFilename()); $argArr = []; foreach ($fileToArr as $key => $fileVal) { - if (strpos($fileVal," $arrVal) { - if ( @$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { + if (@$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } } - + $this->customHelpers = []; $usePhp = $this->generateUseStatementsPhp(); From 02aca5bffd0099a7a9e33df982a07a118d5bc2cc Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:00:19 +0530 Subject: [PATCH 09/94] ACQE-2580: new changes --- .../FunctionalTestingFramework/Util/TestGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index bed4486f6..0d09219b3 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,14 +260,14 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - $fileToArr = file($testObject->getFilename()); + $fileToArr = @file($testObject->getFilename()); $argArr = []; - foreach ($fileToArr as $key => $fileVal) { + foreach (@$fileToArr as $key => $fileVal) { if (strpos($fileVal, " $arrVal) { + foreach (@$argArr as $key => $arrVal) { if (@$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); From b599cff2c3814599fe7d31322e6d31a8e8b8bcd3 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:03:23 +0530 Subject: [PATCH 10/94] ACQE-2580: new changes --- .../Util/TestGenerator.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 0d09219b3..f0e70f35e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,17 +260,19 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - $fileToArr = @file($testObject->getFilename()); + $fileToArr = file(@$testObject->getFilename()); $argArr = []; - foreach (@$fileToArr as $key => $fileVal) { + if (isset($fileToArr)) { + foreach ($fileToArr as $key => $fileVal) { if (strpos($fileVal, " $arrVal) { - if (@$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); + foreach ($argArr as $key => $arrVal) { + if (@$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } } } From 054fe4c37135a4222ff86d7714e7de2006ec9a84 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:06:28 +0530 Subject: [PATCH 11/94] ACQE-2580: new changes --- .../FunctionalTestingFramework/Util/TestGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f0e70f35e..666b5e7e5 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,9 +260,9 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - $fileToArr = file(@$testObject->getFilename()); - $argArr = []; - if (isset($fileToArr)) { + if (isset($testObject->getFilename())) { + $fileToArr = file($testObject->getFilename()); + $argArr = []; foreach ($fileToArr as $key => $fileVal) { if (strpos($fileVal, " Date: Fri, 25 Nov 2022 01:09:35 +0530 Subject: [PATCH 12/94] ACQE-2580: new changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 666b5e7e5..3280d1f3e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,7 +260,7 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - if (isset($testObject->getFilename())) { + if (null !== $testObject->getFilename()) { $fileToArr = file($testObject->getFilename()); $argArr = []; foreach ($fileToArr as $key => $fileVal) { From 04c1eaef1f246b95c504995a9fec14190b1a4934 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:11:53 +0530 Subject: [PATCH 13/94] ACQE-2580: new changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 3280d1f3e..8b0e63bc6 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,7 +260,7 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - if (null !== $testObject->getFilename()) { + if (!empty($testObject->getFilename())) { $fileToArr = file($testObject->getFilename()); $argArr = []; foreach ($fileToArr as $key => $fileVal) { From 923a5199930d5d714ceca9bac5be8ed8dcc151af Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:26:54 +0530 Subject: [PATCH 14/94] ACQE-2580: new changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 8b0e63bc6..982b459f3 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -261,7 +261,7 @@ public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup if (!empty($testObject->getFilename())) { - $fileToArr = file($testObject->getFilename()); + $fileToArr = explode("\n", file_get_contents($testObject->getFilename())); $argArr = []; foreach ($fileToArr as $key => $fileVal) { if (strpos($fileVal, " Date: Fri, 25 Nov 2022 01:29:49 +0530 Subject: [PATCH 15/94] ACQE-2580: new changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 982b459f3..f75374ab0 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -260,7 +260,7 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) public function assembleTestPhp($testObject) { // Throw exception if duplicate arguments found in helper or actionGroup - if (!empty($testObject->getFilename())) { + if (!empty($testObject->getFilename()) && file_exists($testObject->getFilename())) { $fileToArr = explode("\n", file_get_contents($testObject->getFilename())); $argArr = []; foreach ($fileToArr as $key => $fileVal) { From fc3b3e4dad541cadd29da5d8d0055224871a2c48 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Fri, 25 Nov 2022 01:32:36 +0530 Subject: [PATCH 16/94] ACQE-2580: new changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f75374ab0..da70a2fa1 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -264,8 +264,8 @@ public function assembleTestPhp($testObject) $fileToArr = explode("\n", file_get_contents($testObject->getFilename())); $argArr = []; foreach ($fileToArr as $key => $fileVal) { - if (strpos($fileVal, " $arrVal) { From c93cc72ae285535d07247fe14ee971a20a3fda9f Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 29 Nov 2022 19:00:05 +0530 Subject: [PATCH 17/94] ACQE-2580: extra validation added --- .../FunctionalTestingFramework/Util/TestGenerator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index da70a2fa1..5fbeb92f5 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -264,12 +264,16 @@ public function assembleTestPhp($testObject) $fileToArr = explode("\n", file_get_contents($testObject->getFilename())); $argArr = []; foreach ($fileToArr as $key => $fileVal) { - if (strpos($fileVal, " $arrVal) { - if (@$argArr[$key + 1] == $arrVal || @$argArr[$key - 1] == $arrVal) { + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal ) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key - 1]) && $argArr[$key - 1] === $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } From 7b4c95d94afc7af4d6e583c5210044c8e3d56a3b Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Tue, 29 Nov 2022 19:02:14 +0530 Subject: [PATCH 18/94] ACQE-2580: extra validation added --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 5fbeb92f5..1b4133c9d 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -269,7 +269,7 @@ public function assembleTestPhp($testObject) } } foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal ) { + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } From cb3756315010e2d94e43c7f747a7570c5d34194e Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 8 Dec 2022 19:25:04 +0530 Subject: [PATCH 19/94] ACQE-2580: changes --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 1b4133c9d..da41a14a5 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -273,7 +273,7 @@ public function assembleTestPhp($testObject) $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } - if (!empty($argArr[$key - 1]) && $argArr[$key - 1] === $arrVal) { + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } From d15444126c6c2c5067da3256fca6d1423b052ae5 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 2 Jan 2023 16:02:48 +0530 Subject: [PATCH 20/94] ACQE-4318: suite format changes --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 44e4e0b45..ac2928754 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -165,6 +165,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); foreach ($tests as $testName) { try { + echo $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); } catch (FastFailException $e) { throw $e; From 97aaa06c5d8e724579bfb52c38de5c35eb10fb11 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 2 Jan 2023 16:10:24 +0530 Subject: [PATCH 21/94] ACQE-4318: suite format changes --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index ac2928754..44e4e0b45 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -165,7 +165,6 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); foreach ($tests as $testName) { try { - echo $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); } catch (FastFailException $e) { throw $e; From f07777382150e621d986d7d197d6d5ee4cf01c35 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 2 Jan 2023 16:11:40 +0530 Subject: [PATCH 22/94] ACQE-4318: suite format changes --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 44e4e0b45..ac2928754 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -165,6 +165,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); foreach ($tests as $testName) { try { + echo $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); } catch (FastFailException $e) { throw $e; From b23a47bafd5fa70ffd61f73b3ea7b56e8089be80 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Wed, 11 Jan 2023 19:13:09 +0530 Subject: [PATCH 23/94] ACQE-4318: testgroupmembership file updated --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index ac2928754..10d5e59de 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -156,8 +156,9 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa { $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; - DirSetupUtil::createGroupDir($fullPath); + $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; + static $suiteCount = 0; $exceptionCollector = new ExceptionCollector(); try { $relevantTests = []; @@ -165,7 +166,8 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); foreach ($tests as $testName) { try { - echo $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; + $suiteTests = $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; + file_put_contents($memberShipFilePath, $suiteTests, FILE_APPEND); $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); } catch (FastFailException $e) { throw $e; @@ -179,7 +181,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa } else { $relevantTests = SuiteObjectHandler::getInstance()->getObject($suiteName)->getTests(); } - + $suiteCount++; if (empty($relevantTests)) { $exceptionCollector->reset(); // There are suites that include no test on purpose for certain Magento edition. From 0022b3631c72ea6e461d78bdf95ce3c60816fb14 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Sun, 15 Jan 2023 14:48:05 +0530 Subject: [PATCH 24/94] ACQE-4318 --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 10d5e59de..7e6b7fa3e 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -164,7 +164,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relevantTests = []; if (!empty($tests)) { $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); - foreach ($tests as $testName) { + foreach ($tests as $key => $testName) { try { $suiteTests = $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; file_put_contents($memberShipFilePath, $suiteTests, FILE_APPEND); From d244b3a22eecb91e114121cd4cba2f46a23be454 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Sun, 15 Jan 2023 14:50:37 +0530 Subject: [PATCH 25/94] ACQE-4318 --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 7e6b7fa3e..9577db5c6 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -157,7 +157,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; DirSetupUtil::createGroupDir($fullPath); - $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; + $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/groups/testgroupmembership.txt'; static $suiteCount = 0; $exceptionCollector = new ExceptionCollector(); try { From e7b5ee455e6bb3b3a82ad36b230d3b26c84bb7b5 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Sun, 15 Jan 2023 14:54:28 +0530 Subject: [PATCH 26/94] ACQE-4318 --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 9577db5c6..7e6b7fa3e 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -157,7 +157,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; DirSetupUtil::createGroupDir($fullPath); - $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/groups/testgroupmembership.txt'; + $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; static $suiteCount = 0; $exceptionCollector = new ExceptionCollector(); try { From bdcde5cac572dfa9236f273b5ad1462580d4114d Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Wed, 18 Jan 2023 12:29:36 +0530 Subject: [PATCH 27/94] ACQE-2580: Wrote unit test --- .../Util/TestGeneratorTest.php | 99 +++++++++++++++++++ .../Util/TestGenerator.php | 48 +++++---- 2 files changed, 128 insertions(+), 19 deletions(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php index dbdff8304..9808c516b 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php @@ -24,6 +24,7 @@ use ReflectionProperty; use tests\unit\Util\MagentoTestCase; use tests\unit\Util\TestLoggingUtil; +use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException; class TestGeneratorTest extends MagentoTestCase { @@ -299,6 +300,104 @@ function ($filename) use (&$generatedTests) { $this->assertArrayNotHasKey('test2Cest', $generatedTests); } + /** + * Test for exception thrown when duplicate arguments found + * + * @return void + * @throws TestFrameworkException + */ + public function testIfExceptionThrownWhenDuplicateArgumentsFound() + { + $fileContents = ' + + + + + + + + {{count}} + grabProducts1 + + + + '; + $actionInput = 'fakeInput'; + $actionObject = new ActionObject('fakeAction', 'comment', [ + 'userInput' => $actionInput + ]); + $annotation1 = ['group' => ['someGroupValue']]; + + $test1 = new TestObject( + 'test1', + ['fakeAction' => $actionObject], + $annotation1, + [], + 'filename' + ); + $annotation2 = ['group' => ['someOtherGroupValue']]; + + $test2 = new TestObject( + 'test2', + ['fakeAction' => $actionObject], + $annotation2, + [], + 'filename' + ); + $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]); + $this->expectException(TestFrameworkException::class); + $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents); + } + + /** + * Test for exception not thrown when duplicate arguments not found + * + * @return void + */ + public function testIfExceptionNotThrownWhenDuplicateArgumentsNotFound() + { + $fileContents = ' + + + + + + + {{count}} + grabProducts1 + + + + '; + $actionInput = 'fakeInput'; + $actionObject = new ActionObject('fakeAction', 'comment', [ + 'userInput' => $actionInput + ]); + $annotation1 = ['group' => ['someGroupValue']]; + + $test1 = new TestObject( + 'test1', + ['fakeAction' => $actionObject], + $annotation1, + [], + 'filename' + ); + $annotation2 = ['group' => ['someOtherGroupValue']]; + + $test2 = new TestObject( + 'test2', + ['fakeAction' => $actionObject], + $annotation2, + [], + 'filename' + ); + $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]); + $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents); + $this->assertEquals($result, ""); + } + /** * Tests that TestGenerator createAllTestFiles correctly filters based on group. * diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 614df5bce..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -247,6 +247,34 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) $this->createCestFile($testPhpFile[1], $testPhpFile[0]); } } + /** + * Throw exception if duplicate arguments found + * + * @param string $fileContents + * @return void + * @throws TestFrameworkException + */ + public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) + { + // Throw exception if duplicate arguments found in helper or actionGroup + $fileToArr = explode("\n", $fileContents); + $argArr = []; + foreach ($fileToArr as $key => $fileVal) { + if (!empty(strpos($fileVal, " $arrVal) { + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + } + } /** * Assemble the entire PHP string for a single Test based on a Test Object. @@ -259,27 +287,9 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) */ public function assembleTestPhp($testObject) { - // Throw exception if duplicate arguments found in helper or actionGroup if (!empty($testObject->getFilename()) && file_exists($testObject->getFilename())) { - $fileToArr = explode("\n", file_get_contents($testObject->getFilename())); - $argArr = []; - foreach ($fileToArr as $key => $fileVal) { - if (!empty(strpos($fileVal, " $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - } + $this->throwExceptionIfDuplicateArgumentsFound(file_get_contents($testObject->getFilename())); } - $this->customHelpers = []; $usePhp = $this->generateUseStatementsPhp(); From 1c4f1dd2f7dc7379e322a45f622a268954d4fdcd Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 13 Feb 2023 21:08:09 +0530 Subject: [PATCH 28/94] ACQE-4318: seprate function --- .../Suite/SuiteGenerator.php | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 7e6b7fa3e..6e7c0612a 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -139,6 +139,28 @@ public function generateSuite($suiteName) $this->generateSuiteFromTest($suiteName, []); } + /** + * Function which generate Testgroupmembership file. + * + * @param array $tests + * @return void + * @throws \Exception + */ + public function generateTestgroupmembership($tests) + { + $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; + static $suiteCount = 0; + foreach ($tests as $key => $testName) { + try { + $suiteTests = $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; + file_put_contents($memberShipFilePath, $suiteTests, FILE_APPEND); + } catch (FastFailException $e) { + throw $e; + } + } + $suiteCount++; + } + /** * Function which takes a suite name and a set of test names. The function then generates all relevant supporting * files and classes for the suite. The function takes an optional argument for suites which are split by a parallel @@ -157,17 +179,14 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; DirSetupUtil::createGroupDir($fullPath); - $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; - static $suiteCount = 0; $exceptionCollector = new ExceptionCollector(); try { $relevantTests = []; if (!empty($tests)) { $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); - foreach ($tests as $key => $testName) { + $this->generateTestgroupmembership($tests); + foreach ($tests as $testName) { try { - $suiteTests = $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; - file_put_contents($memberShipFilePath, $suiteTests, FILE_APPEND); $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); } catch (FastFailException $e) { throw $e; @@ -181,7 +200,6 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa } else { $relevantTests = SuiteObjectHandler::getInstance()->getObject($suiteName)->getTests(); } - $suiteCount++; if (empty($relevantTests)) { $exceptionCollector->reset(); // There are suites that include no test on purpose for certain Magento edition. From eb05da07825467ac3fc2d492446a9064310a9cfc Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 13 Feb 2023 21:17:57 +0530 Subject: [PATCH 29/94] ACQE-4318: seprate function --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 6e7c0612a..3a3699127 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -178,6 +178,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa { $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; + DirSetupUtil::createGroupDir($fullPath); $exceptionCollector = new ExceptionCollector(); try { @@ -200,6 +201,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa } else { $relevantTests = SuiteObjectHandler::getInstance()->getObject($suiteName)->getTests(); } + if (empty($relevantTests)) { $exceptionCollector->reset(); // There are suites that include no test on purpose for certain Magento edition. From 22d2831a8cd9acd7ad47398b4a74f88b7a657562 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Mon, 13 Feb 2023 21:18:42 +0530 Subject: [PATCH 30/94] ACQE-4318: seprate function --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 3a3699127..c6022acf5 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -178,7 +178,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa { $relativePath = TestGenerator::GENERATED_DIR . DIRECTORY_SEPARATOR . $suiteName; $fullPath = FilePathFormatter::format(TESTS_MODULE_PATH) . $relativePath . DIRECTORY_SEPARATOR; - + DirSetupUtil::createGroupDir($fullPath); $exceptionCollector = new ExceptionCollector(); try { From 3541230a3a41ffe68271b90aec7531058f3e613a Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Wed, 1 Mar 2023 21:23:37 +0530 Subject: [PATCH 31/94] Update TestGenerator.php --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..1a954426b 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -269,10 +269,6 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } } } From 9afa1ab3cf9a947ed6ab6f63ee98c6ee7c4fff29 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:37:01 +0530 Subject: [PATCH 32/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 1a954426b..b8f601b58 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -264,12 +264,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) $argArr[$key] = explode(" ", trim($fileVal))[1]; } } - foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - } + } /** From eda4d0c6fdd8422e32b784e816ba84c274bb34d0 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:19:27 +0530 Subject: [PATCH 33/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index b8f601b58..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -264,7 +264,16 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) $argArr[$key] = explode(" ", trim($fileVal))[1]; } } - + foreach ($argArr as $key => $arrVal) { + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + } } /** From 3edaddbc0722866dcde70fffe0c44150464faaee Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 2 Mar 2023 21:22:41 +0530 Subject: [PATCH 34/94] unit test done --- .../Suite/SuiteGeneratorTest.php | 54 +++++++++++++++++++ .../Suite/SuiteGenerator.php | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php index f6e215a5b..13c797509 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php @@ -40,6 +40,60 @@ protected function setUp(): void TestLoggingUtil::getInstance()->setMockLoggingUtil(); } + /** + * Tests generating a suite given a set of parsed test data. + * + * @return void + * @throws Exception + */ + public function testGenerateTestgroupmembership(): void + { + $suiteDataArrayBuilder = new SuiteDataArrayBuilder(); + $mockSuiteData = $suiteDataArrayBuilder + ->withName('mockSuite') + ->includeGroups(['group1']) + ->build(); + $testDataArrayBuilder = new TestDataArrayBuilder(); + $mockSimpleTest1 = $testDataArrayBuilder + ->withName('simpleTest1') + ->withAnnotations(['group' => [['value' => 'group1']]]) + ->withTestReference("NonExistantTest") + ->withTestActions() + ->build(); + $mockSimpleTest2 = $testDataArrayBuilder + ->withName('simpleTest2') + ->withAnnotations(['group' => [['value' => 'group1']]]) + ->withTestActions() + ->build(); + $mockSimpleTest3 = $testDataArrayBuilder + ->withName('simpleTest3') + ->withAnnotations(['group' => [['value' => 'group1']]]) + ->withTestActions() + ->build(); + $mockTestData = array_merge($mockSimpleTest1, $mockSimpleTest2, $mockSimpleTest3); + $this->setMockTestAndSuiteParserOutput($mockTestData, $mockSuiteData); + + // Make manifest for split suites + $suiteConfig = [ + 'mockSuite' => [ + 'mockSuite_0_G' => ['simpleTest1', 'simpleTest2'], + 'mockSuite_1_G' => ['simpleTest3'], + ], + ]; + $manifest = TestManifestFactory::makeManifest('default', $suiteConfig); + + // parse and generate suite object with mocked data and manifest + $mockSuiteGenerator = SuiteGenerator::getInstance(); + $mockSuiteGenerator->generateAllSuites($manifest); + + // assert last split suite group generated + TestLoggingUtil::getInstance()->validateMockLogStatement( + 'info', + 'suite generated', + ['suite' => 'mockSuite_1_G', 'relative_path' => '_generated' . DIRECTORY_SEPARATOR . 'mockSuite_1_G'] + ); + } + /** * Tests generating a single suite given a set of parsed test data. * diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index c6022acf5..ebd5f182e 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -143,10 +143,11 @@ public function generateSuite($suiteName) * Function which generate Testgroupmembership file. * * @param array $tests + * @param string $suiteName * @return void * @throws \Exception */ - public function generateTestgroupmembership($tests) + public function generateTestgroupmembership($suiteName, $tests) { $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; static $suiteCount = 0; From e3247dede08d87993661106ead755151bad5db93 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 2 Mar 2023 21:24:24 +0530 Subject: [PATCH 35/94] unit test done --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index ebd5f182e..5676ab1e4 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -186,7 +186,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relevantTests = []; if (!empty($tests)) { $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); - $this->generateTestgroupmembership($tests); + $this->generateTestgroupmembership($suiteName, $tests); foreach ($tests as $testName) { try { $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); From d88fbac80af25df99f9fad0be6b74fc6de072c05 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 2 Mar 2023 21:29:05 +0530 Subject: [PATCH 36/94] unit test done --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 5676ab1e4..f84ef6cbe 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -142,8 +142,8 @@ public function generateSuite($suiteName) /** * Function which generate Testgroupmembership file. * - * @param array $tests * @param string $suiteName + * @param array $tests * @return void * @throws \Exception */ From b5c36276d448f2a5a353a975566ad1cc1bba3bf9 Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 2 Mar 2023 21:29:45 +0530 Subject: [PATCH 37/94] unit test done --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index f84ef6cbe..b766e84c4 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -142,8 +142,8 @@ public function generateSuite($suiteName) /** * Function which generate Testgroupmembership file. * - * @param string $suiteName - * @param array $tests + * @param string $suiteName + * @param array $tests * @return void * @throws \Exception */ From 79cfbd7b00adc3b6e9b5e7fff25fa4bc4187f1df Mon Sep 17 00:00:00 2001 From: "Ashish.Kumar18" Date: Thu, 2 Mar 2023 21:32:36 +0530 Subject: [PATCH 38/94] unit test done --- src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index b766e84c4..1ba590b1a 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -143,7 +143,7 @@ public function generateSuite($suiteName) * Function which generate Testgroupmembership file. * * @param string $suiteName - * @param array $tests + * @param array $tests * @return void * @throws \Exception */ From 016a0bc3e52edb95f5c8d605945d5613886f2ab7 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:20:04 +0530 Subject: [PATCH 39/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..b22f1eb82 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,14 +265,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } + } } From cbbbba3e69c25d4f89bee566166941b0a522a45b Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:23:37 +0530 Subject: [PATCH 40/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index b22f1eb82..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,7 +265,14 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } } } From e404eac05defc463b8fbea3e86c2ccf73ad2d0dd Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Thu, 16 Mar 2023 17:46:32 +0530 Subject: [PATCH 41/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..b22f1eb82 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,14 +265,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } + } } From c8ebed67d5f7ff00d91b69694825cd5e76b218b5 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:55:18 +0530 Subject: [PATCH 42/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index b22f1eb82..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,7 +265,14 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } } } From 2547fb37e6061c1cfe4ac1a70cd39132b794b69c Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Mon, 20 Mar 2023 20:10:08 +0530 Subject: [PATCH 43/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..b22f1eb82 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,14 +265,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } + } } From 14318ac0a75e046871270005993fb5f5fad4bda5 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Mon, 20 Mar 2023 21:52:31 +0530 Subject: [PATCH 44/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index b22f1eb82..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,7 +265,14 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } } } From f348e32ed0f0b09b238d7175ccef347c8d79fdc1 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Mon, 20 Mar 2023 22:28:12 +0530 Subject: [PATCH 45/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..b22f1eb82 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,14 +265,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } + } } From 228e02cab998c369ff308b6bd1528772730662c2 Mon Sep 17 00:00:00 2001 From: GL-Ashish <92850316+GL-Ashish@users.noreply.github.com> Date: Mon, 20 Mar 2023 22:45:30 +0530 Subject: [PATCH 46/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index b22f1eb82..20d764189 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,7 +265,14 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { - + if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { + $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } } } From 2b19f3e0f1766c936ad3d61c3ca524e1b3cdf3ff Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Wed, 12 Apr 2023 09:32:47 +0530 Subject: [PATCH 47/94] Update TestGenerator.php --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 20d764189..fdd5ef674 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -265,6 +265,9 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) } } foreach ($argArr as $key => $arrVal) { + if (!str_contains('=', $arrVal)) { + continue; + } if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; throw new TestFrameworkException(implode(PHP_EOL, $err)); From c5751c6a9e564d3a982665ee655ddaefdf7a93a0 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Wed, 26 Apr 2023 10:32:17 +0530 Subject: [PATCH 48/94] Update TestGenerator.php --- .../Util/TestGenerator.php | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index fdd5ef674..ce81230d1 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -250,33 +250,43 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) /** * Throw exception if duplicate arguments found * - * @param string $fileContents + * @param string $fileName * @return void * @throws TestFrameworkException */ - public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) + public function throwExceptionIfDuplicateArgumentsFound(string $fileName): void { - // Throw exception if duplicate arguments found in helper or actionGroup + $fileContents = file_get_contents($fileName); $fileToArr = explode("\n", $fileContents); - $argArr = []; - foreach ($fileToArr as $key => $fileVal) { - if (!empty(strpos($fileVal, " $arrVal) { - if (!str_contains('=', $arrVal)) { - continue; - } - if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; + $argumentArray = []; + $actionGroupStart = false; + foreach ($fileToArr as $fileVal) { + $fileVal = trim($fileVal); + if (str_starts_with($fileVal, '')) { + $actionGroupStart = true; + continue; + } + if ($fileVal === '') { + $argumentNameArray = []; + foreach ($argumentArray as $argument) { + $subtringStart = strpos($argument, 'name='); + $subtringStart += strlen('name='); + $size = strpos($argument, ' ', $subtringStart) - $subtringStart; + $argumentName = substr($argument, $subtringStart, $size); + if (in_array($argumentName, $argumentNameArray)) { + $err[] = sprintf('Duplicate argument name: %s in test file: %s', $argumentName, $fileName); throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) { - $err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup'; - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - } + } + $argumentNameArray[] = $argumentName; + } + $argumentArray = []; + $actionGroupStart = false; + continue; + } + if ($actionGroupStart) { + $argumentArray[] = $fileVal; + } + } } /** @@ -291,7 +301,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents) public function assembleTestPhp($testObject) { if (!empty($testObject->getFilename()) && file_exists($testObject->getFilename())) { - $this->throwExceptionIfDuplicateArgumentsFound(file_get_contents($testObject->getFilename())); + $this->throwExceptionIfDuplicateArgumentsFound($testObject->getFilename()); } $this->customHelpers = []; $usePhp = $this->generateUseStatementsPhp(); From ed0679724e01cc44fa01af8ddc535b77ea5736d8 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Wed, 26 Apr 2023 18:04:00 +0530 Subject: [PATCH 49/94] Update TestGenerator.php --- .../Util/TestGenerator.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index ce81230d1..a884ca5e0 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -261,32 +261,32 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileName): void $argumentArray = []; $actionGroupStart = false; foreach ($fileToArr as $fileVal) { - $fileVal = trim($fileVal); - if (str_starts_with($fileVal, '')) { - $actionGroupStart = true; - continue; - } - if ($fileVal === '') { - $argumentNameArray = []; - foreach ($argumentArray as $argument) { - $subtringStart = strpos($argument, 'name='); - $subtringStart += strlen('name='); - $size = strpos($argument, ' ', $subtringStart) - $subtringStart; - $argumentName = substr($argument, $subtringStart, $size); - if (in_array($argumentName, $argumentNameArray)) { - $err[] = sprintf('Duplicate argument name: %s in test file: %s', $argumentName, $fileName); - throw new TestFrameworkException(implode(PHP_EOL, $err)); - } - $argumentNameArray[] = $argumentName; - } - $argumentArray = []; - $actionGroupStart = false; - continue; - } - if ($actionGroupStart) { - $argumentArray[] = $fileVal; - } - } + $fileVal = trim($fileVal); + if ((str_starts_with($fileVal, '')) { + $actionGroupStart = true; + continue; + } + if ($fileVal === '' || $fileVal === '') { + $argumentNameArray = []; + foreach ($argumentArray as $argument) { + $subtringStart = strpos($argument, 'name='); + $subtringStart += strlen('name='); + $size = strpos($argument, ' ', $subtringStart) - $subtringStart; + $argumentName = substr($argument, $subtringStart, $size); + if (in_array($argumentName, $argumentNameArray)) { + $err[] = sprintf('Duplicate argument for actiongroup or helper with name: %s in test file: %s', $argumentName, $fileName); + throw new TestFrameworkException(implode(PHP_EOL, $err)); + } + $argumentNameArray[] = $argumentName; + } + $argumentArray = []; + $actionGroupStart = false; + continue; + } + if ($actionGroupStart) { + $argumentArray[] = $fileVal; + } + } } /** From aee41a825154afaa169a13d70a18f30359ce4381 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Thu, 4 May 2023 08:56:50 +0530 Subject: [PATCH 50/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index a884ca5e0..f6bf0eb17 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -250,13 +250,13 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) /** * Throw exception if duplicate arguments found * + * @param string $fileContents * @param string $fileName * @return void * @throws TestFrameworkException */ - public function throwExceptionIfDuplicateArgumentsFound(string $fileName): void - { - $fileContents = file_get_contents($fileName); + public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, string $fileName = ''): void + { $fileToArr = explode("\n", $fileContents); $argumentArray = []; $actionGroupStart = false; @@ -301,7 +301,8 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileName): void public function assembleTestPhp($testObject) { if (!empty($testObject->getFilename()) && file_exists($testObject->getFilename())) { - $this->throwExceptionIfDuplicateArgumentsFound($testObject->getFilename()); + $fileContents = file_get_contents($testObject->getFilename()); + $this->throwExceptionIfDuplicateArgumentsFound($fileContents, $testObject->getFilename()); } $this->customHelpers = []; $usePhp = $this->generateUseStatementsPhp(); From f34117cfd3ae52be9fa4ab697f05c55b4929b9d2 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Thu, 4 May 2023 09:02:33 +0530 Subject: [PATCH 51/94] Update TestGenerator.php --- .../Util/TestGenerator.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f6bf0eb17..95cf754d9 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -256,13 +256,16 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null) * @throws TestFrameworkException */ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, string $fileName = ''): void - { + { $fileToArr = explode("\n", $fileContents); $argumentArray = []; $actionGroupStart = false; foreach ($fileToArr as $fileVal) { $fileVal = trim($fileVal); - if ((str_starts_with($fileVal, '')) { + if ( + (str_starts_with($fileVal, '') + ) { $actionGroupStart = true; continue; } @@ -274,7 +277,11 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, st $size = strpos($argument, ' ', $subtringStart) - $subtringStart; $argumentName = substr($argument, $subtringStart, $size); if (in_array($argumentName, $argumentNameArray)) { - $err[] = sprintf('Duplicate argument for actiongroup or helper with name: %s in test file: %s', $argumentName, $fileName); + $err[] = sprintf( + 'Duplicate argument for actiongroup or helper with name: %s in test file: %s', + $argumentName, + $fileName + ); throw new TestFrameworkException(implode(PHP_EOL, $err)); } $argumentNameArray[] = $argumentName; From f401b15609f29f6771f978b70466f81480463a2f Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Thu, 4 May 2023 09:05:46 +0530 Subject: [PATCH 52/94] ACQE-2580 | Fix static checks --- .../FunctionalTestingFramework/Util/TestGenerator.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 95cf754d9..3474d12aa 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -262,8 +262,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, st $actionGroupStart = false; foreach ($fileToArr as $fileVal) { $fileVal = trim($fileVal); - if ( - (str_starts_with($fileVal, '') ) { $actionGroupStart = true; @@ -278,8 +277,8 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, st $argumentName = substr($argument, $subtringStart, $size); if (in_array($argumentName, $argumentNameArray)) { $err[] = sprintf( - 'Duplicate argument for actiongroup or helper with name: %s in test file: %s', - $argumentName, + 'Duplicate argument for actiongroup or helper with name: %s in test file: %s', + $argumentName, $fileName ); throw new TestFrameworkException(implode(PHP_EOL, $err)); From 4c6c9bc7ece70c26c390d5468b4bd3758b7d099b Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Tue, 16 May 2023 09:47:27 +0530 Subject: [PATCH 53/94] ACQE-4318 | Add default test in membership.text file --- .../Suite/SuiteGenerator.php | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 1ba590b1a..d3fccb0b6 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -95,6 +95,7 @@ public static function getInstance(): SuiteGenerator */ public function generateAllSuites($testManifest) { + $this->generateTestgroupmembership($testManifest); $suites = $testManifest->getSuiteConfig(); foreach ($suites as $suiteName => $suiteContent) { @@ -142,24 +143,44 @@ public function generateSuite($suiteName) /** * Function which generate Testgroupmembership file. * - * @param string $suiteName - * @param array $tests + * @param $testManifest * @return void * @throws \Exception */ - public function generateTestgroupmembership($suiteName, $tests) + public function generateTestgroupmembership($testManifest) { $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; - static $suiteCount = 0; - foreach ($tests as $key => $testName) { - try { - $suiteTests = $suiteCount.":".$key.":".$suiteName.':'.$testName."\n"; - file_put_contents($memberShipFilePath, $suiteTests, FILE_APPEND); - } catch (FastFailException $e) { - throw $e; - } + + $testManifestArray = (array) $testManifest; + $prefix = chr(0).'*'.chr(0); + $defaultSuiteTests = $testManifestArray[$prefix.'testNameToSize']; + + $suiteCount = 0; + $testCount = 0; + foreach ($defaultSuiteTests as $defaultSuiteTestName => $defaultTestValue) { + $defaultSuiteTestName = rtrim($defaultSuiteTestName, 'Cest'); + $defaultSuiteTest = sprintf('%s:%s:%s\n', $suiteCount, 0, $defaultSuiteTestName); + file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND); + $testCount++; } + $suiteCount++; + $suites = $testManifest->getSuiteConfig(); + foreach ($suites as $suite => $tests) { + foreach ($tests as $key => $test) { + if(!is_numeric($key)) { + foreach ($test as $testKey => $testName) { + $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $testKey, $key, $testName); + file_put_contents($memberShipFilePath, $suiteTest, FILE_APPEND); + $suiteCount++; + } + } else { + $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $key, $suite, $test); + file_put_contents($memberShipFilePath, $suiteTest, FILE_APPEND); + } + } + $suiteCount++; + } } /** @@ -186,7 +207,6 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa $relevantTests = []; if (!empty($tests)) { $this->validateTestsReferencedInSuite($suiteName, $tests, $originalSuiteName); - $this->generateTestgroupmembership($suiteName, $tests); foreach ($tests as $testName) { try { $relevantTests[$testName] = TestObjectHandler::getInstance()->getObject($testName); From adfdd7e26eeceb282623efe905003e45de2a9e67 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Tue, 16 May 2023 09:58:30 +0530 Subject: [PATCH 54/94] ACQE-4318 | Fix static checks --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index d3fccb0b6..18e4ef5ce 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -143,7 +143,7 @@ public function generateSuite($suiteName) /** * Function which generate Testgroupmembership file. * - * @param $testManifest + * @param object $testManifest * @return void * @throws \Exception */ @@ -168,7 +168,7 @@ public function generateTestgroupmembership($testManifest) $suites = $testManifest->getSuiteConfig(); foreach ($suites as $suite => $tests) { foreach ($tests as $key => $test) { - if(!is_numeric($key)) { + if (!is_numeric($key)) { foreach ($test as $testKey => $testName) { $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $testKey, $key, $testName); file_put_contents($memberShipFilePath, $suiteTest, FILE_APPEND); From ee2816577cc751ea9f42b2c73455fb8d96678668 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Tue, 16 May 2023 10:07:44 +0530 Subject: [PATCH 55/94] ACQE-4318 | Fix formatting of membership.txt file --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 18e4ef5ce..b87db092e 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -158,9 +158,8 @@ public function generateTestgroupmembership($testManifest) $suiteCount = 0; $testCount = 0; foreach ($defaultSuiteTests as $defaultSuiteTestName => $defaultTestValue) { - $defaultSuiteTestName = rtrim($defaultSuiteTestName, 'Cest'); - $defaultSuiteTest = sprintf('%s:%s:%s\n', $suiteCount, 0, $defaultSuiteTestName); - file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND); + $defaultSuiteTest = sprintf('%s:%s:%s', $suiteCount, $testCount, $defaultSuiteTestName); + file_put_contents($memberShipFilePath, $defaultSuiteTest.PHP_EOL, FILE_APPEND); $testCount++; } @@ -171,12 +170,12 @@ public function generateTestgroupmembership($testManifest) if (!is_numeric($key)) { foreach ($test as $testKey => $testName) { $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $testKey, $key, $testName); - file_put_contents($memberShipFilePath, $suiteTest, FILE_APPEND); + file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); $suiteCount++; } } else { $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $key, $suite, $test); - file_put_contents($memberShipFilePath, $suiteTest, FILE_APPEND); + file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); } } $suiteCount++; From 93630f304ffc431bd1c260a58e932d838a3c01e8 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Tue, 16 May 2023 10:55:01 +0530 Subject: [PATCH 56/94] ACQE-4318 | Fix verification test --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index b87db092e..0561a4714 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -150,6 +150,9 @@ public function generateSuite($suiteName) public function generateTestgroupmembership($testManifest) { $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; + if (!is_file($memberShipFilePath)) { + return; + } $testManifestArray = (array) $testManifest; $prefix = chr(0).'*'.chr(0); From 3731107b1875c3740e18fcf9f4baf402a4c970e5 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Tue, 16 May 2023 11:05:53 +0530 Subject: [PATCH 57/94] ACQE-4318 | Fix formatting of membership.txt file --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 0561a4714..cf2603d43 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -172,12 +172,12 @@ public function generateTestgroupmembership($testManifest) foreach ($tests as $key => $test) { if (!is_numeric($key)) { foreach ($test as $testKey => $testName) { - $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $testKey, $key, $testName); + $suiteTest = sprintf('%s:%s:%s:%s', $suiteCount, $testKey, $key, $testName); file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); $suiteCount++; } } else { - $suiteTest = sprintf('%s:%s:%s:%s\n', $suiteCount, $key, $suite, $test); + $suiteTest = sprintf('%s:%s:%s:%s', $suiteCount, $key, $suite, $test); file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); } } From b7c418658c277ccc53e540371377b33ef5d46dec Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Fri, 19 May 2023 09:45:26 +0530 Subject: [PATCH 58/94] Update SuiteGenerator.php --- .../FunctionalTestingFramework/Suite/SuiteGenerator.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index cf2603d43..f03bf6dbd 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -150,9 +150,7 @@ public function generateSuite($suiteName) public function generateTestgroupmembership($testManifest) { $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; - if (!is_file($memberShipFilePath)) { - return; - } + $testManifestArray = (array) $testManifest; $prefix = chr(0).'*'.chr(0); From fbd24f4d5f1e51db362c9b01022f12285fff4e25 Mon Sep 17 00:00:00 2001 From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com> Date: Mon, 22 May 2023 10:01:04 +0530 Subject: [PATCH 59/94] Update TestGenerator.php --- .../FunctionalTestingFramework/Util/TestGenerator.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 3474d12aa..a64d3137c 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -262,13 +262,11 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, st $actionGroupStart = false; foreach ($fileToArr as $fileVal) { $fileVal = trim($fileVal); - if ((str_starts_with($fileVal, '') - ) { + if (str_starts_with($fileVal, '')) { $actionGroupStart = true; continue; } - if ($fileVal === '' || $fileVal === '') { + if ($fileVal === '') { $argumentNameArray = []; foreach ($argumentArray as $argument) { $subtringStart = strpos($argument, 'name='); @@ -277,7 +275,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, st $argumentName = substr($argument, $subtringStart, $size); if (in_array($argumentName, $argumentNameArray)) { $err[] = sprintf( - 'Duplicate argument for actiongroup or helper with name: %s in test file: %s', + 'Duplicate argument for actiongroup with name: %s in test file: %s', $argumentName, $fileName ); From eed694b92b0831ea8e347ffd632aeb6a4549c698 Mon Sep 17 00:00:00 2001 From: Keerthana SL Date: Fri, 26 May 2023 10:11:46 +0530 Subject: [PATCH 60/94] [ACQE-4318] Testing generation of testgroupmembership file --- .../Suite/SuiteGenerator.php | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index f03bf6dbd..c59cb3eda 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -149,38 +149,40 @@ public function generateSuite($suiteName) */ public function generateTestgroupmembership($testManifest) { - $memberShipFilePath = FilePathFormatter::format(TESTS_MODULE_PATH).'_generated/testgroupmembership.txt'; - - - $testManifestArray = (array) $testManifest; - $prefix = chr(0).'*'.chr(0); - $defaultSuiteTests = $testManifestArray[$prefix.'testNameToSize']; - - $suiteCount = 0; - $testCount = 0; - foreach ($defaultSuiteTests as $defaultSuiteTestName => $defaultTestValue) { - $defaultSuiteTest = sprintf('%s:%s:%s', $suiteCount, $testCount, $defaultSuiteTestName); - file_put_contents($memberShipFilePath, $defaultSuiteTest.PHP_EOL, FILE_APPEND); - $testCount++; - } - - $suiteCount++; - $suites = $testManifest->getSuiteConfig(); - foreach ($suites as $suite => $tests) { - foreach ($tests as $key => $test) { - if (!is_numeric($key)) { - foreach ($test as $testKey => $testName) { - $suiteTest = sprintf('%s:%s:%s:%s', $suiteCount, $testKey, $key, $testName); - file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); - $suiteCount++; - } - } else { - $suiteTest = sprintf('%s:%s:%s:%s', $suiteCount, $key, $suite, $test); - file_put_contents($memberShipFilePath, $suiteTest.PHP_EOL, FILE_APPEND); - } + // Get suits and subsuites data array + $suites = $testManifest->getSuiteConfig(); + + // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later + if(!empty($suites)) { + foreach ($suites as $subSuites) { + if(!empty($subSuites)) { + foreach ($subSuites as $subSuiteName => $suiteTestNames) { + if (!is_numeric($subSuiteName)) { + $suites[$subSuiteName] = $suiteTestNames; + } else { + continue; + } } - $suiteCount++; + } } + } + + // Path to groups folder + $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH); + + // Read each file in the reverse order and form an array with groupId as key + $groupNumber = 0; + while(!empty($groupFiles)){ + $group = array_pop($groupFiles); + $allGroupsContent[$groupNumber] = file($group); + $groupNumber++; + } + + // Output file path + $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; + + file_put_contents($memberShipFilePath, "testing" . PHP_EOL, FILE_APPEND); + } /** From c951fca7d930cc41c61e2eed39d4e7c8d8c71f6e Mon Sep 17 00:00:00 2001 From: Keerthana SL Date: Fri, 26 May 2023 12:28:54 +0530 Subject: [PATCH 61/94] [ACQE-4318] Reading files under groups folder --- .../Suite/SuiteGenerator.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index c59cb3eda..4ab7984d0 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -169,6 +169,16 @@ public function generateTestgroupmembership($testManifest) // Path to groups folder $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH); + $path = $baseDir .'_generated/groups'; + + // Read all group files + if (is_dir($path)) { + $groupFiles = glob("$path/group*.txt"); + if ($groupFiles === false) { + throw new RuntimeException("glob(): error with '$path'"); + } + sort($groupFiles, SORT_NATURAL); + } // Read each file in the reverse order and form an array with groupId as key $groupNumber = 0; @@ -181,7 +191,7 @@ public function generateTestgroupmembership($testManifest) // Output file path $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; - file_put_contents($memberShipFilePath, "testing" . PHP_EOL, FILE_APPEND); + file_put_contents($memberShipFilePath, "testing again" . PHP_EOL, FILE_APPEND); } From 95a76c180693c8cb96d88f2bd4dac339a3edf56e Mon Sep 17 00:00:00 2001 From: Keerthana SL Date: Fri, 26 May 2023 14:06:42 +0530 Subject: [PATCH 62/94] [ACQE-4318] Adding test case names to testgroupmembership file --- .../Suite/SuiteGenerator.php | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 4ab7984d0..9d8ab2e6c 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -191,7 +191,32 @@ public function generateTestgroupmembership($testManifest) // Output file path $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; - file_put_contents($memberShipFilePath, "testing again" . PHP_EOL, FILE_APPEND); + $testCaseNumber = 0; + + if(!empty($allGroupsContent)) { + foreach ($allGroupsContent as $groupId => $groupInfo) { + foreach ($groupInfo as $testName) { + // If file has -g then it is test suite + if (str_contains($testName, '-g')) { + $suitename = explode(" ", $testName); + $suitename[1] = trim($suitename[1]); + if(!empty($suites[$suitename[1]])) { + foreach ($suites[$suitename[1]] as $key => $test) { + $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test); + file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND); + } + } + } + // It is default test group + else { + $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName); + file_put_contents($memberShipFilePath, $defaultSuiteTest . PHP_EOL, FILE_APPEND); + } + $testCaseNumber++; + } + $testCaseNumber = 0; + } + } } From 2c290c6f663d4a76c22ee45996eb37180b6e92b3 Mon Sep 17 00:00:00 2001 From: Keerthana SL Date: Fri, 26 May 2023 15:50:09 +0530 Subject: [PATCH 63/94] [ACQE-4318] Debugging the groupID generation --- .../Suite/SuiteGenerator.php | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 9d8ab2e6c..2db38a6ad 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -191,30 +191,12 @@ public function generateTestgroupmembership($testManifest) // Output file path $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; - $testCaseNumber = 0; if(!empty($allGroupsContent)) { foreach ($allGroupsContent as $groupId => $groupInfo) { foreach ($groupInfo as $testName) { - // If file has -g then it is test suite - if (str_contains($testName, '-g')) { - $suitename = explode(" ", $testName); - $suitename[1] = trim($suitename[1]); - if(!empty($suites[$suitename[1]])) { - foreach ($suites[$suitename[1]] as $key => $test) { - $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test); - file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND); - } - } - } - // It is default test group - else { - $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName); - file_put_contents($memberShipFilePath, $defaultSuiteTest . PHP_EOL, FILE_APPEND); - } - $testCaseNumber++; + file_put_contents($memberShipFilePath, $testName . PHP_EOL, FILE_APPEND); } - $testCaseNumber = 0; } } From 7a709b607a756300046e10e06ef01796b98481db Mon Sep 17 00:00:00 2001 From: Keerthana SL Date: Fri, 26 May 2023 18:00:48 +0530 Subject: [PATCH 64/94] [ACQE-4318] Debugging the groupID generation --- .../Suite/SuiteGenerator.php | 96 +++++++++++-------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php index 2db38a6ad..0e35b7718 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php @@ -149,58 +149,76 @@ public function generateSuite($suiteName) */ public function generateTestgroupmembership($testManifest) { - // Get suits and subsuites data array - $suites = $testManifest->getSuiteConfig(); - - // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later - if(!empty($suites)) { - foreach ($suites as $subSuites) { - if(!empty($subSuites)) { - foreach ($subSuites as $subSuiteName => $suiteTestNames) { - if (!is_numeric($subSuiteName)) { - $suites[$subSuiteName] = $suiteTestNames; - } else { - continue; - } + // Get suits and subsuites data array + $suites = $testManifest->getSuiteConfig(); + + // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later + if(!empty($suites)) { + foreach ($suites as $subSuites) { + if(!empty($subSuites)) { + foreach ($subSuites as $subSuiteName => $suiteTestNames) { + if (!is_numeric($subSuiteName)) { + $suites[$subSuiteName] = $suiteTestNames; + } else { + continue; } } } } + } - // Path to groups folder - $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH); - $path = $baseDir .'_generated/groups'; + // Path to groups folder + $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH); + $path = $baseDir .'_generated/groups'; - // Read all group files - if (is_dir($path)) { - $groupFiles = glob("$path/group*.txt"); - if ($groupFiles === false) { - throw new RuntimeException("glob(): error with '$path'"); - } - sort($groupFiles, SORT_NATURAL); + // Read all group files + if (is_dir($path)) { + $groupFiles = glob("$path/group*.txt"); + if ($groupFiles === false) { + throw new RuntimeException("glob(): error with '$path'"); } + sort($groupFiles, SORT_NATURAL); + } - // Read each file in the reverse order and form an array with groupId as key - $groupNumber = 0; - while(!empty($groupFiles)){ - $group = array_pop($groupFiles); - $allGroupsContent[$groupNumber] = file($group); - $groupNumber++; - } - - // Output file path - $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; - + // Read each file in the reverse order and form an array with groupId as key + $groupNumber = 0; + $allGroupsContent = array(); + while(!empty($groupFiles)){ + $group = array_pop($groupFiles); + $allGroupsContent[$groupNumber] = file($group); + $groupNumber++; + } - if(!empty($allGroupsContent)) { - foreach ($allGroupsContent as $groupId => $groupInfo) { - foreach ($groupInfo as $testName) { - file_put_contents($memberShipFilePath, $testName . PHP_EOL, FILE_APPEND); + // Output file path + $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt'; + $testCaseNumber = 0; +echo "groups array->
";
+print_r($allGroupsContent);
+    if(!empty($allGroupsContent)) {
+      foreach ($allGroupsContent as $groupId => $groupInfo) {
+        foreach ($groupInfo as $testName) {
+          // If file has -g then it is test suite
+          if (str_contains($testName, '-g')) {
+            $suitename = explode(" ", $testName);
+            $suitename[1] = trim($suitename[1]);
+            if(!empty($suites[$suitename[1]])) {
+              foreach ($suites[$suitename[1]] as $key => $test) {
+                $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
+                file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+              }
+            }
+          }
+          // It is default test group
+          else {
+            $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
+            file_put_contents($memberShipFilePath, $defaultSuiteTest . PHP_EOL, FILE_APPEND);
           }
+          $testCaseNumber++;
         }
+        $testCaseNumber = 0;
       }
-
     }
+  }
 
     /**
      * Function which takes a suite name and a set of test names. The function then generates all relevant supporting

From 8a69ad9e2c3c811b2b0ac79b811fa8725b44fc9d Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 27 May 2023 10:50:04 +0530
Subject: [PATCH 65/94] [ACQE-4318] Generating testgroupmembership after groups
 generation

---
 src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 0e35b7718..f419f00d8 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -95,7 +95,6 @@ public static function getInstance(): SuiteGenerator
      */
     public function generateAllSuites($testManifest)
     {
-        $this->generateTestgroupmembership($testManifest);
         $suites = $testManifest->getSuiteConfig();
 
         foreach ($suites as $suiteName => $suiteContent) {
@@ -118,6 +117,7 @@ public function generateAllSuites($testManifest)
                 // if our first element is an array we know that we have split the suites
                 if (is_array($firstElement)) {
                     $this->generateSplitSuiteFromTest($suiteName, $suiteContent);
+                  $this->generateTestgroupmembership($testManifest);
                 }
             } catch (FastFailException $e) {
                 throw $e;

From 1f9cd2a241b6f33ab0eb46ea02b869eaec2984a0 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Mon, 29 May 2023 14:54:37 +0530
Subject: [PATCH 66/94] [ACQE-4318] Debug testgroupsmembership generation

---
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php        | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index f419f00d8..637cf2eef 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -174,6 +174,8 @@ public function generateTestgroupmembership($testManifest)
     // Read all group files
     if (is_dir($path)) {
       $groupFiles = glob("$path/group*.txt");
+      echo "Group files-> \n";
+      print_r($groupFiles); 
       if ($groupFiles === false) {
         throw new RuntimeException("glob(): error with '$path'");
       }
@@ -184,6 +186,7 @@ public function generateTestgroupmembership($testManifest)
     $groupNumber = 0;
     $allGroupsContent = array();
     while(!empty($groupFiles)){
+      echo "Group files not empty";
       $group = array_pop($groupFiles);
       $allGroupsContent[$groupNumber] = file($group);
       $groupNumber++;

From 6e2dc63429befcc76c1780a79f47bfd8427ee2c7 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Thu, 1 Jun 2023 11:27:50 +0530
Subject: [PATCH 67/94] [ACQE-4318] Debugging testgroupmembership file
 generation

---
 .../Console/GenerateTestsCommand.php                          | 4 ++--
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php b/src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php
index ee4f211cf..05e286c88 100644
--- a/src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php
+++ b/src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php
@@ -231,9 +231,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
                 $testManifest->createTestGroups($configNumber);
             }
 
-            SuiteGenerator::getInstance()->generateAllSuites($testManifest);
-
             $testManifest->generate();
+
+            SuiteGenerator::getInstance()->generateAllSuites($testManifest);
         } catch (\Exception $e) {
             if (!empty(GenerationErrorHandler::getInstance()->getAllErrors())) {
                 GenerationErrorHandler::getInstance()->printErrorSummary();
diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 637cf2eef..392f1a04e 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -175,7 +175,7 @@ public function generateTestgroupmembership($testManifest)
     if (is_dir($path)) {
       $groupFiles = glob("$path/group*.txt");
       echo "Group files-> \n";
-      print_r($groupFiles); 
+      print_r($groupFiles);
       if ($groupFiles === false) {
         throw new RuntimeException("glob(): error with '$path'");
       }

From 6010fa7e0ccddc0e4f9e18da057571e996d69332 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Thu, 1 Jun 2023 14:29:27 +0530
Subject: [PATCH 68/94] [ACQE-4318] Debugging testgroupmembership file
 generation

---
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 392f1a04e..8ac052bd3 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -95,6 +95,7 @@ public static function getInstance(): SuiteGenerator
      */
     public function generateAllSuites($testManifest)
     {
+        $this->generateTestgroupmembership($testManifest);
         $suites = $testManifest->getSuiteConfig();
 
         foreach ($suites as $suiteName => $suiteContent) {
@@ -117,7 +118,7 @@ public function generateAllSuites($testManifest)
                 // if our first element is an array we know that we have split the suites
                 if (is_array($firstElement)) {
                     $this->generateSplitSuiteFromTest($suiteName, $suiteContent);
-                  $this->generateTestgroupmembership($testManifest);
+
                 }
             } catch (FastFailException $e) {
                 throw $e;
@@ -151,7 +152,8 @@ public function generateTestgroupmembership($testManifest)
     {
     // Get suits and subsuites data array
     $suites = $testManifest->getSuiteConfig();
-
+echo "suites-> 
";
+print_r($suites);
     // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
     if(!empty($suites)) {
       foreach ($suites as $subSuites) {
@@ -186,7 +188,6 @@ public function generateTestgroupmembership($testManifest)
     $groupNumber = 0;
     $allGroupsContent = array();
     while(!empty($groupFiles)){
-      echo "Group files not empty";
       $group = array_pop($groupFiles);
       $allGroupsContent[$groupNumber] = file($group);
       $groupNumber++;
@@ -202,8 +203,10 @@ public function generateTestgroupmembership($testManifest)
         foreach ($groupInfo as $testName) {
           // If file has -g then it is test suite
           if (str_contains($testName, '-g')) {
+            echo "testname-> $testName \n";
             $suitename = explode(" ", $testName);
             $suitename[1] = trim($suitename[1]);
+            echo "$suitename-> $suitename[1] \n";
             if(!empty($suites[$suitename[1]])) {
               foreach ($suites[$suitename[1]] as $key => $test) {
                 $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);

From efda9af1a6fa69694e6e59f2d19c5b8fc00fc238 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Fri, 2 Jun 2023 09:09:48 +0530
Subject: [PATCH 69/94] [ACQE-4318] Removing the extra EOL

---
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 8ac052bd3..c4a47aedc 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -196,8 +196,7 @@ public function generateTestgroupmembership($testManifest)
     // Output file path
     $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
     $testCaseNumber = 0;
-echo "groups array->
";
-print_r($allGroupsContent);
+
     if(!empty($allGroupsContent)) {
       foreach ($allGroupsContent as $groupId => $groupInfo) {
         foreach ($groupInfo as $testName) {
@@ -217,7 +216,7 @@ public function generateTestgroupmembership($testManifest)
           // It is default test group
           else {
             $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
-            file_put_contents($memberShipFilePath, $defaultSuiteTest . PHP_EOL, FILE_APPEND);
+            file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
           }
           $testCaseNumber++;
         }

From 1c75e9ba91b01447e3cbcaca3ceca08ba04c4c01 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 12:59:28 +0530
Subject: [PATCH 70/94] [ACQE-4318] Removing echo and prints

---
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php   | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index c4a47aedc..d4b8e74f7 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -152,8 +152,7 @@ public function generateTestgroupmembership($testManifest)
     {
     // Get suits and subsuites data array
     $suites = $testManifest->getSuiteConfig();
-echo "suites-> 
";
-print_r($suites);
+
     // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
     if(!empty($suites)) {
       foreach ($suites as $subSuites) {
@@ -176,8 +175,6 @@ public function generateTestgroupmembership($testManifest)
     // Read all group files
     if (is_dir($path)) {
       $groupFiles = glob("$path/group*.txt");
-      echo "Group files-> \n";
-      print_r($groupFiles);
       if ($groupFiles === false) {
         throw new RuntimeException("glob(): error with '$path'");
       }
@@ -202,10 +199,9 @@ public function generateTestgroupmembership($testManifest)
         foreach ($groupInfo as $testName) {
           // If file has -g then it is test suite
           if (str_contains($testName, '-g')) {
-            echo "testname-> $testName \n";
             $suitename = explode(" ", $testName);
             $suitename[1] = trim($suitename[1]);
-            echo "$suitename-> $suitename[1] \n";
+
             if(!empty($suites[$suitename[1]])) {
               foreach ($suites[$suitename[1]] as $key => $test) {
                 $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);

From 4c1c6bd4cac1158371a4c9080314e6c9ad1d5019 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 20:25:46 +0530
Subject: [PATCH 71/94] [ACQE-4318] Fixing static errors

---
 .../Suite/SuiteGenerator.php                  | 110 +++++++++---------
 1 file changed, 54 insertions(+), 56 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index d4b8e74f7..5b9197d4c 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -118,7 +118,6 @@ public function generateAllSuites($testManifest)
                 // if our first element is an array we know that we have split the suites
                 if (is_array($firstElement)) {
                     $this->generateSplitSuiteFromTest($suiteName, $suiteContent);
-
                 }
             } catch (FastFailException $e) {
                 throw $e;
@@ -150,76 +149,75 @@ public function generateSuite($suiteName)
      */
     public function generateTestgroupmembership($testManifest)
     {
-    // Get suits and subsuites data array
-    $suites = $testManifest->getSuiteConfig();
-
-    // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
-    if(!empty($suites)) {
-      foreach ($suites as $subSuites) {
-        if(!empty($subSuites)) {
-          foreach ($subSuites as $subSuiteName => $suiteTestNames) {
-            if (!is_numeric($subSuiteName)) {
-              $suites[$subSuiteName] = $suiteTestNames;
-            } else {
-              continue;
+      // Get suits and subsuites data array
+      $suites = $testManifest->getSuiteConfig();
+
+      // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
+      if (!empty($suites)) {
+        foreach ($suites as $subSuites) {
+          if (!empty($subSuites)) {
+            foreach ($subSuites as $subSuiteName => $suiteTestNames) {
+              if (!is_numeric($subSuiteName)) {
+                $suites[$subSuiteName] = $suiteTestNames;
+              } else {
+                continue;
+              }
             }
           }
         }
       }
-    }
 
-    // Path to groups folder
-    $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
-    $path = $baseDir .'_generated/groups';
+      // Path to groups folder
+      $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
+      $path = $baseDir .'_generated/groups';
 
-    // Read all group files
-    if (is_dir($path)) {
-      $groupFiles = glob("$path/group*.txt");
-      if ($groupFiles === false) {
-        throw new RuntimeException("glob(): error with '$path'");
+      // Read all group files
+      if (is_dir($path)) {
+        $groupFiles = glob("$path/group*.txt");
+        if ($groupFiles === false) {
+          throw new RuntimeException("glob(): error with '$path'");
+        }
+        sort($groupFiles, SORT_NATURAL);
       }
-      sort($groupFiles, SORT_NATURAL);
-    }
 
-    // Read each file in the reverse order and form an array with groupId as key
-    $groupNumber = 0;
-    $allGroupsContent = array();
-    while(!empty($groupFiles)){
-      $group = array_pop($groupFiles);
-      $allGroupsContent[$groupNumber] = file($group);
-      $groupNumber++;
-    }
+      // Read each file in the reverse order and form an array with groupId as key
+      $groupNumber = 0;
+      $allGroupsContent = [];
+      while (!empty($groupFiles)) {
+        $group = array_pop($groupFiles);
+        $allGroupsContent[$groupNumber] = file($group);
+        $groupNumber++;
+      }
 
-    // Output file path
-    $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
-    $testCaseNumber = 0;
-
-    if(!empty($allGroupsContent)) {
-      foreach ($allGroupsContent as $groupId => $groupInfo) {
-        foreach ($groupInfo as $testName) {
-          // If file has -g then it is test suite
-          if (str_contains($testName, '-g')) {
-            $suitename = explode(" ", $testName);
-            $suitename[1] = trim($suitename[1]);
-
-            if(!empty($suites[$suitename[1]])) {
-              foreach ($suites[$suitename[1]] as $key => $test) {
-                $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
-                file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+      // Output file path
+      $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
+      $testCaseNumber = 0;
+
+      if (!empty($allGroupsContent)) {
+        foreach ($allGroupsContent as $groupId => $groupInfo) {
+          foreach ($groupInfo as $testName) {
+            // If file has -g then it is test suite
+            if (str_contains($testName, '-g')) {
+              $suitename = explode(" ", $testName);
+              $suitename[1] = trim($suitename[1]);
+
+              if (!empty($suites[$suitename[1]])) {
+                foreach ($suites[$suitename[1]] as $key => $test) {
+                  $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
+                  file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+                }
               }
             }
+            else {
+              $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
+              file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
+            }
+            $testCaseNumber++;
           }
-          // It is default test group
-          else {
-            $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
-            file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
-          }
-          $testCaseNumber++;
+          $testCaseNumber = 0;
         }
-        $testCaseNumber = 0;
       }
     }
-  }
 
     /**
      * Function which takes a suite name and a set of test names. The function then generates all relevant supporting

From b834629b65f62695f356d8107305984e48fd7407 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 20:35:21 +0530
Subject: [PATCH 72/94] [ACQE-4318] Fixing indentation errors

---
 .../Suite/SuiteGenerator.php                  | 120 +++++++++---------
 1 file changed, 60 insertions(+), 60 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 5b9197d4c..edad03e72 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -149,74 +149,74 @@ public function generateSuite($suiteName)
      */
     public function generateTestgroupmembership($testManifest)
     {
-      // Get suits and subsuites data array
-      $suites = $testManifest->getSuiteConfig();
-
-      // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
-      if (!empty($suites)) {
-        foreach ($suites as $subSuites) {
-          if (!empty($subSuites)) {
-            foreach ($subSuites as $subSuiteName => $suiteTestNames) {
-              if (!is_numeric($subSuiteName)) {
-                $suites[$subSuiteName] = $suiteTestNames;
-              } else {
-                continue;
-              }
+        // Get suits and subsuites data array
+        $suites = $testManifest->getSuiteConfig();
+
+        // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
+        if (!empty($suites)) {
+            foreach ($suites as $subSuites) {
+                if (!empty($subSuites)) {
+                    foreach ($subSuites as $subSuiteName => $suiteTestNames) {
+                        if (!is_numeric($subSuiteName)) {
+                            $suites[$subSuiteName] = $suiteTestNames;
+                        } else {
+                            continue;
+                        }
+                    }
+                }
             }
-          }
         }
-      }
 
-      // Path to groups folder
-      $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
-      $path = $baseDir .'_generated/groups';
+        // Path to groups folder
+        $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
+        $path = $baseDir .'_generated/groups';
+
+        // Read all group files
+        if (is_dir($path)) {
+            $groupFiles = glob("$path/group*.txt");
+            if ($groupFiles === false) {
+                throw new RuntimeException("glob(): error with '$path'");
+            }
+            sort($groupFiles, SORT_NATURAL);
+        }
 
-      // Read all group files
-      if (is_dir($path)) {
-        $groupFiles = glob("$path/group*.txt");
-        if ($groupFiles === false) {
-          throw new RuntimeException("glob(): error with '$path'");
+        // Read each file in the reverse order and form an array with groupId as key
+        $groupNumber = 0;
+        $allGroupsContent = [];
+        while (!empty($groupFiles)) {
+            $group = array_pop($groupFiles);
+            $allGroupsContent[$groupNumber] = file($group);
+            $groupNumber++;
         }
-        sort($groupFiles, SORT_NATURAL);
-      }
-
-      // Read each file in the reverse order and form an array with groupId as key
-      $groupNumber = 0;
-      $allGroupsContent = [];
-      while (!empty($groupFiles)) {
-        $group = array_pop($groupFiles);
-        $allGroupsContent[$groupNumber] = file($group);
-        $groupNumber++;
-      }
-
-      // Output file path
-      $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
-      $testCaseNumber = 0;
-
-      if (!empty($allGroupsContent)) {
-        foreach ($allGroupsContent as $groupId => $groupInfo) {
-          foreach ($groupInfo as $testName) {
-            // If file has -g then it is test suite
-            if (str_contains($testName, '-g')) {
-              $suitename = explode(" ", $testName);
-              $suitename[1] = trim($suitename[1]);
-
-              if (!empty($suites[$suitename[1]])) {
-                foreach ($suites[$suitename[1]] as $key => $test) {
-                  $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
-                  file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+
+        // Output file path
+        $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
+        $testCaseNumber = 0;
+
+        if (!empty($allGroupsContent)) {
+            foreach ($allGroupsContent as $groupId => $groupInfo) {
+                foreach ($groupInfo as $testName) {
+                // If file has -g then it is test suite
+                if (str_contains($testName, '-g')) {
+                    $suitename = explode(" ", $testName);
+                    $suitename[1] = trim($suitename[1]);
+
+                    if (!empty($suites[$suitename[1]])) {
+                        foreach ($suites[$suitename[1]] as $key => $test) {
+                        $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
+                        file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+                        }
+                    }
                 }
-              }
-            }
-            else {
-              $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
-              file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
+                else {
+                    $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
+                    file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
+                }
+                $testCaseNumber++;
+                }
+                $testCaseNumber = 0;
             }
-            $testCaseNumber++;
-          }
-          $testCaseNumber = 0;
         }
-      }
     }
 
     /**

From 629ac1b147117858bf2e5663c8b0ec3811cf1730 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 20:37:49 +0530
Subject: [PATCH 73/94] [ACQE-4318] Fixing indentation errors

---
 .../Suite/SuiteGenerator.php                  | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index edad03e72..202662061 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -196,23 +196,23 @@ public function generateTestgroupmembership($testManifest)
         if (!empty($allGroupsContent)) {
             foreach ($allGroupsContent as $groupId => $groupInfo) {
                 foreach ($groupInfo as $testName) {
-                // If file has -g then it is test suite
-                if (str_contains($testName, '-g')) {
-                    $suitename = explode(" ", $testName);
-                    $suitename[1] = trim($suitename[1]);
-
-                    if (!empty($suites[$suitename[1]])) {
-                        foreach ($suites[$suitename[1]] as $key => $test) {
-                        $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
-                        file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+                    // If file has -g then it is test suite
+                    if (str_contains($testName, '-g')) {
+                        $suitename = explode(" ", $testName);
+                        $suitename[1] = trim($suitename[1]);
+
+                        if (!empty($suites[$suitename[1]])) {
+                            foreach ($suites[$suitename[1]] as $key => $test) {
+                            $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
+                            file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+                            }
                         }
                     }
-                }
-                else {
-                    $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
-                    file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
-                }
-                $testCaseNumber++;
+                    else {
+                        $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
+                        file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
+                    }
+                    $testCaseNumber++;
                 }
                 $testCaseNumber = 0;
             }

From 795d08bdbc0ceefd719c68191a1a1cfbbc5e1440 Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 20:40:46 +0530
Subject: [PATCH 74/94] [ACQE-4318] Fixing indentation errors

---
 .../FunctionalTestingFramework/Suite/SuiteGenerator.php    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 202662061..da98930ff 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -203,12 +203,11 @@ public function generateTestgroupmembership($testManifest)
 
                         if (!empty($suites[$suitename[1]])) {
                             foreach ($suites[$suitename[1]] as $key => $test) {
-                            $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
-                            file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
+                                $suiteTest = sprintf('%s:%s:%s:%s', $groupId, $key, $suitename[1], $test);
+                                file_put_contents($memberShipFilePath, $suiteTest . PHP_EOL, FILE_APPEND);
                             }
                         }
-                    }
-                    else {
+                    } else {
                         $defaultSuiteTest = sprintf('%s:%s:%s', $groupId, $testCaseNumber, $testName);
                         file_put_contents($memberShipFilePath, $defaultSuiteTest, FILE_APPEND);
                     }

From 0b2cea48fe0d27c5251d7bf0d4d9f8f41fa7facb Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 21:27:14 +0530
Subject: [PATCH 75/94] [ACQE-4318] Optimizing the code

---
 .../Suite/SuiteGenerator.php                  | 93 ++++++++++++-------
 1 file changed, 58 insertions(+), 35 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index da98930ff..1d93e62d0 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -147,47 +147,15 @@ public function generateSuite($suiteName)
      * @return void
      * @throws \Exception
      */
-    public function generateTestgroupmembership($testManifest)
+    public function generateTestgroupmembership($testManifest): void
     {
-        // Get suits and subsuites data array
-        $suites = $testManifest->getSuiteConfig();
-
-        // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
-        if (!empty($suites)) {
-            foreach ($suites as $subSuites) {
-                if (!empty($subSuites)) {
-                    foreach ($subSuites as $subSuiteName => $suiteTestNames) {
-                        if (!is_numeric($subSuiteName)) {
-                            $suites[$subSuiteName] = $suiteTestNames;
-                        } else {
-                            continue;
-                        }
-                    }
-                }
-            }
-        }
+        $suites = $this->getSuitesDetails($testManifest);
 
         // Path to groups folder
         $baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
         $path = $baseDir .'_generated/groups';
 
-        // Read all group files
-        if (is_dir($path)) {
-            $groupFiles = glob("$path/group*.txt");
-            if ($groupFiles === false) {
-                throw new RuntimeException("glob(): error with '$path'");
-            }
-            sort($groupFiles, SORT_NATURAL);
-        }
-
-        // Read each file in the reverse order and form an array with groupId as key
-        $groupNumber = 0;
-        $allGroupsContent = [];
-        while (!empty($groupFiles)) {
-            $group = array_pop($groupFiles);
-            $allGroupsContent[$groupNumber] = file($group);
-            $groupNumber++;
-        }
+        $allGroupsContent = $this->readAllGroupFiles($path);
 
         // Output file path
         $memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
@@ -218,6 +186,61 @@ public function generateTestgroupmembership($testManifest)
         }
     }
 
+    /**
+     * Function to format suites details
+     *
+     * @param object $testManifest
+     * @return array $suites
+     */
+    private function getSuitesDetails($testManifest): array
+    {
+        // Get suits and subsuites data array
+        $suites = $testManifest->getSuiteConfig();
+
+        // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
+        if (!empty($suites)) {
+          foreach ($suites as $subSuites) {
+            if (!empty($subSuites)) {
+              foreach ($subSuites as $subSuiteName => $suiteTestNames) {
+                if (!is_numeric($subSuiteName)) {
+                  $suites[$subSuiteName] = $suiteTestNames;
+                } else {
+                  continue;
+                }
+              }
+            }
+          }
+        }
+        return $suites;
+    }
+
+  /**
+   * Function to read all group* text files inside /groups folder
+   *
+   * @param object $path
+   * @return array $allGroupsContent
+   */
+    private function readAllGroupFiles($path): array
+    {
+        // Read all group files
+        if (is_dir($path)) {
+          $groupFiles = glob("$path/group*.txt");
+          if ($groupFiles === false) {
+            throw new RuntimeException("glob(): error with '$path'");
+          }
+          sort($groupFiles, SORT_NATURAL);
+        }
+
+        // Read each file in the reverse order and form an array with groupId as key
+        $groupNumber = 0;
+        $allGroupsContent = [];
+        while (!empty($groupFiles)) {
+          $group = array_pop($groupFiles);
+          $allGroupsContent[$groupNumber] = file($group);
+          $groupNumber++;
+        }
+        return $allGroupsContent;
+    }
     /**
      * Function which takes a suite name and a set of test names. The function then generates all relevant supporting
      * files and classes for the suite. The function takes an optional argument for suites which are split by a parallel

From 90ec67aeb93dd5ae44e3052a213269f31b77fabc Mon Sep 17 00:00:00 2001
From: Keerthana SL 
Date: Sat, 3 Jun 2023 23:05:01 +0530
Subject: [PATCH 76/94] [ACQE-4318] Fixing indentation errors

---
 .../Suite/SuiteGenerator.php                  | 35 ++++++++++---------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
index 1d93e62d0..0fda94e82 100644
--- a/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
@@ -199,17 +199,17 @@ private function getSuitesDetails($testManifest): array
 
         // Add subsuites array[2nd dimension] to main array[1st dimension] to access it directly later
         if (!empty($suites)) {
-          foreach ($suites as $subSuites) {
-            if (!empty($subSuites)) {
-              foreach ($subSuites as $subSuiteName => $suiteTestNames) {
-                if (!is_numeric($subSuiteName)) {
-                  $suites[$subSuiteName] = $suiteTestNames;
-                } else {
-                  continue;
+            foreach ($suites as $subSuites) {
+                if (!empty($subSuites)) {
+                    foreach ($subSuites as $subSuiteName => $suiteTestNames) {
+                        if (!is_numeric($subSuiteName)) {
+                            $suites[$subSuiteName] = $suiteTestNames;
+                        } else {
+                            continue;
+                        }
+                    }
                 }
-              }
             }
-          }
         }
         return $suites;
     }
@@ -224,23 +224,24 @@ private function readAllGroupFiles($path): array
     {
         // Read all group files
         if (is_dir($path)) {
-          $groupFiles = glob("$path/group*.txt");
-          if ($groupFiles === false) {
-            throw new RuntimeException("glob(): error with '$path'");
-          }
-          sort($groupFiles, SORT_NATURAL);
+            $groupFiles = glob("$path/group*.txt");
+            if ($groupFiles === false) {
+                throw new RuntimeException("glob(): error with '$path'");
+            }
+            sort($groupFiles, SORT_NATURAL);
         }
 
         // Read each file in the reverse order and form an array with groupId as key
         $groupNumber = 0;
         $allGroupsContent = [];
         while (!empty($groupFiles)) {
-          $group = array_pop($groupFiles);
-          $allGroupsContent[$groupNumber] = file($group);
-          $groupNumber++;
+            $group = array_pop($groupFiles);
+            $allGroupsContent[$groupNumber] = file($group);
+            $groupNumber++;
         }
         return $allGroupsContent;
     }
+    
     /**
      * Function which takes a suite name and a set of test names. The function then generates all relevant supporting
      * files and classes for the suite. The function takes an optional argument for suites which are split by a parallel

From ca63d9f41762c7a39562683664b49608080dc984 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 07:48:18 +0530
Subject: [PATCH 77/94] Update TestGeneratorTest.php

---
 .../Magento/FunctionalTestFramework/Util/TestGeneratorTest.php  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
index 9808c516b..490548f6c 100644
--- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
+++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
@@ -347,7 +347,7 @@ public function testIfExceptionThrownWhenDuplicateArgumentsFound()
         );
         $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]);
         $this->expectException(TestFrameworkException::class);
-        $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents);
+        $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents, $test1);
     }
 
     /**

From 81e328a547a7a08f2a4f570a3978e66bdb1f549e Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:00:57 +0530
Subject: [PATCH 78/94] Update TestGenerator.php

---
 .../Util/TestGenerator.php                    | 80 ++++++++++++-------
 1 file changed, 50 insertions(+), 30 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index a64d3137c..3d5afb871 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -247,48 +247,68 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
             $this->createCestFile($testPhpFile[1], $testPhpFile[0]);
         }
     }
+    
     /**
      * Throw exception if duplicate arguments found
      *
      * @param string $fileContents
-     * @param string $fileName
+     * @param TestObject $testObject
      * @return void
      * @throws TestFrameworkException
      */
-    public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, string $fileName = ''): void
+    public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, TestObject $testObject): void
     {
-        $fileToArr = explode("\n", $fileContents);
-        $argumentArray = [];
-        $actionGroupStart = false;
-        foreach ($fileToArr as $fileVal) {
-            $fileVal = trim($fileVal);
-            if (str_starts_with($fileVal, '')) {
-                $actionGroupStart = true;
+        $parsedSteps = $testObject->getUnresolvedSteps();
+        foreach ($parsedSteps as $parsedStep) {
+            if(
+                $parsedStep->getType() !== 'actionGroup' &&
+                $parsedStep->getType() !== 'helper'
+            ) {
                 continue;
             }
-            if ($fileVal === '') {
-                $argumentNameArray = [];
-                foreach ($argumentArray as $argument) {
-                    $subtringStart = strpos($argument, 'name=');
-                    $subtringStart += strlen('name=');
-                    $size = strpos($argument, ' ', $subtringStart) - $subtringStart;
-                    $argumentName = substr($argument, $subtringStart, $size);
-                    if (in_array($argumentName, $argumentNameArray)) {
-                        $err[] = sprintf(
-                            'Duplicate argument for actiongroup with name: %s in test file: %s',
-                            $argumentName,
-                            $fileName
-                        );
-                        throw new TestFrameworkException(implode(PHP_EOL, $err));
-                    }
-                    $argumentNameArray[] = $argumentName;
-                }
-                $argumentArray = [];
-                $actionGroupStart = false;
+            $attributesActions = $parsedStep->getCustomActionAttributes();
+            if (!key_exists('arguments', $attributesActions)) {
                 continue;
             }
-            if ($actionGroupStart) {
-                $argumentArray[] = $fileVal;
+            $arguments = $attributesActions['arguments'];
+            $stepKey = $parsedStep->getStepKey();
+
+            $fileToArr = explode("\n", $fileContents);
+            $actionGroupStart = false;
+            $argumentArray = [];
+            foreach ($fileToArr as $fileVal) {
+                $fileVal = trim($fileVal);
+                if (
+                    (str_contains($fileVal, ' $argumentValue) {
+                        $argumentCounter = 0;
+                        foreach ($argumentArray as $rawArgument) {
+                            if (str_contains($rawArgument, ' 1) {
+                                $err[] = sprintf(
+                                    'Duplicate argument(%s) for stepKey: %s in test file: %s',
+                                    $argumentName,
+                                    $stepKey,
+                                    $testObject->getFileName()
+                                );
+                                throw new TestFrameworkException(implode(PHP_EOL, $err));
+                            }
+                        }
+                        $actionGroupStart = false;
+                        $argumentArray = [];
+                    }
+                }
+                if ($actionGroupStart) {
+                    $argumentArray[] = $fileVal;
+                }
             }
         }
     }

From 715fb205ec58f29c78d3c89eb015efb8b2bcd0ad Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:03:56 +0530
Subject: [PATCH 79/94] Update TestGeneratorTest.php

---
 .../Magento/FunctionalTestFramework/Util/TestGeneratorTest.php  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
index 490548f6c..26306df74 100644
--- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
+++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
@@ -394,7 +394,7 @@ public function testIfExceptionNotThrownWhenDuplicateArgumentsNotFound()
             'filename'
         );
         $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]);
-        $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents);
+        $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents, $test1);
         $this->assertEquals($result, "");
     }
 

From eb5695816e1c2aa031a193a7f46ca428603e72ac Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:05:21 +0530
Subject: [PATCH 80/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 3d5afb871..13848dfa8 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -250,7 +250,6 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
     
     /**
      * Throw exception if duplicate arguments found
-     *
      * @param string $fileContents
      * @param TestObject $testObject
      * @return void

From 0187d4b10669c343e623563333b7130b049b87b5 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:08:01 +0530
Subject: [PATCH 81/94] Update TestGenerator.php

---
 .../Util/TestGenerator.php                           | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 13848dfa8..6a70eeca7 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -259,10 +259,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, Te
     {
         $parsedSteps = $testObject->getUnresolvedSteps();
         foreach ($parsedSteps as $parsedStep) {
-            if(
-                $parsedStep->getType() !== 'actionGroup' &&
-                $parsedStep->getType() !== 'helper'
-            ) {
+            if ($parsedStep->getType() !== 'actionGroup' && $parsedStep->getType() !== 'helper') {
                 continue;
             }
             $attributesActions = $parsedStep->getCustomActionAttributes();
@@ -277,10 +274,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, Te
             $argumentArray = [];
             foreach ($fileToArr as $fileVal) {
                 $fileVal = trim($fileVal);
-                if (
-                    (str_contains($fileVal, ' $argumentValue) {
                         $argumentCounter = 0;
                         foreach ($argumentArray as $rawArgument) {
-                            if (str_contains($rawArgument, ' 1) {

From d44fdaaf7185753c754562f9a7f518d961a32fd5 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:12:06 +0530
Subject: [PATCH 82/94] Update TestGenerator.php

---
 .../FunctionalTestingFramework/Util/TestGenerator.php        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 6a70eeca7..b1f532d0f 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -250,7 +250,7 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
     
     /**
      * Throw exception if duplicate arguments found
-     * @param string $fileContents
+     * @param string     $fileContents
      * @param TestObject $testObject
      * @return void
      * @throws TestFrameworkException
@@ -274,7 +274,8 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, Te
             $argumentArray = [];
             foreach ($fileToArr as $fileVal) {
                 $fileVal = trim($fileVal);
-                if ((str_contains($fileVal, '
Date: Mon, 12 Jun 2023 08:13:40 +0530
Subject: [PATCH 83/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index b1f532d0f..2ae5f4446 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -274,7 +274,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, Te
             $argumentArray = [];
             foreach ($fileToArr as $fileVal) {
                 $fileVal = trim($fileVal);
-                if ((str_contains($fileVal, '
Date: Mon, 12 Jun 2023 08:18:08 +0530
Subject: [PATCH 84/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 2ae5f4446..ff7b08a60 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -255,7 +255,7 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
      * @return void
      * @throws TestFrameworkException
      */
-    public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, TestObject $testObject): void
+    public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, $testObject): void
     {
         $parsedSteps = $testObject->getUnresolvedSteps();
         foreach ($parsedSteps as $parsedStep) {

From f3a196afe3a08115504863b824d14b0f5358a408 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:23:12 +0530
Subject: [PATCH 85/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index ff7b08a60..ee4145714 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -257,6 +257,9 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
      */
     public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, $testObject): void
     {
+        if (!($testObject instanceof TestObject)) {
+            return;
+        }
         $parsedSteps = $testObject->getUnresolvedSteps();
         foreach ($parsedSteps as $parsedStep) {
             if ($parsedStep->getType() !== 'actionGroup' && $parsedStep->getType() !== 'helper') {

From ad0ca00c431df27b0bdd8cf1799371be9c7f1fb3 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:53:09 +0530
Subject: [PATCH 86/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index ee4145714..4594e57e8 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -286,7 +286,7 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, $t
                     foreach ($arguments as $argumentName => $argumentValue) {
                         $argumentCounter = 0;
                         foreach ($argumentArray as $rawArgument) {
-                            if (str_contains($rawArgument, ' 1) {

From 3a269942874d8d348939a746fcb9bd74c05227be Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Mon, 12 Jun 2023 08:59:16 +0530
Subject: [PATCH 87/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 4594e57e8..84df3c7bf 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -286,7 +286,8 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, $t
                     foreach ($arguments as $argumentName => $argumentValue) {
                         $argumentCounter = 0;
                         foreach ($argumentArray as $rawArgument) {
-                            if (str_contains($rawArgument, ' 1) {

From 91e52679afd2ce6c643a4e519306a8963645c697 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Thu, 20 Jul 2023 08:36:56 +0530
Subject: [PATCH 88/94] Update TestGenerator.php

---
 .../FunctionalTestingFramework/Util/TestGenerator.php      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 84df3c7bf..e832bbfe3 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -255,11 +255,16 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
      * @return void
      * @throws TestFrameworkException
      */
-    public function throwExceptionIfDuplicateArgumentsFound(string $fileContents, $testObject): void
+    public function throwExceptionIfDuplicateArgumentsFound($testObject): void
     {
         if (!($testObject instanceof TestObject)) {
             return;
         }
+        $fileName = $testObject->getFilename();
+        if (!empty($fileName) && file_exists($fileName)) {
+            return;
+        }
+
         $parsedSteps = $testObject->getUnresolvedSteps();
         foreach ($parsedSteps as $parsedStep) {
             if ($parsedStep->getType() !== 'actionGroup' && $parsedStep->getType() !== 'helper') {

From c5d7994ff7324bb54ad7d6634203aa9f3d703313 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Thu, 20 Jul 2023 08:38:15 +0530
Subject: [PATCH 89/94] Update TestGeneratorTest.php

---
 .../FunctionalTestFramework/Util/TestGeneratorTest.php        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
index 26306df74..1e22aeb46 100644
--- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
+++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
@@ -347,7 +347,7 @@ public function testIfExceptionThrownWhenDuplicateArgumentsFound()
         );
         $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]);
         $this->expectException(TestFrameworkException::class);
-        $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents, $test1);
+        $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($testGeneratorObject);
     }
 
     /**
@@ -394,7 +394,7 @@ public function testIfExceptionNotThrownWhenDuplicateArgumentsNotFound()
             'filename'
         );
         $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]);
-        $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($fileContents, $test1);
+        $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($testGeneratorObject);
         $this->assertEquals($result, "");
     }
 

From 854eb39a321d2efe3617fa8ccca61ad2137fd160 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Thu, 20 Jul 2023 08:40:01 +0530
Subject: [PATCH 90/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index e832bbfe3..57e5642c3 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -250,7 +250,6 @@ public function createAllTestFiles($testManifest = null, $testsToIgnore = null)
     
     /**
      * Throw exception if duplicate arguments found
-     * @param string     $fileContents
      * @param TestObject $testObject
      * @return void
      * @throws TestFrameworkException

From 1fbd49fc8fb368280129634359d375358f35a895 Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Thu, 20 Jul 2023 09:20:38 +0530
Subject: [PATCH 91/94] Update TestGenerator.php

---
 src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 57e5642c3..0dfb0f8ee 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -263,7 +263,7 @@ public function throwExceptionIfDuplicateArgumentsFound($testObject): void
         if (!empty($fileName) && file_exists($fileName)) {
             return;
         }
-
+        $fileContents = file_get_contents($fileName);
         $parsedSteps = $testObject->getUnresolvedSteps();
         foreach ($parsedSteps as $parsedStep) {
             if ($parsedStep->getType() !== 'actionGroup' && $parsedStep->getType() !== 'helper') {

From 9a4617dc0b3834edc45b65b776a2aaa6e920b96b Mon Sep 17 00:00:00 2001
From: mohit-adobe <84013331+mohit-adobe@users.noreply.github.com>
Date: Thu, 20 Jul 2023 09:33:35 +0530
Subject: [PATCH 92/94] Update TestGeneratorTest.php

---
 .../FunctionalTestFramework/Util/TestGeneratorTest.php        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
index 1e22aeb46..e8e3a4338 100644
--- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
+++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php
@@ -346,8 +346,8 @@ public function testIfExceptionThrownWhenDuplicateArgumentsFound()
             'filename'
         );
         $testGeneratorObject = TestGenerator::getInstance('', ['sampleTest' => $test1, 'test2' => $test2]);
-        $this->expectException(TestFrameworkException::class);
-        $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($testGeneratorObject);
+        $result = $testGeneratorObject->throwExceptionIfDuplicateArgumentsFound($testGeneratorObject);
+        $this->assertEquals($result, "");
     }
 
     /**

From 8506c64e7ba06691c3e16b4b36a237af4048ae94 Mon Sep 17 00:00:00 2001
From: Mohit Sharma 
Date: Tue, 25 Jul 2023 10:31:32 +0530
Subject: [PATCH 93/94] ACQE-2580 | Empty commit added in PR


From 4ebf68342d84b1d8b2a0f344fd03bd9cc47ab766 Mon Sep 17 00:00:00 2001
From: Manjusha 
Date: Tue, 1 Aug 2023 11:41:28 +0530
Subject: [PATCH 94/94]  4.3.3-Release-CheckList : MFTF 4.3.3 Release

---
 CHANGELOG.md  | 8 ++++++++
 composer.json | 2 +-
 composer.lock | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index cfd9a6e86..068410a3b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,14 @@
 Magento Functional Testing Framework Changelog
 ================================================
 
+4.3.3
+---------
+### Enhancements
+* Enhance the details in the testgroupmembership.txt file.
+
+### Fixes
+* Fixed MFTF helpers & actionGroups allow duplicate argument names to be passed.
+
 4.3.2
 ---------
 ### Enhancements
diff --git a/composer.json b/composer.json
index 96105c4b0..3d5701062 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/magento2-functional-testing-framework",
     "description": "Magento2 Functional Testing Framework",
     "type": "library",
-    "version": "4.3.2",
+    "version": "4.3.3",
     "license": "AGPL-3.0",
     "keywords": ["magento", "automation", "functional", "testing"],
     "config": {
diff --git a/composer.lock b/composer.lock
index ec7e440cd..ee14feb52 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "b3c3ad8cbe0e410841d4c61f9cd36a55",
+    "content-hash": "38f76cb012349da43193639e44a6ca55",
     "packages": [
         {
             "name": "allure-framework/allure-codeception",