From 970b467017fb0942ae57b6f5b9a00334b2b53249 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 28 Nov 2018 14:21:08 -0600 Subject: [PATCH 1/2] MQE-1361: Unable to use empty string literal as argument to selector in tests - bug fix --- .../FunctionalTestingFramework/Test/Objects/ActionObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index c91ebaf5c..c50a51201 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -691,7 +691,7 @@ private function matchParameterReferences($reference, $parameters) $resolvedParameters = []; foreach ($parameters as $parameter) { $parameter = trim($parameter); - preg_match_all("/[$'][\w\D]+[$']/", $parameter, $stringOrPersistedMatch); + preg_match_all("/[$'][\w\D]*[$']/", $parameter, $stringOrPersistedMatch); preg_match_all('/{\$[a-z][a-zA-Z\d]+}/', $parameter, $variableMatch); if (!empty($stringOrPersistedMatch[0])) { $resolvedParameters[] = ltrim(rtrim($parameter, "'"), "'"); From 04a15f1690435d14436fa9771ae7cb01590e70b6 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 28 Nov 2018 15:23:35 -0600 Subject: [PATCH 2/2] MQE-1361: Unable to use empty string literal as argument to selector in tests - added some verification tests --- dev/tests/verification/Resources/SectionReplacementTest.txt | 2 ++ dev/tests/verification/TestModule/Section/SampleSection.xml | 1 + .../verification/TestModule/Test/SectionReplacementTest.xml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt index 5bdba2812..c4d738811 100644 --- a/dev/tests/verification/Resources/SectionReplacementTest.txt +++ b/dev/tests/verification/Resources/SectionReplacementTest.txt @@ -68,5 +68,7 @@ class SectionReplacementTestCest $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); $I->click("#element .1#element .2"); $I->click("#element .1#element .{$data}"); + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); } } diff --git a/dev/tests/verification/TestModule/Section/SampleSection.xml b/dev/tests/verification/TestModule/Section/SampleSection.xml index 735c5fe7b..a560e2f1e 100644 --- a/dev/tests/verification/TestModule/Section/SampleSection.xml +++ b/dev/tests/verification/TestModule/Section/SampleSection.xml @@ -18,5 +18,6 @@ + diff --git a/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml b/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml index 9daef72cd..17aeb4d69 100644 --- a/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml +++ b/dev/tests/verification/TestModule/Test/SectionReplacementTest.xml @@ -50,5 +50,8 @@ + + +