From 12c098ae656e6d7bf2776555edbdf6263ccf8c93 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 19 Sep 2018 11:16:06 -0500 Subject: [PATCH 1/3] MQE-1150: Test generation fails for arguments containing hyphen character - Made regex more flexible, should accept any character except for ones that break the pattern. --- .../Test/Objects/ActionGroupObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 2b63709fc..67c1ba25c 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -204,7 +204,7 @@ private function resolveAttributesWithArguments($arguments, $attributes) // $regexPattern match on: $matches[0] {{section.element(arg.field)}} // $matches[1] = section.element // $matches[2] = arg.field - $regexPattern = '/{{([\w.\[\]]+)\(*([\w.$\',\s\[\]]+)*\)*}}/'; + $regexPattern = '/{{([^(}]+)\(*([^)}]+)*\)*}}/'; $newActionAttributes = []; foreach ($attributes as $attributeKey => $attributeValue) { From bc0e154de59ec23eb808e8ba34d86c7029174783 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 19 Sep 2018 13:27:25 -0500 Subject: [PATCH 2/3] MQE-1142: Use timeout value when waitForLoadingMaskToDisappear - Added default value for $timeout attribute (causing issues with CE tests) --- .../FunctionalTestingFramework/Module/MagentoWebDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index b343e4867..6c680784c 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -377,7 +377,7 @@ public function waitForPageLoad($timeout = null) * @throws \Exception * @return void */ - public function waitForLoadingMaskToDisappear($timeout) + public function waitForLoadingMaskToDisappear($timeout = null) { foreach (self::$loadingMasksLocators as $maskLocator) { // Get count of elements found for looping. From 18a9e57320ee5a96f8146f9409684b6d6c7f4281 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Fri, 21 Sep 2018 08:45:12 -0500 Subject: [PATCH 3/3] MQE-1150: Test generation fails for arguments containing hyphen - Added Verification Test --- ...roupWithParameterizedElementWithHyphen.txt | 32 +++++++++++++++++++ .../ActionGroup/FunctionalActionGroup.xml | 6 ++++ .../TestModule/Test/ActionGroupTest.xml | 5 +++ .../Tests/ActionGroupGenerationTest.php | 11 +++++++ 4 files changed, 54 insertions(+) create mode 100644 dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt new file mode 100644 index 000000000..64a350505 --- /dev/null +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt @@ -0,0 +1,32 @@ +executeJS("#element .full-width"); + } +} diff --git a/dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml index 728b606b2..e6a7bad00 100644 --- a/dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml +++ b/dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml @@ -85,4 +85,10 @@ + + + + + + diff --git a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml index 848fe8bcc..1417de556 100644 --- a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml +++ b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml @@ -158,4 +158,9 @@ + + + + + diff --git a/dev/tests/verification/Tests/ActionGroupGenerationTest.php b/dev/tests/verification/Tests/ActionGroupGenerationTest.php index 65d65d04d..d95e572ef 100644 --- a/dev/tests/verification/Tests/ActionGroupGenerationTest.php +++ b/dev/tests/verification/Tests/ActionGroupGenerationTest.php @@ -195,4 +195,15 @@ public function testActionGroupWithSkipReadiness() { $this->generateAndCompareTest('ActionGroupSkipReadiness'); } + + /** + * Test an action group with an arg that resolves into section.element with a hyphen in the parameter + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testActionGroupWithHyphen() + { + $this->generateAndCompareTest('ActionGroupWithParameterizedElementWithHyphen'); + } }