|
| 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="BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Bundle"/> |
| 13 | + <stories value="Add bundle product to cart on storefront"/> |
| 14 | + <title value="Customer should get the right subtotal in cart when the bundle product with tier price and bundle items with fixed and percent price added to the cart"/> |
| 15 | + <description value="Customer should be able to add bundle product with tier price and bundle items with fixed and percent price to the cart and get the right price"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-26543"/> |
| 18 | + <group value="bundle"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProductForBundleItem1"> |
| 24 | + <field key="price">100.00</field> |
| 25 | + </createData> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createProductForBundleItem2"> |
| 27 | + <field key="price">100.00</field> |
| 28 | + </createData> |
| 29 | + <magentoCron groups="index" stepKey="runCronIndex"/> |
| 30 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 31 | + </before> |
| 32 | + |
| 33 | + <after> |
| 34 | + <deleteData createDataKey="createProductForBundleItem1" stepKey="deleteProductForBundleItem1"/> |
| 35 | + <deleteData createDataKey="createProductForBundleItem2" stepKey="deleteProductForBundleItem2"/> |
| 36 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundle"> |
| 37 | + <argument name="product" value="BundleProduct"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> |
| 40 | + <waitForPageLoad stepKey="waitForClearProductsGridFilters"/> |
| 41 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 42 | + </after> |
| 43 | + |
| 44 | + <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> |
| 45 | + <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> |
| 46 | + <click selector="{{AdminProductFormBundleSection.dynamicSkuToggle}}" stepKey="disableDynamicSku"/> |
| 47 | + <click selector="{{AdminProductFormBundleSection.dynamicPrice}}" stepKey="clickDynamicPriceSwitcher"/> |
| 48 | + <fillField selector="{{AdminProductFormBundleSection.priceField}}" userInput="100" stepKey="fillBundlePrice"/> |
| 49 | + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> |
| 50 | + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1"> |
| 51 | + <argument name="x" value="0"/> |
| 52 | + <argument name="n" value="1"/> |
| 53 | + <argument name="prodOneSku" value="$createProductForBundleItem1.sku$"/> |
| 54 | + <argument name="prodTwoSku" value=""/> |
| 55 | + <argument name="optionTitle" value="Option1"/> |
| 56 | + <argument name="inputType" value="checkbox"/> |
| 57 | + </actionGroup> |
| 58 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="100" stepKey="fillBundleOption1Price"/> |
| 59 | + <selectOption selector="{{AdminProductFormBundleSection.bundlePriceType}}" userInput="Percent" stepKey="selectPercentPrice"/> |
| 60 | + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption2"> |
| 61 | + <argument name="x" value="1"/> |
| 62 | + <argument name="n" value="2"/> |
| 63 | + <argument name="prodOneSku" value="$createProductForBundleItem2.sku$"/> |
| 64 | + <argument name="prodTwoSku" value=""/> |
| 65 | + <argument name="optionTitle" value="Option2"/> |
| 66 | + <argument name="inputType" value="checkbox"/> |
| 67 | + </actionGroup> |
| 68 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('1', '0')}}" userInput="100" stepKey="fillBundleOption2Price"/> |
| 69 | + <scrollToTopOfPage stepKey="scrollToTopOfTheProductPage"/> |
| 70 | + <actionGroup ref="AdminBundleProductSetAdvancedPricingActionGroup" stepKey="addProductTierPrice"> |
| 71 | + <argument name="quantity" value="1"/> |
| 72 | + <argument name="price" value="Discount"/> |
| 73 | + <argument name="amount" value="50"/> |
| 74 | + <argument name="priceView" value="As Low as"/> |
| 75 | + </actionGroup> |
| 76 | + <amOnPage url="{{StorefrontProductPage.url(BundleProduct.urlKey)}}" stepKey="goToStorefront"/> |
| 77 | + <waitForPageLoad stepKey="waitForStorefront"/> |
| 78 | + <!--Assert Bundle Product Price--> |
| 79 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.asLowAsFinalPrice}}" stepKey="grabProductPrice"/> |
| 80 | + <assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice"> |
| 81 | + <actualResult type="variable">grabProductPrice</actualResult> |
| 82 | + <expectedResult type="string">$150.00</expectedResult> |
| 83 | + </assertEquals> |
| 84 | + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddToCartButton"/> |
| 85 | + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> |
| 86 | + <argument name="quantity" value="1"/> |
| 87 | + </actionGroup> |
| 88 | + <actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart"> |
| 89 | + <argument name="subTotal" value="$150.00"/> |
| 90 | + </actionGroup> |
| 91 | + </test> |
| 92 | +</tests> |
0 commit comments