|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<!-- Test XML Example --> |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminGridFilterRemoveErrorMessageBeforeApplyFilters"> |
| 11 | + <annotations> |
| 12 | + <stories value="Reset Error Messages"/> |
| 13 | + <title value="Remove Error Message Before Apply Filters"/> |
| 14 | + <description value="Test log in to uI and Remove Error Message Before Apply Filters"/> |
| 15 | + <testCaseId value="MC-142721"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <group value="uI"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set system/backup/functionality_enabled 1" stepKey="setEnableBackupToYes"/> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <createData entity="NewRootCategory" stepKey="rootCategory"/> |
| 25 | + <createData entity="defaultSimpleProduct" stepKey="createProduct"> |
| 26 | + <requiredEntity createDataKey="rootCategory" /> |
| 27 | + </createData> |
| 28 | + <createData entity="defaultSimpleProduct" stepKey="createProduct2"> |
| 29 | + <requiredEntity createDataKey="rootCategory" /> |
| 30 | + </createData> |
| 31 | + <!-- <createData entity="_defaultStore" stepKey="defaultStore"/> --> |
| 32 | + |
| 33 | + <!--Create website--> |
| 34 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> |
| 35 | + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> |
| 36 | + <argument name="websiteCode" value="{{customWebsite.code}}"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Create second store --> |
| 39 | + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> |
| 40 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 41 | + <argument name="store" value="{{customStoreGroup.name}}"/> |
| 42 | + <argument name="rootCategory" value="$$rootCategory.name$$"/> |
| 43 | + </actionGroup> |
| 44 | + <!-- Create second store view --> |
| 45 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 46 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 47 | + <argument name="customStore" value="customStoreEN"/> |
| 48 | + </actionGroup> |
| 49 | + </before> |
| 50 | + <after> |
| 51 | + <magentoCLI command="config:set system/backup/functionality_enabled 0" stepKey="setEnableBackupToNo"/> |
| 52 | + <deleteData stepKey="deleteRootCategory" createDataKey="rootCategory"/> |
| 53 | + <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> |
| 54 | + <deleteData stepKey="deleteProduct2" createDataKey="createProduct2"/> |
| 55 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!--Filter created simple product in grid and add category and website created in create data--> |
| 59 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> |
| 60 | + <waitForPageLoad stepKey="waitForProductCatalogPage"/> |
| 61 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> |
| 62 | + <argument name="product" value="$$createProduct2$$"/> |
| 63 | + </actionGroup> |
| 64 | + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> |
| 65 | + <waitForPageLoad stepKey="waitUntilProductIsOpened"/> |
| 66 | + <actionGroup ref="AddWebsiteToProductActionGroup" stepKey="updateSimpleProductAddingWebsiteCreated"> |
| 67 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!--Search updated simple product(from above step) in the grid by StoreView and Name--> |
| 71 | + <actionGroup ref="FilterProductInGridByStoreViewAndNameActionGroup" stepKey="searchCreatedSimpleProductInGrid"> |
| 72 | + <argument name="storeView" value="{{customStoreEN.name}}"/> |
| 73 | + <argument name="productName" value="$$createProduct2.name$$"/> |
| 74 | + </actionGroup> |
| 75 | + |
| 76 | + <!--Go to stores and delete website created in create data--> |
| 77 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 78 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!--Go to grid page and verify AssertErrorMessage--> |
| 82 | + <actionGroup ref="AssertErrorMessageAfterDeletingWebsiteActionGroup" stepKey="verifyErrorMessage"> |
| 83 | + <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> |
| 84 | + </actionGroup> |
| 85 | + |
| 86 | + <!--Apply new filters to verify error message is removed --> |
| 87 | + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> |
| 88 | + <click selector="{{AdminProductGridFilterSection.storeViewDropdown('Default Store View')}}" stepKey="clickStoreViewDropdown"/> |
| 89 | + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="$$createProduct.name$$" stepKey="fillProductNameInNameFilter"/> |
| 90 | + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> |
| 91 | + <see selector="{{AdminProductGridFilterSection.nthRow('1')}}" userInput="$$createProduct.name$$" stepKey="seeFirstRowToVerifyProductVisibleInGrid"/> |
| 92 | + <dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage"/> |
| 93 | + |
| 94 | + </test> |
| 95 | +</tests> |
0 commit comments