|
| 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="StorefrontReorderAsCustomerCustomPrice"> |
| 11 | + <annotations> |
| 12 | + <stories value="Reorder"/> |
| 13 | + <title value="Make reorder as customer on frontend"/> |
| 14 | + <description value="Make reorder with custom product price on frontend"/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <testCaseId value="AC-7712"/> |
| 17 | + <group value="sales"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!--Enable flat rate shipping--> |
| 21 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" |
| 22 | + stepKey="enableFlatRate"/> |
| 23 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 25 | + <field key="price">100.00</field> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + |
| 29 | + <!-- Create Customer Account --> |
| 30 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <!-- Disable shipping method for customer with default address --> |
| 34 | + <magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="LogoutAsAdmin"/> |
| 36 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 37 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 38 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 39 | + </after> |
| 40 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 41 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> |
| 42 | + |
| 43 | + <!--Create new order--> |
| 44 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="CreateNewOrder"> |
| 45 | + <argument name="customer" value="Simple_US_Customer"/> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!--Click on "Add products by SKU" button > Type SKU > And add it to order without qty value--> |
| 49 | + <click selector="{{AdminOrderFormItemsOrderedSection.addProductsBySku}}" stepKey="clickAddProductsBySKUButton"/> |
| 50 | + <waitForElementVisible stepKey="waitForElementVisible" selector="{{AdminOrderFormItemsSection.skuNumber('0')}}"/> |
| 51 | + <fillField selector="{{AdminOrderFormItemsSection.skuNumber('0')}}" stepKey="typeCreatedProductGroupSKU" userInput="$$createSimpleProduct.sku$$"/> |
| 52 | + <fillField selector="{{AdminOrderFormItemsSection.qty('0')}}" stepKey="setOrderItemQuantity" userInput="1"/> |
| 53 | + <pressKey selector="{{AdminOrderFormItemsSection.skuNumber('0')}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressKey"/> |
| 54 | + <waitForPageLoad stepKey="WaitForProductAdd"/> |
| 55 | + <waitForLoadingMaskToDisappear stepKey="wait1"/> |
| 56 | + |
| 57 | + <!-- Set product custom price --> |
| 58 | + <click selector="{{OrdersGridSection.customPrice($$createSimpleProduct.name$$)}}" stepKey="ClickOnCustomPrice"/> |
| 59 | + <fillField selector="{{OrdersGridSection.customPriceInput($$createSimpleProduct.name$$)}}" userInput="10.00" stepKey="FillCustomPrice"/> |
| 60 | + <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantities"/> |
| 61 | + <waitForPageLoad stepKey="waitForItemsAndQuantitesUpdating"/> |
| 62 | + |
| 63 | + <!--Select FlatRate shipping method--> |
| 64 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> |
| 65 | + |
| 66 | + <!--Submit order--> |
| 67 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> |
| 68 | + <waitForPageLoad stepKey="WaitForOrderSubmit"/> |
| 69 | + |
| 70 | + <!--Login customer on storefront--> |
| 71 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> |
| 72 | + <argument name="Customer" value="$$createCustomer$$" /> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!-- Go to my Orders page --> |
| 76 | + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="onMyAccount"/> |
| 77 | + <waitForPageLoad stepKey="waitForAccountPage"/> |
| 78 | + <click selector="{{StorefrontCustomerSidebarSection.sidebarTab('My Orders')}}" stepKey="clickOnMyOrders"/> |
| 79 | + <waitForPageLoad stepKey="waitForOrdersLoad"/> |
| 80 | + |
| 81 | + <!-- Clicking on Reorder link from Order Details Tab --> |
| 82 | + <click selector="{{StorefrontCustomerOrderViewSection.reorder}}" stepKey="clickReorder"/> |
| 83 | + |
| 84 | + <!-- Validate product subtotal --> |
| 85 | + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssertCart"> |
| 86 | + <argument name="subtotal" value="100.00"/> |
| 87 | + <argument name="shipping" value="5.00"/> |
| 88 | + <argument name="shippingMethod" value="Flat Rate - Fixed"/> |
| 89 | + <argument name="total" value="105.00"/> |
| 90 | + </actionGroup> |
| 91 | + </test> |
| 92 | +</tests> |
0 commit comments