From f3164918ae5e7f73d4b18e471afd0c6731322637 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 7 Dec 2021 16:04:47 -0600 Subject: [PATCH 01/14] MQE-3124: fix unbalanced parallel groups --- .../Test/Objects/TestObject.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index 8341fc7b1..f49c8f3c4 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -21,12 +21,20 @@ class TestObject const TEST_ACTION_WEIGHT = [ 'waitForPageLoad' => 1500, - 'amOnPage' => 1000, + 'amOnPage' => 1500, 'waitForLoadingMaskToDisappear' => 500, 'wait' => self::WAIT_TIME_ATTRIBUTE, + 'waitForAjaxLoad' => 500, + 'waitForJS' => 500, 'comment' => 5, 'assertCount' => 5, - 'closeAdminNotification' => 10 + 'closeAdminNotification' => 10, + 'magentoCLI' => 1000, + 'magentoCron' => 3000, + 'createData' => 500, + 'deleteData' => 100, + 'updateData' => 100, + 'getOTP' => 200, ]; /** From 75b00c5f82f52858d78c34d95fb5cd08197e8f48 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 9 Dec 2021 10:09:47 -0600 Subject: [PATCH 02/14] MQE-3124: fix unbalanced parallel groups --- .../FunctionalTestingFramework/Test/Objects/TestObject.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index f49c8f3c4..bce0f70a9 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -32,9 +32,9 @@ class TestObject 'magentoCLI' => 1000, 'magentoCron' => 3000, 'createData' => 500, - 'deleteData' => 100, - 'updateData' => 100, - 'getOTP' => 200, + 'deleteData' => 200, + 'updateData' => 200, + 'getOTP' => 1000, ]; /** From 76c0d7c9ba051066125a2f94a248e6cb4b1c853c Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 14 Dec 2021 11:14:24 -0600 Subject: [PATCH 03/14] MQE-3124: fix unbalanced parallel groups --- .../Test/Objects/TestObject.php | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index bce0f70a9..be162cb51 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -37,6 +37,15 @@ class TestObject 'getOTP' => 1000, ]; + const WEBAPI_AUTH_TEST_ACTIONS = [ + 'createData', + 'deleteData', + 'updateData', + 'getData', + ]; + + const WEBAPI_AUTH_TEST_ACTION_WEIGHT = 6000; + /** * Name of the test * @@ -93,6 +102,11 @@ class TestObject */ private $deprecated; + /** + * Indicates if a test contains an action that requires Web API authentication. + */ + private bool $hasWebApiAuthAction; + /** * TestObject constructor. * @@ -120,6 +134,7 @@ public function __construct( $this->filename = $filename; $this->parentTest = $parentTest; $this->deprecated = $deprecated; + $this->hasWebApiAuthAction = false; } /** @@ -230,7 +245,11 @@ public function getEstimatedDuration() $testTime = $this->calculateWeightedActionTimes($this->getOrderedActions()); - return $hookTime + $testTime; + if ($this->hasWebApiAuthAction) { + return $hookTime + $testTime + self::WEBAPI_AUTH_TEST_ACTION_WEIGHT; + } else { + return $hookTime + $testTime; + } } /** @@ -245,6 +264,11 @@ private function calculateWeightedActionTimes($actions) // search for any actions of special type foreach ($actions as $action) { /** @var ActionObject $action */ + + if (!$this->hasWebApiAuthAction && in_array($action->getType(), self::WEBAPI_AUTH_TEST_ACTIONS)) { + $this->hasWebApiAuthAction = true; + } + if (array_key_exists($action->getType(), self::TEST_ACTION_WEIGHT)) { $weight = self::TEST_ACTION_WEIGHT[$action->getType()]; if ($weight === self::WAIT_TIME_ATTRIBUTE) { From 69006336d66864975fb4196ffafa3dc1db801f2f Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 14 Dec 2021 13:18:30 -0600 Subject: [PATCH 04/14] MQE-3124: fix unbalanced parallel groups --- .../Test/Objects/TestObject.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index be162cb51..f556947f1 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -25,6 +25,10 @@ class TestObject 'waitForLoadingMaskToDisappear' => 500, 'wait' => self::WAIT_TIME_ATTRIBUTE, 'waitForAjaxLoad' => 500, + 'waitForElementNotVisible' => 500, + 'waitForElementVisible' => 500, + 'waitForText' => 500, + 'waitForElement' => 500, 'waitForJS' => 500, 'comment' => 5, 'assertCount' => 5, @@ -104,8 +108,10 @@ class TestObject /** * Indicates if a test contains an action that requires Web API authentication. + * + * @var boolean */ - private bool $hasWebApiAuthAction; + private $hasWebApiAuthAction; /** * TestObject constructor. From 0a6db1855f8c8200d1cdd9164d24c9a84345a76c Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Tue, 21 Dec 2021 10:44:20 -0600 Subject: [PATCH 05/14] MQE-2575: Allow MFTF Helpers to Return Data to MFTF Test --- .../Util/TestGenerator.php | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index c0249a32b..17e645e76 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -898,7 +898,12 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $stepKey, $customActionAttributes['class'] . '::' . $customActionAttributes['method'] ); - $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $arguments); + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $stepKey, + $actor, + $actionObject, + $arguments + ); break; case "createData": $entity = $customActionAttributes['entity']; @@ -2016,16 +2021,7 @@ private function addDollarSign($input) */ private function wrapFunctionCall($actor, $action, ...$args) { - $isFirst = true; - $isActionHelper = $action->getType() === 'helper'; - $actionType = $action->getType(); - if ($isActionHelper) { - $actor = "this->helperContainer->get('" . $action->getCustomActionAttributes()['class'] . "')"; - $args = $args[0]; - $actionType = $action->getCustomActionAttributes()['method']; - } - - $output = sprintf("\t\t$%s->%s(", $actor, $actionType); + $output = sprintf("\t\t$%s->%s(", $actor, $action->getType()); for ($i = 0; $i < count($args); $i++) { if (null === $args[$i]) { continue; @@ -2055,8 +2051,13 @@ private function wrapFunctionCall($actor, $action, ...$args) */ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $action, ...$args) { - $isFirst = true; - $output = sprintf("\t\t$%s = $%s->%s(", $returnVariable, $actor, $action->getType()); + $actionType = $action->getType(); + if ($actionType === 'helper') { + $actor = "this->helperContainer->get('" . $action->getCustomActionAttributes()['class'] . "')"; + $args = $args[0]; + $actionType = $action->getCustomActionAttributes()['method']; + } + $output = sprintf("\t\t$%s = $%s->%s(", $returnVariable, $actor, $actionType); for ($i = 0; $i < count($args); $i++) { if (null === $args[$i]) { continue; From 8ad5910b6af9c57990317255b53b6ff0c58789c7 Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Tue, 21 Dec 2021 11:12:12 -0600 Subject: [PATCH 06/14] MQE-2575: Allow MFTF Helpers to Return Data to MFTF Test --- src/Magento/FunctionalTestingFramework/Util/TestGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 17e645e76..7a9c987be 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -2044,7 +2044,7 @@ private function wrapFunctionCall($actor, $action, ...$args) * * @param string $returnVariable * @param string $actor - * @param string $action + * @param actionObject $action * @param array ...$args * @return string * @throws \Exception From 32747f8a2647fdb2ecf1c3602bf7a7e93b8d736f Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Tue, 21 Dec 2021 17:14:42 -0600 Subject: [PATCH 07/14] MQE-2575: Allow MFTF Helpers to Return Data to MFTF Test - fix static tests --- .../FunctionalTestingFramework/Util/TestGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 7a9c987be..9519b921b 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -2042,10 +2042,10 @@ private function wrapFunctionCall($actor, $action, ...$args) /** * Wrap parameters into a function call with a return value. * - * @param string $returnVariable - * @param string $actor + * @param string $returnVariable + * @param string $actor * @param actionObject $action - * @param array ...$args + * @param array ...$args * @return string * @throws \Exception */ From ccfcf4f8e3f5ff6e670c87e92ae8f60eec842dd3 Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Wed, 22 Dec 2021 12:23:52 -0600 Subject: [PATCH 08/14] MQE-2575: Allow MFTF Helpers to Return Data to MFTF Test - fix static tests --- .../tests/MFTF/DevDocs/Helper/CustomHelper.php | 11 +++++++++++ .../tests/MFTF/DevDocs/Test/DevDocsTest.xml | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Helper/CustomHelper.php b/dev/tests/functional/tests/MFTF/DevDocs/Helper/CustomHelper.php index 46fba18d9..3705ec1d0 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Helper/CustomHelper.php +++ b/dev/tests/functional/tests/MFTF/DevDocs/Helper/CustomHelper.php @@ -46,4 +46,15 @@ public function goTo( print('$bla = ' . $bla . PHP_EOL); print('array $arraysomething = [' . implode(', ', $arraysomething) . ']' . PHP_EOL); } + + /** + * Returns value of provided param $text + * + * @param string $text + * @return string + */ + public function getText(string $text): string + { + return $text; + } } diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml index bf074d516..911bc65eb 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml @@ -42,6 +42,14 @@ 987 + + some text + + + some text + getText + + From e9b5b0dfb6d47c5093ecae458e30ec8855532bca Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Fri, 24 Dec 2021 12:39:25 +0530 Subject: [PATCH 09/14] MQE-1518 : Added new action WaitForElementClickable --- .../Resources/WaitForElementClickableTest.txt | 69 +++++++++++++++++++ .../Test/WaitForElementClickableTest.xml | 22 ++++++ .../Tests/WaitForElementClickableTest.php | 24 +++++++ docs/test/actions.md | 20 +++++- .../Test/etc/Actions/waitActions.xsd | 17 +++++ 5 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 dev/tests/verification/Resources/WaitForElementClickableTest.txt create mode 100644 dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml create mode 100644 dev/tests/verification/Tests/WaitForElementClickableTest.php diff --git a/dev/tests/verification/Resources/WaitForElementClickableTest.txt b/dev/tests/verification/Resources/WaitForElementClickableTest.txt new file mode 100644 index 000000000..7840bc5dd --- /dev/null +++ b/dev/tests/verification/Resources/WaitForElementClickableTest.txt @@ -0,0 +1,69 @@ +Test filesvendor/magento/module-page-builder/Test/Mftf/Test/AdminPageBuilderColumnTest/WaitForElementClickableTest.xml
") + */ +class WaitForElementClickableTest +{ + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _before(AcceptanceTester $I) + { + $I->comment("Entering Action Group [loginAsAdmin] AdminLoginActionGroup"); + $I->amOnPage((getenv("MAGENTO_BACKEND_BASE_URL") ? rtrim(getenv("MAGENTO_BACKEND_BASE_URL"), "/") : "") . "/" . getenv("MAGENTO_BACKEND_NAME") . "/admin"); // stepKey: navigateToAdminLoginAsAdmin + $I->fillField("#username", getenv("MAGENTO_ADMIN_USERNAME")); // stepKey: fillUsernameLoginAsAdmin + $I->fillField("#login", getenv("MAGENTO_ADMIN_PASSWORD")); // stepKey: fillPasswordLoginAsAdmin + $I->click(".actions .action-primary"); // stepKey: clickLoginLoginAsAdmin + $I->waitForPageLoad(30); // stepKey: clickLoginLoginAsAdminWaitForPageLoad + $I->conditionalClick(".modal-popup .action-secondary", ".modal-popup .action-secondary", true); // stepKey: clickDontAllowButtonIfVisibleLoginAsAdmin + $I->closeAdminNotification(); // stepKey: closeAdminNotificationLoginAsAdmin + $I->comment("Exiting Action Group [loginAsAdmin] AdminLoginActionGroup"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + $I->comment("Entering Action Group [logout] AdminLogoutActionGroup"); + $I->amOnPage((getenv("MAGENTO_BACKEND_BASE_URL") ? rtrim(getenv("MAGENTO_BACKEND_BASE_URL"), "/") : "") . "/" . getenv("MAGENTO_BACKEND_NAME") . "/admin/auth/logout/"); // stepKey: amOnLogoutPageLogout + $I->comment("Exiting Action Group [logout] AdminLogoutActionGroup"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _failed(AcceptanceTester $I) + { + $I->saveScreenshot(); // stepKey: saveScreenshot + } + + /** + * @Features({"PageBuilder"}) + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function WaitForElementClickableTest(AcceptanceTester $I) + { + $I->moveMouseOver("(//div[@data-content-type=\"column\"])[1]"); // stepKey: moveMouseOverColumn + $I->waitForPageLoad(30); // stepKey: waitForMouseOver + $I->waitForElementClickable("(//div[contains(@class, \"pagebuilder-content-type\") and contains(@class, \"pagebuilder-column\")])[1]//div[contains(@class,\"pagebuilder-options-visible\")]"); // stepKey: waitForOptions + } +} diff --git a/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml b/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml new file mode 100644 index 000000000..7118751be --- /dev/null +++ b/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/dev/tests/verification/Tests/WaitForElementClickableTest.php b/dev/tests/verification/Tests/WaitForElementClickableTest.php new file mode 100644 index 000000000..2b83c4b72 --- /dev/null +++ b/dev/tests/verification/Tests/WaitForElementClickableTest.php @@ -0,0 +1,24 @@ +generateAndCompareTest('WaitForElementClickableTest'); + } + +} diff --git a/docs/test/actions.md b/docs/test/actions.md index 42ecde053..373a44ee0 100644 --- a/docs/test/actions.md +++ b/docs/test/actions.md @@ -2374,10 +2374,28 @@ Attribute|Type|Use|Description #### Example ```xml - ``` +### waitForElementClickable + +See [waitForElementClickable docs on codeception.com](http://codeception.com/docs/modules/WebDriver#waitForElementClickable). + +Attribute|Type|Use|Description +---|---|---|--- +`selector`|string|optional| The selector identifying the corresponding HTML element. +`time`|string|optional| The number of seconds to wait for the element to appear. +`stepKey`|string|required| A unique identifier of the action. +`before`|string|optional| `stepKey` of action that must be executed next. +`after`|string|optional| `stepKey` of preceding action. + +#### Example + +```xml + + +``` + ### waitForJS See [waitForJS docs on codeception.com](http://codeception.com/docs/modules/WebDriver#waitForJS). diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd index 70b8201a1..18214ba9a 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd @@ -23,6 +23,8 @@ + + @@ -224,4 +226,19 @@ + + + + Waits up to $timeout seconds for the given element to be clickable. + If element doesn’t become clickable, a timeout exception is thrown. + + + + + + + + + + \ No newline at end of file From 6ea8ac24fc8773cd144e53dc330a635be18a8a7d Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Fri, 24 Dec 2021 14:44:59 +0530 Subject: [PATCH 10/14] fixed psr --- dev/tests/verification/Tests/WaitForElementClickableTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/verification/Tests/WaitForElementClickableTest.php b/dev/tests/verification/Tests/WaitForElementClickableTest.php index 2b83c4b72..768fc1ab0 100644 --- a/dev/tests/verification/Tests/WaitForElementClickableTest.php +++ b/dev/tests/verification/Tests/WaitForElementClickableTest.php @@ -10,7 +10,7 @@ class WaitForElementClickableTest extends MftfTestCase { /** - * WaitForElementClickable: + * BasicFunctionalTest: * Tests flat generation of a hardcoded test file with no external references. * * @throws \Exception @@ -20,5 +20,4 @@ public function testWaitForElementClickableAction() { $this->generateAndCompareTest('WaitForElementClickableTest'); } - } From c0ee4a395eec7f7ecff3e7dcdd5b5cc3a831ad57 Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Fri, 24 Dec 2021 16:01:46 +0530 Subject: [PATCH 11/14] fixed verification test --- .../verification/Resources/WaitForElementClickableTest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/verification/Resources/WaitForElementClickableTest.txt b/dev/tests/verification/Resources/WaitForElementClickableTest.txt index 7840bc5dd..05359dba9 100644 --- a/dev/tests/verification/Resources/WaitForElementClickableTest.txt +++ b/dev/tests/verification/Resources/WaitForElementClickableTest.txt @@ -15,7 +15,7 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * @Description("

Test files

vendor/magento/module-page-builder/Test/Mftf/Test/AdminPageBuilderColumnTest/WaitForElementClickableTest.xml
") */ -class WaitForElementClickableTest +class WaitForElementClickableTestCest { /** * @param AcceptanceTester $I From 9eab78e92ff01075f2f6425373bb85aca3164f46 Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Tue, 28 Dec 2021 12:36:25 +0530 Subject: [PATCH 12/14] fixed verification test --- .../Resources/DataActionsTest.txt | 1 + .../Resources/WaitForElementClickableTest.txt | 69 ------------------- .../TestModule/Test/DataActionsTest.xml | 3 +- .../Test/WaitForElementClickableTest.xml | 22 ------ .../Tests/WaitForElementClickableTest.php | 23 ------- 5 files changed, 3 insertions(+), 115 deletions(-) delete mode 100644 dev/tests/verification/Resources/WaitForElementClickableTest.txt delete mode 100644 dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml delete mode 100644 dev/tests/verification/Tests/WaitForElementClickableTest.php diff --git a/dev/tests/verification/Resources/DataActionsTest.txt b/dev/tests/verification/Resources/DataActionsTest.txt index f84f97040..56da03cd6 100644 --- a/dev/tests/verification/Resources/DataActionsTest.txt +++ b/dev/tests/verification/Resources/DataActionsTest.txt @@ -31,6 +31,7 @@ class DataActionsTestCest $I->createEntity("createdInBefore", "hook", "entity", [], []); // stepKey: createdInBefore $I->updateEntity("createdInBefore", "hook", "entity",[]); // stepKey: updateInBefore $I->deleteEntity("createdInBefore", "hook"); // stepKey: deleteInBefore + $I->waitForElementClickable(".functionalTestSelector"); // stepKey: waitForElementClickable } /** diff --git a/dev/tests/verification/Resources/WaitForElementClickableTest.txt b/dev/tests/verification/Resources/WaitForElementClickableTest.txt deleted file mode 100644 index 05359dba9..000000000 --- a/dev/tests/verification/Resources/WaitForElementClickableTest.txt +++ /dev/null @@ -1,69 +0,0 @@ -Test filesvendor/magento/module-page-builder/Test/Mftf/Test/AdminPageBuilderColumnTest/WaitForElementClickableTest.xml
") - */ -class WaitForElementClickableTestCest -{ - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _before(AcceptanceTester $I) - { - $I->comment("Entering Action Group [loginAsAdmin] AdminLoginActionGroup"); - $I->amOnPage((getenv("MAGENTO_BACKEND_BASE_URL") ? rtrim(getenv("MAGENTO_BACKEND_BASE_URL"), "/") : "") . "/" . getenv("MAGENTO_BACKEND_NAME") . "/admin"); // stepKey: navigateToAdminLoginAsAdmin - $I->fillField("#username", getenv("MAGENTO_ADMIN_USERNAME")); // stepKey: fillUsernameLoginAsAdmin - $I->fillField("#login", getenv("MAGENTO_ADMIN_PASSWORD")); // stepKey: fillPasswordLoginAsAdmin - $I->click(".actions .action-primary"); // stepKey: clickLoginLoginAsAdmin - $I->waitForPageLoad(30); // stepKey: clickLoginLoginAsAdminWaitForPageLoad - $I->conditionalClick(".modal-popup .action-secondary", ".modal-popup .action-secondary", true); // stepKey: clickDontAllowButtonIfVisibleLoginAsAdmin - $I->closeAdminNotification(); // stepKey: closeAdminNotificationLoginAsAdmin - $I->comment("Exiting Action Group [loginAsAdmin] AdminLoginActionGroup"); - } - - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _after(AcceptanceTester $I) - { - $I->comment("Entering Action Group [logout] AdminLogoutActionGroup"); - $I->amOnPage((getenv("MAGENTO_BACKEND_BASE_URL") ? rtrim(getenv("MAGENTO_BACKEND_BASE_URL"), "/") : "") . "/" . getenv("MAGENTO_BACKEND_NAME") . "/admin/auth/logout/"); // stepKey: amOnLogoutPageLogout - $I->comment("Exiting Action Group [logout] AdminLogoutActionGroup"); - } - - /** - * @param AcceptanceTester $I - * @throws \Exception - */ - public function _failed(AcceptanceTester $I) - { - $I->saveScreenshot(); // stepKey: saveScreenshot - } - - /** - * @Features({"PageBuilder"}) - * @param AcceptanceTester $I - * @return void - * @throws \Exception - */ - public function WaitForElementClickableTest(AcceptanceTester $I) - { - $I->moveMouseOver("(//div[@data-content-type=\"column\"])[1]"); // stepKey: moveMouseOverColumn - $I->waitForPageLoad(30); // stepKey: waitForMouseOver - $I->waitForElementClickable("(//div[contains(@class, \"pagebuilder-content-type\") and contains(@class, \"pagebuilder-column\")])[1]//div[contains(@class,\"pagebuilder-options-visible\")]"); // stepKey: waitForOptions - } -} diff --git a/dev/tests/verification/TestModule/Test/DataActionsTest.xml b/dev/tests/verification/TestModule/Test/DataActionsTest.xml index b75bc98f8..eede5e9f9 100644 --- a/dev/tests/verification/TestModule/Test/DataActionsTest.xml +++ b/dev/tests/verification/TestModule/Test/DataActionsTest.xml @@ -13,8 +13,9 @@ - + + diff --git a/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml b/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml deleted file mode 100644 index 7118751be..000000000 --- a/dev/tests/verification/TestModule/Test/WaitForElementClickableTest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/verification/Tests/WaitForElementClickableTest.php b/dev/tests/verification/Tests/WaitForElementClickableTest.php deleted file mode 100644 index 768fc1ab0..000000000 --- a/dev/tests/verification/Tests/WaitForElementClickableTest.php +++ /dev/null @@ -1,23 +0,0 @@ -generateAndCompareTest('WaitForElementClickableTest'); - } -} From 1ca49786fc57de14d596d08050d54545c6122b57 Mon Sep 17 00:00:00 2001 From: "Manjusha.S" Date: Tue, 28 Dec 2021 12:43:44 +0530 Subject: [PATCH 13/14] verification test for waitForElementClickable --- dev/tests/verification/Resources/DataActionsTest.txt | 2 +- dev/tests/verification/TestModule/Test/DataActionsTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/verification/Resources/DataActionsTest.txt b/dev/tests/verification/Resources/DataActionsTest.txt index 56da03cd6..178c579da 100644 --- a/dev/tests/verification/Resources/DataActionsTest.txt +++ b/dev/tests/verification/Resources/DataActionsTest.txt @@ -31,7 +31,6 @@ class DataActionsTestCest $I->createEntity("createdInBefore", "hook", "entity", [], []); // stepKey: createdInBefore $I->updateEntity("createdInBefore", "hook", "entity",[]); // stepKey: updateInBefore $I->deleteEntity("createdInBefore", "hook"); // stepKey: deleteInBefore - $I->waitForElementClickable(".functionalTestSelector"); // stepKey: waitForElementClickable } /** @@ -54,6 +53,7 @@ class DataActionsTestCest */ public function DataActionsTest(AcceptanceTester $I) { + $I->waitForElementClickable(".functionalTestSelector"); // stepKey: waitForElementClickable $I->createEntity("createdInTest", "test", "entity", [], []); // stepKey: createdInTest $I->updateEntity("createdInTest", "test", "entity",[]); // stepKey: updateInTest $I->deleteEntity("createdInTest", "test"); // stepKey: deleteInTest diff --git a/dev/tests/verification/TestModule/Test/DataActionsTest.xml b/dev/tests/verification/TestModule/Test/DataActionsTest.xml index eede5e9f9..2575c41b0 100644 --- a/dev/tests/verification/TestModule/Test/DataActionsTest.xml +++ b/dev/tests/verification/TestModule/Test/DataActionsTest.xml @@ -13,9 +13,9 @@ - + From 3b8f99c7fcc2fe9f4e749d97a19e81955a564a81 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Thu, 6 Jan 2022 09:46:01 -0600 Subject: [PATCH 14/14] MQE-3182: Release MFTF 3.8.0 --- CHANGELOG.md | 8 ++++++++ composer.json | 2 +- composer.lock | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d8a662fe..04999e2c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ Magento Functional Testing Framework Changelog ================================================ +3.8.0 +--------- + +### Updates: +* Allow MFTF Helpers to Return Data to MFTF Test +* Improve parallel grouping and fix an issue with unbalanced groups +* Added new action WaitForElementClickable + 3.7.3 --------- diff --git a/composer.json b/composer.json index 8fedf25a8..9a7757c5d 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2-functional-testing-framework", "description": "Magento2 Functional Testing Framework", "type": "library", - "version": "3.7.3", + "version": "3.8.0", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index 4a1a7d2be..8000882be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "822c40666da3ff087f25393fd4dc9371", + "content-hash": "35ff8c71326b9f8ab0885c8b55dd59cf", "packages": [ { "name": "allure-framework/allure-codeception",