|
| 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="StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Wishlist"/> |
| 14 | + <title value="Move Configurable Product from Shopping Cart to Wishlist"/> |
| 15 | + <description value="Move Configurable Product from Shopping Cart to Wishlist"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-14211"/> |
| 18 | + <group value="wishlist"/> |
| 19 | + <group value="mtf_migrated"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create Data --> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <!-- Create an attribute with three options to be used in the first child product --> |
| 26 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 27 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 28 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 29 | + </createData> |
| 30 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 31 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 32 | + </createData> |
| 33 | + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> |
| 34 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 35 | + </createData> |
| 36 | + |
| 37 | + <!-- Add the attribute just created to default attribute set --> |
| 38 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 39 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 40 | + </createData> |
| 41 | + |
| 42 | + <!-- Get the first option of the attribute created --> |
| 43 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 44 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 45 | + </getData> |
| 46 | + |
| 47 | + <!-- Get the second option of the attribute created --> |
| 48 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 49 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 50 | + </getData> |
| 51 | + |
| 52 | + <!-- Get the third option of the attribute created --> |
| 53 | + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> |
| 54 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 55 | + </getData> |
| 56 | + |
| 57 | + <!-- Create Configurable product --> |
| 58 | + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> |
| 59 | + <requiredEntity createDataKey="createCategory"/> |
| 60 | + </createData> |
| 61 | + |
| 62 | + <!-- Create a simple product and give it the attribute with the first option --> |
| 63 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 64 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 65 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 66 | + <field key="price">10.00</field> |
| 67 | + </createData> |
| 68 | + |
| 69 | + <!--Create a simple product and give it the attribute with the second option --> |
| 70 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 71 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 72 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 73 | + <field key="price">20.00</field> |
| 74 | + </createData> |
| 75 | + |
| 76 | + <!--Create a simple product and give it the attribute with the Third option --> |
| 77 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> |
| 78 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 79 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 80 | + <field key="price">30.00</field> |
| 81 | + </createData> |
| 82 | + |
| 83 | + <!-- Create the configurable product --> |
| 84 | + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> |
| 85 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 86 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 87 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 88 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 89 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 90 | + </createData> |
| 91 | + |
| 92 | + <!-- Add the first simple product to the configurable product --> |
| 93 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 94 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 95 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 96 | + </createData> |
| 97 | + |
| 98 | + <!-- Add the second simple product to the configurable product --> |
| 99 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 100 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 101 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 102 | + </createData> |
| 103 | + |
| 104 | + <!-- Add the third simple product to the configurable product --> |
| 105 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> |
| 106 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 107 | + <requiredEntity createDataKey="createConfigChildProduct3"/> |
| 108 | + </createData> |
| 109 | + |
| 110 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 111 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 112 | + </before> |
| 113 | + <after> |
| 114 | + <!-- Delete data --> |
| 115 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 116 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> |
| 117 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/> |
| 118 | + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/> |
| 119 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/> |
| 120 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 121 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> |
| 122 | + <actionGroup ref="logout" stepKey="logout"/> |
| 123 | + </after> |
| 124 | + |
| 125 | + <!-- 1. Login as a customer --> |
| 126 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 127 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 128 | + </actionGroup> |
| 129 | + |
| 130 | + <!-- Open Product page --> |
| 131 | + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> |
| 132 | + <argument name="category" value="$$createCategory$$"/> |
| 133 | + <argument name="product" value="$$createConfigProduct$$"/> |
| 134 | + </actionGroup> |
| 135 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption1"/> |
| 136 | + <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/> |
| 137 | + |
| 138 | + <!-- Add product to the cart and Assert add product to cart success message--> |
| 139 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> |
| 140 | + <argument name="productName" value="$$createConfigProduct.name$$"/> |
| 141 | + </actionGroup> |
| 142 | + |
| 143 | + <!-- Select Mini Cart and select 'View And Edit Cart' --> |
| 144 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> |
| 145 | + |
| 146 | + <!-- Assert move product to wishlist success message --> |
| 147 | + <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> |
| 148 | + <argument name="productName" value="$$createConfigProduct.name$$"/> |
| 149 | + </actionGroup> |
| 150 | + |
| 151 | + <!-- Assert product is present in wishlist --> |
| 152 | + <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> |
| 153 | + <argument name="productName" value="$$createConfigProduct.name$$"/> |
| 154 | + <argument name="productPrice" value="$20.00"/> |
| 155 | + </actionGroup> |
| 156 | + |
| 157 | + <!-- Assert product details in Wishlist --> |
| 158 | + <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> |
| 159 | + <argument name="productName" value="$$createConfigProduct.name$$"/> |
| 160 | + <argument name="label" value="$$createConfigProductAttribute.default_value$$"/> |
| 161 | + <argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/> |
| 162 | + </actionGroup> |
| 163 | + |
| 164 | + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> |
| 165 | + </test> |
| 166 | +</tests> |
0 commit comments