Skip to content

Commit 48c5585

Browse files
authored
MQE-818: Enable executeJS to save a variable
- executeJS now assigns a variable for storage.
1 parent 0794a74 commit 48c5585

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dev/tests/verification/Resources/BasicFunctionalTest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class BasicFunctionalTestCest
9191
$I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput");
9292
$I->doubleClick(".functionalTestSelector");
9393
$I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2");
94-
$I->executeJS("someJSFunction");
94+
$executeJSKey1 = $I->executeJS("someJSFunction");
9595
$I->fillField(".functionalTestSelector", "someInput");
9696
$I->fillField(".functionalTestSelector", "0");
9797
$grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput");

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,12 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
959959
$testSteps .= $this->wrapFunctionCall($actor, $actionObject, $function);
960960
break;
961961
case "executeJS":
962-
$testSteps .= $this->wrapFunctionCall($actor, $actionObject, $function);
962+
$testSteps .= $this->wrapFunctionCallWithReturnValue(
963+
$stepKey,
964+
$actor,
965+
$actionObject,
966+
$function
967+
);
963968
break;
964969
case "performOn":
965970
case "waitForElementChange":

0 commit comments

Comments
 (0)