|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Shopping Cart"/> |
| 13 | + <title value="Create Grouped product and verify mini cart action with disabled and enable Mini Cart Sidebar"/> |
| 14 | + <description value="Create Grouped product and verify mini cart action with disabled and enable Mini Cart Sidebar"/> |
| 15 | + <testCaseId value="MC-14719"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <group value="mtf_migrated"/> |
| 18 | + </annotations> |
| 19 | + |
| 20 | + <before> |
| 21 | + <magentoCLI stepKey="disableShoppingCartSidebar" command="config:set checkout/sidebar/display 0"/> |
| 22 | + <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> |
| 23 | + <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> |
| 24 | + |
| 25 | + <!--Create simple products--> |
| 26 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> |
| 27 | + <field key="price">10.00</field> |
| 28 | + </createData> |
| 29 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> |
| 30 | + <field key="price">50.00</field> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <!--Create Bundle product--> |
| 34 | + <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> |
| 35 | + <requiredEntity createDataKey="createSubCategory"/> |
| 36 | + </createData> |
| 37 | + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> |
| 38 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 39 | + <field key="required">True</field> |
| 40 | + </createData> |
| 41 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> |
| 42 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 43 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 44 | + <requiredEntity createDataKey="simpleProduct1"/> |
| 45 | + </createData> |
| 46 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> |
| 47 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 48 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 49 | + <requiredEntity createDataKey="simpleProduct2"/> |
| 50 | + </createData> |
| 51 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 52 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 53 | + </before> |
| 54 | + <after> |
| 55 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> |
| 56 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> |
| 57 | + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> |
| 58 | + <deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/> |
| 59 | + <magentoCLI stepKey="disableShoppingCartSidebar" command="config:set checkout/sidebar/display 1"/> |
| 60 | + </after> |
| 61 | + |
| 62 | + <!--Open Product page in StoreFront and assert product and price range --> |
| 63 | + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> |
| 64 | + <argument name="product" value="$$createBundleProduct$$"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> |
| 67 | + <argument name="selector" value="{{StorefrontProductInfoMainSection.priceFrom}}"/> |
| 68 | + <argument name="userInput" value="From $10.00"/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible1"> |
| 71 | + <argument name="selector" value="{{StorefrontProductInfoMainSection.priceTo}}"/> |
| 72 | + <argument name="userInput" value="To $50.00"/> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!-- Add Bundle dynamic product to the cart --> |
| 76 | + <actionGroup ref="StorefrontAddBundleProductToTheCartActionGroup" stepKey="addBundleDynamicProductToTheCart"> |
| 77 | + <argument name="productName" value="$$simpleProduct2.name$$"/> |
| 78 | + <argument name="quantity" value="2"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!-- Select Mini Cart, verify it doen't open --> |
| 82 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> |
| 83 | + <dontSeeElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="dontSeeViewAndEditCart"/> |
| 84 | + |
| 85 | + <!--Assert Product items in cart --> |
| 86 | + <actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct1ItemsInCheckOutCart"> |
| 87 | + <argument name="productName" value="$$createBundleProduct.name$$"/> |
| 88 | + <argument name="productSku" value="$$createBundleProduct.sku$$"/> |
| 89 | + <argument name="productPrice" value="$50.00"/> |
| 90 | + <argument name="subtotal" value="$100.00" /> |
| 91 | + <argument name="qty" value="2"/> |
| 92 | + </actionGroup> |
| 93 | + |
| 94 | + <!-- Assert Grouped product with option is displayed in cart --> |
| 95 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductOptionTitle"> |
| 96 | + <argument name="selector" value="{{CheckoutCartProductSection.productOptionLabel}}"/> |
| 97 | + <argument name="userInput" value="$$createBundleOption1_1.title$$"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductOptionInCart"> |
| 100 | + <argument name="selector" value="{{CheckoutCartProductSection.productOptionLabel}}"/> |
| 101 | + <argument name="userInput" value="1 x $$simpleProduct2.name$$ $50.00"/> |
| 102 | + </actionGroup> |
| 103 | + |
| 104 | + <!--Assert Shopping Cart Summary--> |
| 105 | + <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > |
| 106 | + <argument name="subtotal" value="$100.00"/> |
| 107 | + <argument name="shipping" value="$10.00"/> |
| 108 | + <argument name="total" value="$110.00"/> |
| 109 | + </actionGroup> |
| 110 | + |
| 111 | + <!--Enabled Shopping Cart Sidebar --> |
| 112 | + <magentoCLI stepKey="enableShoppingCartSidebar" command="config:set checkout/sidebar/display 1"/> |
| 113 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 114 | + <reloadPage stepKey="reloadThePage"/> |
| 115 | + |
| 116 | + <!--Click on mini cart--> |
| 117 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart1"/> |
| 118 | + |
| 119 | + <!--Assert mini cart can open and check mini cart items --> |
| 120 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProductInMiniCart1"> |
| 121 | + <argument name="productName" value="$$createBundleProduct.name$$"/> |
| 122 | + <argument name="productPrice" value="$50.00"/> |
| 123 | + <argument name="cartSubtotal" value="$100.00" /> |
| 124 | + <argument name="qty" value="2"/> |
| 125 | + </actionGroup> |
| 126 | + </test> |
| 127 | +</tests> |
0 commit comments