|
| 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="EditOrderWithBundleProductBackendTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Bundle"/> |
| 14 | + <stories value="Edit order with bundle product (backend)"/> |
| 15 | + <title value="Edit order with bundle product (backend)"/> |
| 16 | + <description value="Edit order with bundle product (backend)"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4601"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + |
| 22 | + <!--Set default flat rate shipping method settings--> |
| 23 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 24 | + <!-- Create Customer Account --> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 26 | + |
| 27 | + <!-- Create Customer Account --> |
| 28 | + <createData entity="Simple_US_Customer" stepKey="createCustomer2"/> |
| 29 | + <!-- simple product1--> |
| 30 | + <createData entity="SimpleProduct" stepKey="SimpleProduct1"> |
| 31 | + <field key="price">10.00</field> |
| 32 | + </createData> |
| 33 | + |
| 34 | + <!-- simple product2 --> |
| 35 | + <createData entity="SimpleProduct" stepKey="SimpleProduct2"> |
| 36 | + <field key="price">15.00</field> |
| 37 | + </createData> |
| 38 | + |
| 39 | + <!-- simple product3--> |
| 40 | + <createData entity="SimpleProduct" stepKey="SimpleProduct3"> |
| 41 | + <field key="price">20.00</field> |
| 42 | + </createData> |
| 43 | + |
| 44 | + <!-- simple product3--> |
| 45 | + <createData entity="SimpleProduct" stepKey="SimpleProduct4"> |
| 46 | + <field key="price">25.00</field> |
| 47 | + </createData> |
| 48 | + |
| 49 | + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"/> |
| 50 | + |
| 51 | + <createData entity="CheckboxOption" stepKey="checkboxBundleOption1"> |
| 52 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 53 | + </createData> |
| 54 | + |
| 55 | + <createData entity="DropDownBundleOption" stepKey="dropDownBundleOption2"> |
| 56 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 57 | + </createData> |
| 58 | + |
| 59 | + <createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct1"> |
| 60 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 61 | + <requiredEntity createDataKey="checkboxBundleOption1"/> |
| 62 | + <requiredEntity createDataKey="SimpleProduct1"/> |
| 63 | + </createData> |
| 64 | + <createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct12"> |
| 65 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 66 | + <requiredEntity createDataKey="checkboxBundleOption1"/> |
| 67 | + <requiredEntity createDataKey="SimpleProduct2"/> |
| 68 | + </createData> |
| 69 | + |
| 70 | + <createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct21"> |
| 71 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 72 | + <requiredEntity createDataKey="dropDownBundleOption2"/> |
| 73 | + <requiredEntity createDataKey="SimpleProduct3"/> |
| 74 | + </createData> |
| 75 | + <createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct22"> |
| 76 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 77 | + <requiredEntity createDataKey="dropDownBundleOption2"/> |
| 78 | + <requiredEntity createDataKey="SimpleProduct4"/> |
| 79 | + </createData> |
| 80 | + |
| 81 | + |
| 82 | + <!-- Login as admin --> |
| 83 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 84 | + </before> |
| 85 | + <after> |
| 86 | + <!--Remove default flat rate shipping method settings--> |
| 87 | + <magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> |
| 88 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 89 | + <deleteData createDataKey="createCustomer2" stepKey="deleteCustomer2"/> |
| 90 | + |
| 91 | + <!-- Delete the simple product --> |
| 92 | + <deleteData createDataKey="SimpleProduct1" stepKey="DeleteSimpleProduct1"/> |
| 93 | + |
| 94 | + <!-- Delete the simple product --> |
| 95 | + <deleteData createDataKey="SimpleProduct2" stepKey="DeleteSimpleProduct2"/> |
| 96 | + |
| 97 | + <!-- Delete the simple product --> |
| 98 | + <deleteData createDataKey="SimpleProduct3" stepKey="DeleteSimpleProduct3"/> |
| 99 | + |
| 100 | + <!-- Delete the simple product --> |
| 101 | + <deleteData createDataKey="SimpleProduct4" stepKey="DeleteSimpleProduct4"/> |
| 102 | + |
| 103 | + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> |
| 104 | + |
| 105 | + <!-- Log out --> |
| 106 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 107 | + </after> |
| 108 | + |
| 109 | + <!--Get bundle product option.--> |
| 110 | + <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="openBundleProductEditPage"/> |
| 111 | + |
| 112 | + <!--Create new customer order.--> |
| 113 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> |
| 114 | + <argument name="customer" value="$createCustomer$"/> |
| 115 | + </actionGroup> |
| 116 | + <!--Add bundle product to order.--> |
| 117 | + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct"> |
| 118 | + <argument name="productSKU" value="$createBundleProduct.sku$"/> |
| 119 | + </actionGroup> |
| 120 | + |
| 121 | + <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown"/> |
| 122 | + |
| 123 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('2')}}" stepKey="clickToSelectOption"/> |
| 124 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="clickToCheckboxOption"/> |
| 125 | + <fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/> |
| 126 | + |
| 127 | + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> |
| 128 | + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> |
| 129 | + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> |
| 130 | + |
| 131 | + <!--Select FlatRate shipping method--> |
| 132 | + <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> |
| 133 | + |
| 134 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 135 | + <wait time="2" stepKey="waitForPageLoad1"/> |
| 136 | + <!--Create new customer order.--> |
| 137 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer2"> |
| 138 | + <argument name="customer" value="$createCustomer2$"/> |
| 139 | + </actionGroup> |
| 140 | + <!--Add bundle product to order.--> |
| 141 | + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct1"> |
| 142 | + <argument name="productSKU" value="$createBundleProduct.sku$"/> |
| 143 | + </actionGroup> |
| 144 | + <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown1"/> |
| 145 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('2')}}" stepKey="clickToSelectOption1"/> |
| 146 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="clickToCheckboxOption1"/> |
| 147 | + <fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty1"/> |
| 148 | + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover1"/> |
| 149 | + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton1"/> |
| 150 | + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts1"/> |
| 151 | + <!--Select FlatRate shipping method--> |
| 152 | + <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod1"/> |
| 153 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder1"/> |
| 154 | + <wait time="2" stepKey="waitForPageLoad2" /> |
| 155 | + <click selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="clickEditButton"/> |
| 156 | + <click selector="{{AdminOrderDetailsMainActionsSection.ok}}" stepKey="clickOk"/> |
| 157 | + <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> |
| 158 | + <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown2"/> |
| 159 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('3')}}" stepKey="clickToSelectOption2"/> |
| 160 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="deselectProduct3"/> |
| 161 | + <click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('2')}}" stepKey="clickToCheckboxOption2"/> |
| 162 | + <fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty2"/> |
| 163 | + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover2"/> |
| 164 | + <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantity"/> |
| 165 | + <grabTextFrom selector="{{AdminOrderFormItemsOrderedSection.itemsSKU('1')}}" stepKey="grabSKU"/> |
| 166 | + <grabTextFrom selector="{{AdminOrderFormItemsSection.productName}}" stepKey="grabProductName"/> |
| 167 | + |
| 168 | + <!-- Check that product total is correct --> |
| 169 | + <assertStringContainsString stepKey="AssertSKU"> |
| 170 | + <actualResult type="const">$grabSKU</actualResult> |
| 171 | + <expectedResult type="string">SKU:</expectedResult> |
| 172 | + </assertStringContainsString> |
| 173 | + |
| 174 | + <assertStringContainsString stepKey="AssertBundleProduct"> |
| 175 | + <actualResult type="const">$grabProductName</actualResult> |
| 176 | + <expectedResult type="string">$$createBundleProduct.name$$</expectedResult> |
| 177 | + </assertStringContainsString> |
| 178 | + |
| 179 | + <assertStringContainsString stepKey="AssertProduct2"> |
| 180 | + <actualResult type="const">$grabSKU</actualResult> |
| 181 | + <expectedResult type="const">$$SimpleProduct2.sku$$</expectedResult> |
| 182 | + </assertStringContainsString> |
| 183 | + |
| 184 | + <assertStringContainsString stepKey="AssertProduct4"> |
| 185 | + <actualResult type="const">$grabSKU</actualResult> |
| 186 | + <expectedResult type="const">$$SimpleProduct4.sku$$</expectedResult> |
| 187 | + </assertStringContainsString> |
| 188 | + |
| 189 | + <see userInput="$40.00" selector="{{AdminOrderTotalSection.subTotal1}}" stepKey="checkSubTotal"/> |
| 190 | + </test> |
| 191 | +</tests> |
0 commit comments