Skip to content

Commit

Permalink
provide mftf test
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulRahmanAbouzaid committed Aug 26, 2020
1 parent 674324c commit 9fac5f7
Showing 1 changed file with 95 additions and 0 deletions.
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"/>
<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>

0 comments on commit 9fac5f7

Please sign in to comment.