diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt
index 3452b8883..cebccc5d1 100644
--- a/dev/tests/verification/Resources/BasicFunctionalTest.txt
+++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt
@@ -112,6 +112,7 @@ class BasicFunctionalTestCest
$I->moveMouseOver(".functionalTestSelector");
$I->openNewTab();
$I->pauseExecution();
+ $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
$I->pressKey("#page", "a");
$I->pressKey("#page", ['ctrl','a'],'new');
$I->pressKey("#page", ['shift','111'],'1','x');
@@ -150,6 +151,7 @@ class BasicFunctionalTestCest
$I->waitForElement(".functionalTestSelector", 30);
$I->waitForElementNotVisible(".functionalTestSelector", 30);
$I->waitForElementVisible(".functionalTestSelector", 30);
+ $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();});
$I->waitForJS("someJsFunction", 30);
$I->waitForText("someInput", 30, ".functionalTestSelector");
}
diff --git a/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml b/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml
index 70ba6299f..9af9187a8 100644
--- a/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml
+++ b/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml
@@ -73,6 +73,7 @@
+
@@ -113,6 +114,7 @@
+
diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php
index 8a57013b1..a0436bc19 100644
--- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php
+++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php
@@ -47,6 +47,7 @@ class ActionObject
const ASSERTION_VALUE_ATTRIBUTE = "value";
const DELETE_DATA_MUTUAL_EXCLUSIVE_ATTRIBUTES = ["url", "createDataKey"];
const EXTERNAL_URL_AREA_INVALID_ACTIONS = ['amOnPage'];
+ const FUNCTION_CLOSURE_ACTIONS = ['waitForElementChange', 'performOn'];
const MERGE_ACTION_ORDER_AFTER = 'after';
const MERGE_ACTION_ORDER_BEFORE = 'before';
const ACTION_ATTRIBUTE_URL = 'url';
diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
index 81e055fe6..ac1402c47 100644
--- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
+++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
@@ -597,6 +597,10 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
if (isset($customActionAttributes['function'])) {
$function = $this->addUniquenessFunctionCall($customActionAttributes['function']);
+ if (in_array($actionObject->getType(), ActionObject::FUNCTION_CLOSURE_ACTIONS)) {
+ // Argument must be a closure function, not a string.
+ $function = trim($function, '"');
+ }
}
if (isset($customActionAttributes['html'])) {