Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear errors when apply new filters #28687

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<!-- Test XML Example -->
<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"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
<testCaseId value="MC-142721"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
<severity value="CRITICAL"/>
<group value="uI"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
<group value="mtf_migrated"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
</annotations>

<before>
<magentoCLI command="config:set system/backup/functionality_enabled 1" stepKey="setEnableBackupToYes"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
<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"/>
lenaorobei marked this conversation as resolved.
Show resolved Hide resolved
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ define([
* @returns {Filters} Chainable.
*/
apply: function () {
$('body').notification('clear');
this.set('applied', removeEmpty(this.filters));

return this;
Expand Down