From 90b499db54862cc65910c9adcb29e0f7516d63fd Mon Sep 17 00:00:00 2001 From: KevinBKozan Date: Wed, 21 Mar 2018 15:58:05 -0500 Subject: [PATCH] MQE-818: Enable executeJS to save a variable - executeJS now assigns a variable for storage. --- dev/tests/verification/Resources/BasicFunctionalTest.txt | 2 +- .../FunctionalTestingFramework/Util/TestGenerator.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index 9d4a0a3dd..826aa7f44 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -88,7 +88,7 @@ class BasicFunctionalTestCest $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); $I->doubleClick(".functionalTestSelector"); $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); - $I->executeJS("someJSFunction"); + $executeJSKey1 = $I->executeJS("someJSFunction"); $I->fillField(".functionalTestSelector", "someInput"); $I->fillField(".functionalTestSelector", "0"); $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 2ac2d0abd..e51992652 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -913,7 +913,12 @@ private function generateStepsPhp($actionObjects, $hookObject = false) $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $function); break; case "executeJS": - $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $function); + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $stepKey, + $actor, + $actionObject, + $function + ); break; case "performOn": case "waitForElementChange":