From 674324c6ae3cdee5c664bac6be3e275070bda758 Mon Sep 17 00:00:00 2001 From: abdarrahman abouzaid Date: Thu, 11 Jun 2020 15:21:11 +0200 Subject: [PATCH 1/5] clear errors when apply new filters --- app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index fe33389eabad4..848ad60219a2b 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -200,6 +200,7 @@ define([ * @returns {Filters} Chainable. */ apply: function () { + $('body').notification('clear'); this.set('applied', removeEmpty(this.filters)); return this; From 9fac5f7173db77e933e5a59e671151d9bf0b62c2 Mon Sep 17 00:00:00 2001 From: abdarrahman abouzaid Date: Thu, 27 Aug 2020 00:56:28 +0200 Subject: [PATCH 2/5] provide mftf test --- ...erRemoveErrorMessageBeforeApplyFilters.xml | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml new file mode 100644 index 0000000000000..3e4bac32d38e9 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml @@ -0,0 +1,95 @@ + + + + + + + + + <description value="Test log in to uI and Remove Error Message Before Apply Filters"/> + <testCaseId value="MC-142721"/> + <severity value="CRITICAL"/> + <group value="uI"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <magentoCLI command="config:set system/backup/functionality_enabled 1" stepKey="setEnableBackupToYes"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="NewRootCategory" stepKey="rootCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="rootCategory" /> + </createData> + <createData entity="defaultSimpleProduct" stepKey="createProduct2"> + <requiredEntity createDataKey="rootCategory" /> + </createData> + <!-- <createData entity="_defaultStore" stepKey="defaultStore"/> --> + + <!--Create website--> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <!-- Create second store --> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreGroup.name}}"/> + <argument name="rootCategory" value="$$rootCategory.name$$"/> + </actionGroup> + <!-- Create second store view --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + </before> + <after> + <magentoCLI command="config:set system/backup/functionality_enabled 0" stepKey="setEnableBackupToNo"/> + <deleteData stepKey="deleteRootCategory" createDataKey="rootCategory"/> + <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> + <deleteData stepKey="deleteProduct2" createDataKey="createProduct2"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!--Filter created simple product in grid and add category and website created in create data--> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> + <waitForPageLoad stepKey="waitForProductCatalogPage"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> + <argument name="product" value="$$createProduct2$$"/> + </actionGroup> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> + <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <actionGroup ref="AddWebsiteToProductActionGroup" stepKey="updateSimpleProductAddingWebsiteCreated"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + + <!--Search updated simple product(from above step) in the grid by StoreView and Name--> + <actionGroup ref="FilterProductInGridByStoreViewAndNameActionGroup" stepKey="searchCreatedSimpleProductInGrid"> + <argument name="storeView" value="{{customStoreEN.name}}"/> + <argument name="productName" value="$$createProduct2.name$$"/> + </actionGroup> + + <!--Go to stores and delete website created in create data--> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + + <!--Go to grid page and verify AssertErrorMessage--> + <actionGroup ref="AssertErrorMessageAfterDeletingWebsiteActionGroup" stepKey="verifyErrorMessage"> + <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> + </actionGroup> + + <!--Apply new filters to verify error message is removed --> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> + <click selector="{{AdminProductGridFilterSection.storeViewDropdown('Default Store View')}}" stepKey="clickStoreViewDropdown"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="$$createProduct.name$$" stepKey="fillProductNameInNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <see selector="{{AdminProductGridFilterSection.nthRow('1')}}" userInput="$$createProduct.name$$" stepKey="seeFirstRowToVerifyProductVisibleInGrid"/> + <dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage"/> + + </test> +</tests> From 3852c89cebccfef1da7242d73be40e4d831d3a97 Mon Sep 17 00:00:00 2001 From: abdarrahman abouzaid <abdarrahman.abouzaid@gmail.com> Date: Thu, 27 Aug 2020 01:05:10 +0200 Subject: [PATCH 3/5] update test file --- ...GridFilterRemoveErrorMessageBeforeApplyFilters.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml index 3e4bac32d38e9..c931e4f2b54c7 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ + * Copyright (©) 2020 Pinpoint Designs LTD. All right's reserved. + * + * Author: abdarrahman.abouzaid@gmail.com + * Website: http://www.pinpointdesigns.co.uk + */ --> -<!-- Test XML Example --> +<!-- Test XML #28687 PR --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminGridFilterRemoveErrorMessageBeforeApplyFilters"> <annotations> @@ -28,7 +30,6 @@ <createData entity="defaultSimpleProduct" stepKey="createProduct2"> <requiredEntity createDataKey="rootCategory" /> </createData> - <!-- <createData entity="_defaultStore" stepKey="defaultStore"/> --> <!--Create website--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> From 7517b21aa87f9e47aefa1ef0986f0198e6f4d70b Mon Sep 17 00:00:00 2001 From: abdarrahman abouzaid <abdarrahman.abouzaid@gmail.com> Date: Thu, 27 Aug 2020 19:24:07 +0200 Subject: [PATCH 4/5] provide PR requested changes --- ...terRemoveErrorMessageBeforeApplyFilters.xml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml index c931e4f2b54c7..09c87010b5743 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml @@ -1,27 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright (©) 2020 Pinpoint Designs LTD. All right's reserved. - * - * Author: abdarrahman.abouzaid@gmail.com - * Website: http://www.pinpointdesigns.co.uk - */ + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ --> -<!-- Test XML #28687 PR --> + <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminGridFilterRemoveErrorMessageBeforeApplyFilters"> <annotations> <stories value="Reset Error Messages"/> <title value="Remove Error Message Before Apply Filters"/> - <description value="Test log in to uI and Remove Error Message Before Apply Filters"/> - <testCaseId value="MC-142721"/> + <description value="Test login to Admin UI and Remove Error Message Before Apply Filters"/> <severity value="CRITICAL"/> - <group value="uI"/> - <group value="mtf_migrated"/> + <group value="ui"/> </annotations> <before> - <magentoCLI command="config:set system/backup/functionality_enabled 1" stepKey="setEnableBackupToYes"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="NewRootCategory" stepKey="rootCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> @@ -49,7 +44,6 @@ </actionGroup> </before> <after> - <magentoCLI command="config:set system/backup/functionality_enabled 0" stepKey="setEnableBackupToNo"/> <deleteData stepKey="deleteRootCategory" createDataKey="rootCategory"/> <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> <deleteData stepKey="deleteProduct2" createDataKey="createProduct2"/> From cef2186708426f7683cbd38d308562b2aa80ff46 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 9 Sep 2020 08:26:11 +0300 Subject: [PATCH 5/5] refactor mftf --- ...inGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename app/code/Magento/Ui/Test/Mftf/Test/{AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml => AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml} (98%) diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml similarity index 98% rename from app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml rename to app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml index 09c87010b5743..c7236c33e7cc0 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFilters.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml @@ -7,12 +7,13 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminGridFilterRemoveErrorMessageBeforeApplyFilters"> + <test name="AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest"> <annotations> <stories value="Reset Error Messages"/> <title value="Remove Error Message Before Apply Filters"/> <description value="Test login to Admin UI and Remove Error Message Before Apply Filters"/> - <severity value="CRITICAL"/> + <severity value="MAJOR"/> + <testCaseId value="MC-37450"/> <group value="ui"/> </annotations>