|
| 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="StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Bundle"/> |
| 13 | + <stories value="Placing order with bundle product"/> |
| 14 | + <title value="Order details with bundle product fixed price should show the correct price for bundle items"/> |
| 15 | + <description value="Order details with bundle product fixed price should show the correct price for bundle items"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <useCaseId value="MC-40603"/> |
| 18 | + <testCaseId value="MC-40744"/> |
| 19 | + <group value="bundle"/> |
| 20 | + <group value="catalog"/> |
| 21 | + </annotations> |
| 22 | + |
| 23 | + <before> |
| 24 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createFirstProduct"/> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createSecondProduct"/> |
| 27 | + <createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"> |
| 28 | + <field key="price">11.00</field> |
| 29 | + </createData> |
| 30 | + <createData entity="RadioButtonsOption" stepKey="createFirstBundleOption"> |
| 31 | + <field key="position">1</field> |
| 32 | + <requiredEntity createDataKey="createFixedBundleProduct"/> |
| 33 | + </createData> |
| 34 | + <createData entity="RadioButtonsOption" stepKey="createSecondBundleOption"> |
| 35 | + <field key="position">2</field> |
| 36 | + <requiredEntity createDataKey="createFixedBundleProduct"/> |
| 37 | + </createData> |
| 38 | + <createData entity="ApiBundleLink" stepKey="firstLinkOptionToFixedProduct"> |
| 39 | + <requiredEntity createDataKey="createFixedBundleProduct"/> |
| 40 | + <requiredEntity createDataKey="createFirstBundleOption"/> |
| 41 | + <requiredEntity createDataKey="createFirstProduct"/> |
| 42 | + <field key="price_type">0</field> |
| 43 | + <field key="price">7.00</field> |
| 44 | + </createData> |
| 45 | + <createData entity="ApiBundleLink" stepKey="secondLinkOptionToFixedProduct"> |
| 46 | + <requiredEntity createDataKey="createFixedBundleProduct"/> |
| 47 | + <requiredEntity createDataKey="createSecondBundleOption"/> |
| 48 | + <requiredEntity createDataKey="createSecondProduct"/> |
| 49 | + <field key="price_type">0</field> |
| 50 | + <field key="price">5.00</field> |
| 51 | + </createData> |
| 52 | + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> |
| 53 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 54 | + <argument name="productId" value="$createFixedBundleProduct.id$"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 57 | + </before> |
| 58 | + <after> |
| 59 | + <deleteData createDataKey="createFirstProduct" stepKey="deleteSimpleProductForBundleItem"/> |
| 60 | + <deleteData createDataKey="createSecondProduct" stepKey="deleteVirtualProductForBundleItem"/> |
| 61 | + <deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/> |
| 62 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 63 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> |
| 64 | + <waitForPageLoad stepKey="waitForClearProductsGridFilters"/> |
| 65 | + </after> |
| 66 | + <!--Login customer on storefront--> |
| 67 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> |
| 68 | + <argument name="Customer" value="$$createCustomer$$" /> |
| 69 | + </actionGroup> |
| 70 | + <!--Open Product Page--> |
| 71 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage"> |
| 72 | + <argument name="product" value="$createFixedBundleProduct$"/> |
| 73 | + </actionGroup> |
| 74 | + <!--Add bundle to cart--> |
| 75 | + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart"/> |
| 76 | + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> |
| 77 | + <argument name="quantity" value="1"/> |
| 78 | + </actionGroup> |
| 79 | + <!--Open bundle product in admin--> |
| 80 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 81 | + <argument name="productId" value="$createFixedBundleProduct.id$"/> |
| 82 | + </actionGroup> |
| 83 | + <!--Change price of the first option--> |
| 84 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="9" stepKey="fillBundleOption1Price"/> |
| 85 | + <!--Save the bundle product--> |
| 86 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 87 | + <!--Open Product Page--> |
| 88 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage2"> |
| 89 | + <argument name="product" value="$createFixedBundleProduct$"/> |
| 90 | + </actionGroup> |
| 91 | + <!--Add bundle to cart--> |
| 92 | + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart2"/> |
| 93 | + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart2"> |
| 94 | + <argument name="quantity" value="1"/> |
| 95 | + </actionGroup> |
| 96 | + <!--Verify bundle product details--> |
| 97 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCart"/> |
| 98 | + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('1')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInShoppingCart"/> |
| 99 | + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('1')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInShoppingCart"/> |
| 100 | + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('2')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInShoppingCart"/> |
| 101 | + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('2')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInShoppingCart"/> |
| 102 | + <!--Verify total--> |
| 103 | + <grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabShoppingCartTotal"/> |
| 104 | + <assertEquals stepKey="verifyGrandTotalOnShoppingCartPage"> |
| 105 | + <actualResult type="variable">grabShoppingCartTotal</actualResult> |
| 106 | + <expectedResult type="string">$60.00</expectedResult> |
| 107 | + </assertEquals> |
| 108 | + |
| 109 | + <!--Navigate to checkout--> |
| 110 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> |
| 111 | + <!--Click next button to open payment section--> |
| 112 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> |
| 113 | + <!--Click place order--> |
| 114 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 115 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 116 | + <!--Navigate to order details page in custom account--> |
| 117 | + <amOnPage url="{{StorefrontCustomerOrderViewPage.url({$grabOrderNumber})}}" stepKey="amOnOrderPage"/> |
| 118 | + <!--Verify bundle order items details--> |
| 119 | + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInCustomerOrderItems"/> |
| 120 | + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInCustomerOrderItems"/> |
| 121 | + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInCustomerOrderItems"/> |
| 122 | + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInCustomerOrderItems"/> |
| 123 | + <!--Navigate to order details page on admin--> |
| 124 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> |
| 125 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 126 | + </actionGroup> |
| 127 | + <!--Verify bundle order items details--> |
| 128 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInAdminOrderItems"/> |
| 129 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$" stepKey="seeOptionValueInAdminOrderItems"/> |
| 130 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('3')}}" userInput="$9.00" stepKey="seeOptionPriceInAdminOrderItems"/> |
| 131 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInAdminOrderItems"/> |
| 132 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$" stepKey="seeOption2ValueInAdminOrderItems"/> |
| 133 | + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('5')}}" userInput="$5.00" stepKey="seeOption2PriceInAdminOrderItems"/> |
| 134 | + <!--Verify total--> |
| 135 | + <grabTextFrom selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="grabAdminOrderTotal"/> |
| 136 | + <assertEquals stepKey="verifyGrandTotalOnAdminOrderPage"> |
| 137 | + <actualResult type="variable">grabAdminOrderTotal</actualResult> |
| 138 | + <expectedResult type="string">$60.00</expectedResult> |
| 139 | + </assertEquals> |
| 140 | + </test> |
| 141 | +</tests> |
0 commit comments