|
| 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="StorefrontConfigurableProductWithMapAndRelatedProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Msrp"/> |
| 14 | + <stories value="Minimum advertised price"/> |
| 15 | + <title value="Check related and simple products with MAP assigned to configurable product displayed correctly"/> |
| 16 | + <description value="Check related and simple products with MAP assigned to configurable product displayed correctly"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-41948"/> |
| 19 | + <useCaseId value="MC-41853"/> |
| 20 | + <group value="Msrp"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + |
| 25 | + <!--Create category--> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + |
| 28 | + <!-- Create the configurable product --> |
| 29 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <!-- Make the configurable product have two options, that are children of the default attribute set --> |
| 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="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + </createData> |
| 44 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 45 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 46 | + </getData> |
| 47 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 48 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 49 | + </getData> |
| 50 | + |
| 51 | + <!-- Create the 2 children that will be a part of the configurable product --> |
| 52 | + <createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> |
| 53 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 54 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 55 | + </createData> |
| 56 | + <createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> |
| 57 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 58 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 59 | + </createData> |
| 60 | + |
| 61 | + <!-- Assign the two products to the configurable product --> |
| 62 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 63 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 64 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 65 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 66 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 67 | + </createData> |
| 68 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 69 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 70 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 71 | + </createData> |
| 72 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 73 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 74 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 75 | + </createData> |
| 76 | + |
| 77 | + <!-- Create simple product which will be related to configurable product --> |
| 78 | + <createData entity="SimpleProduct2" stepKey="createRelatedProduct"/> |
| 79 | + |
| 80 | + <!--Enable Minimum advertised Price--> |
| 81 | + <createData entity="MsrpEnableMAP" stepKey="enableMAP"/> |
| 82 | + </before> |
| 83 | + <after> |
| 84 | + <!--Delete created data--> |
| 85 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 86 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 87 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> |
| 88 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> |
| 89 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 90 | + |
| 91 | + <!-- Delete related products --> |
| 92 | + <deleteData createDataKey="createRelatedProduct" stepKey="deleteRelatedProduct"/> |
| 93 | + |
| 94 | + <!--Disable Minimum advertised Price--> |
| 95 | + <createData entity="MsrpDisableMAP" stepKey="disableMAP"/> |
| 96 | + |
| 97 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 98 | + |
| 99 | + <!-- Reindex invalidated indices after product attribute has been created/deleted --> |
| 100 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 101 | + </after> |
| 102 | + |
| 103 | + <!-- Set Minimum Advertised Price to configurable products --> |
| 104 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstChildProductEditPage"> |
| 105 | + <argument name="productId" value="$$createConfigChildProduct1.id$$"/> |
| 106 | + </actionGroup> |
| 107 | + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForFirstChildProduct"> |
| 108 | + <argument name="advancedPrice" value="{{SimpleProductMap1.price}}"/> |
| 109 | + </actionGroup> |
| 110 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondChildProductEditPage"> |
| 111 | + <argument name="productId" value="$$createConfigChildProduct2.id$$"/> |
| 112 | + </actionGroup> |
| 113 | + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForSecondChildProduct"> |
| 114 | + <argument name="advancedPrice" value="{{SimpleProductMap2.price}}"/> |
| 115 | + </actionGroup> |
| 116 | + |
| 117 | + <!-- Add related product to configurable product --> |
| 118 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigProduct"> |
| 119 | + <argument name="product" value="$$createConfigProduct$$"/> |
| 120 | + </actionGroup> |
| 121 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> |
| 122 | + <argument name="product" value="$$createConfigProduct$$"/> |
| 123 | + </actionGroup> |
| 124 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct"> |
| 125 | + <argument name="sku" value="$$createRelatedProduct.sku$$"/> |
| 126 | + </actionGroup> |
| 127 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonConfigurableProduct"/> |
| 128 | + |
| 129 | + <!-- Set Minimum Advertised Price to related product --> |
| 130 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToRelatedProductEditPage"> |
| 131 | + <argument name="productId" value="$$createRelatedProduct.id$$"/> |
| 132 | + </actionGroup> |
| 133 | + <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setMsrpForRelatedProduct"> |
| 134 | + <argument name="advancedPrice" value="{{SimpleProductMap3.price}}"/> |
| 135 | + </actionGroup> |
| 136 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonRelatedProduct"/> |
| 137 | + |
| 138 | + <!--Go to store front and check msrp for products--> |
| 139 | + <actionGroup ref="StorefrontConfigurableProductCheckMapActionGroup" stepKey="checkMapForConfigurableProduct"> |
| 140 | + <argument name="configProductUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> |
| 141 | + <argument name="productMap1" value="{{SimpleProductMap1.price}}"/> |
| 142 | + <argument name="productAttributeOptionValue1" value="$$getConfigAttributeOption1.value$$"/> |
| 143 | + <argument name="productMap2" value="{{SimpleProductMap2.price}}"/> |
| 144 | + <argument name="productAttributeOptionValue2" value="$$getConfigAttributeOption2.value$$"/> |
| 145 | + </actionGroup> |
| 146 | + |
| 147 | + <!--Check related product map price --> |
| 148 | + <actionGroup ref="StorefrontAssertRelatedProductMapOnProductPageActionGroup" stepKey="checkMapForRelatedProduct"> |
| 149 | + <argument name="relatedProductMap" value="{{SimpleProductMap3.price}}"/> |
| 150 | + <argument name="productName" value="$createRelatedProduct.name$"/> |
| 151 | + </actionGroup> |
| 152 | + </test> |
| 153 | +</tests> |
0 commit comments