|
| 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="StorefrontAddConfigurableProductWithoutConfigureToWishlistTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Wishlist"/> |
| 14 | + <title value="Delete Configurable Product from Wishlist on Frontend"/> |
| 15 | + <description value="Delete Configurable Product from Wishlist on Frontend"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MAGETWO-28874"/> |
| 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 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 26 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 27 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 28 | + </createData> |
| 29 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 30 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 31 | + </createData> |
| 32 | + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> |
| 33 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 34 | + </createData> |
| 35 | + |
| 36 | + <!-- Add the attribute just created to default attribute set --> |
| 37 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </createData> |
| 40 | + |
| 41 | + <!-- Get the first option of the attribute created --> |
| 42 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 43 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 44 | + </getData> |
| 45 | + |
| 46 | + <!-- Get the second option of the attribute created --> |
| 47 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 48 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 49 | + </getData> |
| 50 | + |
| 51 | + <!-- Get the third option of the attribute created --> |
| 52 | + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> |
| 53 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 54 | + </getData> |
| 55 | + |
| 56 | + <!-- Create Configurable product --> |
| 57 | + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> |
| 58 | + <requiredEntity createDataKey="createCategory"/> |
| 59 | + </createData> |
| 60 | + |
| 61 | + <!-- Create a simple product and give it the attribute with the first option --> |
| 62 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 63 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 64 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 65 | + <field key="price">10.00</field> |
| 66 | + </createData> |
| 67 | + |
| 68 | + <!--Create a simple product and give it the attribute with the second option --> |
| 69 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 70 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 71 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 72 | + <field key="price">20.00</field> |
| 73 | + </createData> |
| 74 | + |
| 75 | + <!--Create a simple product and give it the attribute with the Third option --> |
| 76 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> |
| 77 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 78 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 79 | + <field key="price">30.00</field> |
| 80 | + </createData> |
| 81 | + |
| 82 | + <!-- Create the configurable product --> |
| 83 | + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> |
| 84 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 85 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 86 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 87 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 88 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 89 | + </createData> |
| 90 | + |
| 91 | + <!-- Add the first simple product to the configurable product --> |
| 92 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 93 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 94 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 95 | + </createData> |
| 96 | + |
| 97 | + <!-- Add the second simple product to the configurable product --> |
| 98 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 99 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 100 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 101 | + </createData> |
| 102 | + |
| 103 | + <!-- Add the third simple product to the configurable product --> |
| 104 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> |
| 105 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 106 | + <requiredEntity createDataKey="createConfigChildProduct3"/> |
| 107 | + </createData> |
| 108 | + </before> |
| 109 | + <after> |
| 110 | + <!-- Delete data --> |
| 111 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 112 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> |
| 113 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/> |
| 114 | + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/> |
| 115 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/> |
| 116 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 117 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> |
| 118 | + <actionGroup ref="logout" stepKey="logout"/> |
| 119 | + </after> |
| 120 | + |
| 121 | + <!-- 1. Login as a customer --> |
| 122 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 123 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 124 | + </actionGroup> |
| 125 | + |
| 126 | + <!-- 2. Navigate to catalog page --> |
| 127 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openProductFromCategory"> |
| 128 | + <argument name="category" value="$$createCategory$$"/> |
| 129 | + </actionGroup> |
| 130 | + |
| 131 | + <!-- 3. Add created product to Wishlist according to dataset and assert add product to wishlist success message --> |
| 132 | + <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addProductToWishlist"> |
| 133 | + <argument name="productVar" value="$$createConfigProduct$$"/> |
| 134 | + </actionGroup> |
| 135 | + |
| 136 | + |
| 137 | + <!-- Navigate to My Account > My Wishlist --> |
| 138 | + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/> |
| 139 | + <waitForPageLoad stepKey="waitForWishlistPageLoad"/> |
| 140 | + |
| 141 | + <!-- Click "Remove item". --> |
| 142 | + <scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="scrollToProduct"/> |
| 143 | + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="mouseOverOnProduct"/> |
| 144 | + <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> |
| 145 | + |
| 146 | + <!-- Assert Wishlist is empty --> |
| 147 | + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> |
| 148 | + </test> |
| 149 | +</tests> |
0 commit comments