Skip to content

Commit 42a430e

Browse files
committed
Merge remote-tracking branch 'adobe-commerce-tier-4/ACP2E-3233' into Tier4-Kings-PR-10-14-2024
2 parents d61a230 + 8b6018f commit 42a430e

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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>

app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,13 @@ script;
9292
<?= /* @noEscape */
9393
$secureRenderer->renderTag('script', [], $scriptString, false) ?>
9494
<?php else: ?>
95-
<div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?></div>
95+
<div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?>
96+
<span class="no-display">
97+
<input id="p_method"
98+
value=""
99+
type="text"
100+
name="payment[method]" class="admin__control-radio"
101+
checked="checked"/>
102+
</span>
103+
</div>
96104
<?php endif; ?>

0 commit comments

Comments
 (0)