|
| 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="AdminCreateOrderWithSimpleProductWithoutPaymentTest"> |
| 12 | + <annotations> |
| 13 | + <title value="Create Order in Admin with simple product"/> |
| 14 | + <stories value="ACP2E-3233: Admin can still place order even without payment method."/> |
| 15 | + <description value="Create order with simple product and assert if it gets out of stock after ordering it."/> |
| 16 | + <features value="Sales"/> |
| 17 | + <testCaseId value="AC-13220"/> |
| 18 | + <severity value="AVERAGE"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Disable payment method one of "Check/Money Order" and "Zero Subtotal Checkout" --> |
| 22 | + <magentoCLI command="config:set payment/checkmo/active 0" stepKey="disabledCheckMoneyOrderValue"/> |
| 23 | + <magentoCLI command="config:set payment/free/active 0" stepKey="disableZeroSubtotalCheckoutConfigData"/> |
| 24 | + <magentoCLI command="config:set payment/cashondelivery/max_order_total 100" stepKey="cashOnDeliveryMaximumOrderTotalConfigData"/> |
| 25 | + <magentoCLI command="config:set payment/cashondelivery/min_order_total 1" stepKey="cashOnDeliveryMinimumOrderTotalConfigData"/> |
| 26 | + |
| 27 | + <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> |
| 28 | + <createData entity="CashOnDeliveryPaymentMethodDefault" stepKey="cashOnDeliveryPaymentMethod"/> |
| 29 | + <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> |
| 30 | + <createData entity="SimpleProduct_25" stepKey="simpleProduct"> |
| 31 | + <field key="price">10</field> |
| 32 | + </createData> |
| 33 | + |
| 34 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 35 | + </before> |
| 36 | + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> |
| 37 | + <argument name="customer" value="$$simpleCustomer$$"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> |
| 40 | + <argument name="product" value="$$simpleProduct$$"/> |
| 41 | + <argument name="productQty" value="1"/> |
| 42 | + </actionGroup> |
| 43 | + |
| 44 | + <!--Click *Custom Price* link, enter 0 and click *Update Items and Quantities* button--> |
| 45 | + <waitForPageLoad stepKey="waitForProductLoad"/> |
| 46 | + <fillField selector="{{AdminCustomerCreateNewOrderSection.productQty}}" userInput="{{ApiSimpleProduct.quantity}}" stepKey="fillProductQty"/> |
| 47 | + <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/> |
| 48 | + |
| 49 | + <actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/> |
| 50 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> |
| 51 | + <actionGroup ref="AdminCheckoutSelectCheckMoneyOrderBillingMethodActionGroup" stepKey="selectBillingMethod"/> |
| 52 | + |
| 53 | + <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 54 | + <see selector="{{AdminOrderFormMessagesSection.error}}" userInput="The payment method you requested is not available." stepKey="seeErrorMessage"/> |
| 55 | + <after> |
| 56 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 57 | + <!-- Enable payment method one of "Check/Money Order" and "Zero Subtotal Checkout" --> |
| 58 | + <magentoCLI command="config:set payment/checkmo/active 1" stepKey="enabledCheckMoneyOrderValue"/> |
| 59 | + <magentoCLI command="config:set payment/free/active 1" stepKey="enabledZeroSubtotalCheckoutConfigData"/> |
| 60 | + <magentoCLI command="config:set payment/cashondelivery/max_order_total 0" stepKey="cashOnDeliveryMaximumOrderTotalConfigData"/> |
| 61 | + <magentoCLI command="config:set payment/cashondelivery/min_order_total 0" stepKey="cashOnDeliveryMinimumOrderTotalConfigData"/> |
| 62 | + <magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disableCashOnDeliveryMethod"/> |
| 63 | + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> |
| 64 | + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> |
| 65 | + </after> |
| 66 | + </test> |
| 67 | +</tests> |
0 commit comments