|
| 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 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontSortingByPriceForConfigurableProductWithCatalogRuleAppliedTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <stories value="View soting by price in storefront"/> |
| 15 | + <title value="Sorting by price for Configurable with Catalog Rule applied"/> |
| 16 | + <description value="Sort by price should be correct if the apply Catalog Rule to child product of configurable product"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MAGETWO-69988"/> |
| 19 | + <group value="сonfigurable_product"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + <field key="price">5.00</field> |
| 26 | + </createData> |
| 27 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct2"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + <field key="price">10.00</field> |
| 30 | + </createData> |
| 31 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 32 | + <requiredEntity createDataKey="createCategory"/> |
| 33 | + </createData> |
| 34 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 35 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 36 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 37 | + </createData> |
| 38 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 39 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 40 | + </createData> |
| 41 | + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + </createData> |
| 44 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 45 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 46 | + </createData> |
| 47 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 48 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 49 | + </getData> |
| 50 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 51 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 52 | + </getData> |
| 53 | + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> |
| 54 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 55 | + </getData> |
| 56 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 57 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 58 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 59 | + <field key="price">15.00</field> |
| 60 | + </createData> |
| 61 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 62 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 63 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 64 | + <field key="price">20.00</field> |
| 65 | + </createData> |
| 66 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> |
| 67 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 68 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 69 | + <field key="price">25.00</field> |
| 70 | + </createData> |
| 71 | + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> |
| 72 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 73 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 74 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 75 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 76 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 77 | + </createData> |
| 78 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 79 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 80 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 81 | + </createData> |
| 82 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 83 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 84 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 85 | + </createData> |
| 86 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> |
| 87 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 88 | + <requiredEntity createDataKey="createConfigChildProduct3"/> |
| 89 | + </createData> |
| 90 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 91 | + <!--SKU Product Attribute is enabled for Promo Rule Conditions--> |
| 92 | + <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> |
| 93 | + <argument name="ProductAttribute" value="sku"/> |
| 94 | + </actionGroup> |
| 95 | + <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"> |
| 96 | + <argument name="option" value="Yes"/> |
| 97 | + </actionGroup> |
| 98 | + <magentoCLI command="indexer:reindex" stepKey="reindex1"/> |
| 99 | + <magentoCLI command="cache:flush" stepKey="flushCache1"/> |
| 100 | + </before> |
| 101 | + |
| 102 | + <after> |
| 103 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 104 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 105 | + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 106 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> |
| 107 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> |
| 108 | + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> |
| 109 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 110 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 111 | + |
| 112 | + <!--SKU Product Attribute is disable for Promo Rule Conditions--> |
| 113 | + <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> |
| 114 | + <argument name="ProductAttribute" value="sku"/> |
| 115 | + </actionGroup> |
| 116 | + <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo"> |
| 117 | + <argument name="option" value="No"/> |
| 118 | + </actionGroup> |
| 119 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 120 | + </after> |
| 121 | + |
| 122 | + <!--Open category with products and Sort by price desc--> |
| 123 | + <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage"> |
| 124 | + <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> |
| 125 | + <argument name="mode" value="grid"/> |
| 126 | + <argument name="numOfProductsPerPage" value="25"/> |
| 127 | + <argument name="sortBy" value="price"/> |
| 128 | + <argument name="sort" value="desc"/> |
| 129 | + </actionGroup> |
| 130 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProduct"/> |
| 131 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo"/> |
| 132 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/> |
| 133 | + |
| 134 | + <!--Create and apply catalog price rule--> |
| 135 | + <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsSKU" stepKey="createCatalogPriceRule"> |
| 136 | + <argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" /> |
| 137 | + <argument name="productSku" value="$$createConfigChildProduct3.sku$$" /> |
| 138 | + </actionGroup> |
| 139 | + <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> |
| 140 | + <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> |
| 141 | + |
| 142 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 143 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 144 | + |
| 145 | + <!--Reopen category with products and Sort by price desc--> |
| 146 | + <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2"> |
| 147 | + <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> |
| 148 | + <argument name="mode" value="grid"/> |
| 149 | + <argument name="numOfProductsPerPage" value="9"/> |
| 150 | + <argument name="sortBy" value="price"/> |
| 151 | + <argument name="sort" value="desc"/> |
| 152 | + </actionGroup> |
| 153 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo2"/> |
| 154 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/> |
| 155 | + <see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProduct2"/> |
| 156 | + |
| 157 | + <!-- Delete the rule --> |
| 158 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/> |
| 159 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule"> |
| 160 | + <argument name="name" value="{{CatalogRuleByPercentWith96Amount.name}}"/> |
| 161 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 162 | + </actionGroup> |
| 163 | + </test> |
| 164 | +</tests> |
0 commit comments