|
| 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="StorefrontAddBundleProductToWishlistTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Wishlist"/> |
| 14 | + <title value="Add bundle product to wishlist"/> |
| 15 | + <description value="Add Bundle Product to Wishlist and verify Bundle Options are preserved"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <group value="wishlist"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Create Data --> |
| 21 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 22 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> |
| 24 | + <field key="price">100.00</field> |
| 25 | + </createData> |
| 26 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> |
| 27 | + <field key="price">20.00</field> |
| 28 | + </createData> |
| 29 | + <!--Create Bundle product--> |
| 30 | + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + </createData> |
| 33 | + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> |
| 34 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 35 | + </createData> |
| 36 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> |
| 37 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 38 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 39 | + <requiredEntity createDataKey="simpleProduct1"/> |
| 40 | + </createData> |
| 41 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> |
| 42 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 43 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 44 | + <requiredEntity createDataKey="simpleProduct2"/> |
| 45 | + </createData> |
| 46 | +<!-- <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>--> |
| 47 | +<!-- <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct">--> |
| 48 | +<!-- <argument name="productId" value="$$createBundleProduct.id$$"/>--> |
| 49 | +<!-- </actionGroup>--> |
| 50 | +<!-- <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/>--> |
| 51 | +<!-- <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/>--> |
| 52 | +<!-- <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>--> |
| 53 | + |
| 54 | + <magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/> |
| 55 | + </before> |
| 56 | + <after> |
| 57 | + <!-- Delete data --> |
| 58 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 59 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 60 | + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> |
| 61 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> |
| 62 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> |
| 63 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 64 | + </after> |
| 65 | + |
| 66 | + <!-- 1. Login as a customer --> |
| 67 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 68 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 69 | + </actionGroup> |
| 70 | + |
| 71 | + <!-- Open Product page --> |
| 72 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> |
| 73 | + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> |
| 76 | + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/> |
| 77 | + <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> |
| 78 | + |
| 79 | + <!-- Add product to the wishlist --> |
| 80 | + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> |
| 81 | + <argument name="productVar" value="$$createBundleProduct$$"/> |
| 82 | + </actionGroup> |
| 83 | + |
| 84 | + <!-- Assert product is present in wishlist --> |
| 85 | + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> |
| 86 | + <argument name="productName" value="$$createBundleProduct.name$$"/> |
| 87 | + <argument name="productPrice" value="$100.00"/> |
| 88 | + </actionGroup> |
| 89 | + |
| 90 | + <!-- Assert product details in wishlist --> |
| 91 | + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> |
| 92 | + <argument name="productName" value="$$createBundleProduct.name$$"/> |
| 93 | + <argument name="label" value="$$createBundleOption1_1.title$$"/> |
| 94 | + <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> |
| 95 | + </actionGroup> |
| 96 | + |
| 97 | + <!-- Assert product cart is empty --> |
| 98 | + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> |
| 99 | + </test> |
| 100 | +</tests> |
0 commit comments