diff --git a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt index e58268b13..6b709a0cb 100644 --- a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt +++ b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt @@ -28,6 +28,6 @@ class ExecuteInSeleniumTestCest */ public function ExecuteInSeleniumTest(AcceptanceTester $I) { - $I->executeInSelenium(function ($webdriver) { return 'Hello, World!'}); // stepKey: executeInSeleniumStep + $I->executeInSelenium(function ($webdriver) { return "Hello, World!"}); // stepKey: executeInSeleniumStep } } diff --git a/dev/tests/verification/TestModule/Test/ExecuteInSeleniumTest.xml b/dev/tests/verification/TestModule/Test/ExecuteInSeleniumTest.xml index 0a72189b4..c25164220 100644 --- a/dev/tests/verification/TestModule/Test/ExecuteInSeleniumTest.xml +++ b/dev/tests/verification/TestModule/Test/ExecuteInSeleniumTest.xml @@ -9,6 +9,6 @@ - + diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 1facfe746..ce45af963 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -654,7 +654,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } if (isset($customActionAttributes['function'])) { - $function = $this->addUniquenessFunctionCall($customActionAttributes['function']); + $function = $this->addUniquenessFunctionCall( + $customActionAttributes['function'], + $actionObject->getType() !== "executeInSelenium" + ); if (in_array($actionObject->getType(), ActionObject::FUNCTION_CLOSURE_ACTIONS)) { // Argument must be a closure function, not a string. $function = trim($function, '"'); @@ -1736,12 +1739,17 @@ private function processPressKey($input) /** * Add uniqueness function call to input string based on regex pattern. * - * @param string $input + * @param string $input + * @param boolean $wrapWithDoubleQuotes * @return string */ - private function addUniquenessFunctionCall($input) + private function addUniquenessFunctionCall($input, $wrapWithDoubleQuotes = true) { - $output = $this->wrapWithDoubleQuotes($input); + if ($wrapWithDoubleQuotes) { + $output = $this->wrapWithDoubleQuotes($input); + } else { + $output = $input; + } //Match on msq(\"entityName\") preg_match_all('/' . EntityDataObject::CEST_UNIQUE_FUNCTION . '\(\\\\"[\w]+\\\\"\)/', $output, $matches);