Skip to content

Commit 53bd497

Browse files
ENGCOM-8091: Issue #27925, moved the submit button to the inside of the <form> #28172
2 parents 6ae4ea8 + 1d460d1 commit 53bd497

File tree

6 files changed

+192
-23
lines changed

6 files changed

+192
-23
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CheckoutSelectPurchaseOrderPaymentActionGroup">
12+
<annotations>
13+
<description>Selects the 'Purchase Order' Payment Method on the Storefront Checkout page.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="purchaseOrderNumber" type="string"/>
18+
</arguments>
19+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
<remove keyForRemoval="checkCheckMoneyOption"/>
22+
<conditionalClick selector="{{CheckoutPaymentSection.purchaseOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.purchaseOrderPayment}}" visible="true" stepKey="checkPurchaseOrderOption"/>
23+
<fillField selector="{{StorefrontCheckoutPaymentMethodSection.purchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/>
24+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<element name="cartItemsArea" type="button" selector="div.block.items-in-cart"/>
3333
<element name="cartItemsAreaActive" type="textarea" selector="div.block.items-in-cart.active" timeout="30"/>
3434
<element name="checkMoneyOrderPayment" type="radio" selector="input#checkmo.radio" timeout="30"/>
35+
<element name="purchaseOrderPayment" type="radio" selector="input#purchaseorder.radio" timeout="30"/>
3536
<element name="placeOrder" type="button" selector=".payment-method._active button.action.primary.checkout" timeout="30"/>
3637
<element name="placeOrderWithoutTimeout" type="button" selector=".payment-method._active button.action.primary.checkout"/>
3738
<element name="paymentSectionTitle" type="text" selector="//*[@id='checkout-payment-method-load']//div[@data-role='title']" />
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
11+
<test name="StorefrontCheckoutWithPurchaseOrderNumberPressKeyEnterTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Checkout with Purchase Order Payment. Create Order with Press Key Enter."/>
15+
<title value="Create Checkout with purchase order payment method test. Press key Enter on field Purchase Order Number for create Order."/>
16+
<description value="Create Checkout with purchase order payment method. Press key Enter on field Purchase Order Number for create Order."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-37227"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
24+
25+
<!-- Enable payment method -->
26+
<magentoCLI command="config:set {{PurchaseOrderEnableConfigData.path}} {{PurchaseOrderEnableConfigData.value}}" stepKey="enablePaymentMethod"/>
27+
</before>
28+
29+
<after>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
31+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
32+
33+
<!-- Disable payment method -->
34+
<magentoCLI command="config:set {{PurchaseOrderDisabledConfigData.path}} {{PurchaseOrderDisabledConfigData.value}}" stepKey="disablePaymentMethod"/>
35+
</after>
36+
37+
<!--Go to product page-->
38+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
39+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
40+
41+
<!--Add Product to Shopping Cart-->
42+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
43+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
44+
</actionGroup>
45+
46+
<!--Go to Checkout-->
47+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
48+
49+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
50+
<argument name="customerVar" value="CustomerEntityOne"/>
51+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
52+
</actionGroup>
53+
54+
<!-- Checkout select Purchase Order payment -->
55+
<actionGroup ref="CheckoutSelectPurchaseOrderPaymentActionGroup" stepKey="selectPurchaseOrderPayment">
56+
<argument name="purchaseOrderNumber" value="12345"/>
57+
</actionGroup>
58+
59+
<!--Press Key ENTER-->
60+
<pressKey selector="{{StorefrontCheckoutPaymentMethodSection.purchaseOrderNumber}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressKeyEnter"/>
61+
<waitForPageLoad stepKey="waitForPageLoad"/>
62+
63+
<!--See success messages-->
64+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
65+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
66+
67+
</test>
68+
69+
</tests>
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontCheckoutWithPurchaseOrderNumberTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Checkout with Purchase Order Payment"/>
14+
<title value="Create Checkout with purchase order payment method test"/>
15+
<description value="Create Checkout with purchase order payment method"/>
16+
<severity value="MAJOR"/>
17+
<group value="checkout"/>
18+
</annotations>
19+
20+
<before>
21+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
22+
23+
<!-- Enable payment method -->
24+
<magentoCLI command="config:set {{PurchaseOrderEnableConfigData.path}} {{PurchaseOrderEnableConfigData.value}}" stepKey="enablePaymentMethod"/>
25+
</before>
26+
27+
<after>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
29+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
30+
31+
<!-- Disable payment method -->
32+
<magentoCLI command="config:set {{PurchaseOrderDisabledConfigData.path}} {{PurchaseOrderDisabledConfigData.value}}" stepKey="disablePaymentMethod"/>
33+
</after>
34+
35+
<!--Go to product page-->
36+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
37+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
38+
39+
<!--Add Product to Shopping Cart-->
40+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
41+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
42+
</actionGroup>
43+
44+
<!--Go to Checkout-->
45+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
46+
47+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
48+
<argument name="customerVar" value="CustomerEntityOne"/>
49+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
50+
</actionGroup>
51+
52+
<!-- Checkout select Purchase Order payment -->
53+
<actionGroup ref="CheckoutSelectPurchaseOrderPaymentActionGroup" stepKey="selectPurchaseOrderPayment">
54+
<argument name="purchaseOrderNumber" value="12345"/>
55+
</actionGroup>
56+
57+
<!--Click Place Order button-->
58+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
59+
<waitForPageLoad stepKey="waitForPageLoad"/>
60+
61+
<!--See success messages-->
62+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
63+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
64+
65+
</test>
66+
67+
</tests>

app/code/Magento/OfflinePayments/view/frontend/web/template/payment/purchaseorder-form.html

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,29 @@
4242
</div>
4343
</div>
4444
</fieldset>
45-
</form>
46-
<div class="checkout-agreements-block">
47-
<!-- ko foreach: $parent.getRegion('before-place-order') -->
48-
<!-- ko template: getTemplate() --><!-- /ko -->
49-
<!--/ko-->
50-
</div>
51-
<div class="actions-toolbar" id="review-buttons-container">
52-
<div class="primary">
53-
<button class="action primary checkout"
54-
type="submit"
55-
data-bind="
56-
click: placeOrder,
57-
attr: {title: $t('Place Order')},
58-
enable: (getCode() == isChecked()),
59-
css: {disabled: !isPlaceOrderActionAllowed()}
60-
"
61-
data-role="review-save">
62-
<span data-bind="i18n: 'Place Order'"></span>
63-
</button>
45+
46+
<div class="checkout-agreements-block">
47+
<!-- ko foreach: $parent.getRegion('before-place-order') -->
48+
<!-- ko template: getTemplate() --><!-- /ko -->
49+
<!--/ko-->
6450
</div>
65-
</div>
51+
52+
<div class="actions-toolbar" id="review-buttons-container">
53+
<div class="primary">
54+
<button class="action primary checkout"
55+
type="submit"
56+
data-bind="
57+
click: placeOrder,
58+
attr: {title: $t('Place Order')},
59+
enable: (getCode() == isChecked()),
60+
css: {disabled: !isPlaceOrderActionAllowed()}
61+
"
62+
data-role="review-save">
63+
<span data-bind="i18n: 'Place Order'"></span>
64+
</button>
65+
</div>
66+
</div>
67+
</form>
6668
</div>
6769
</div>
68-
70+

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
form {
5050
&.form-purchase-order {
5151
margin-bottom: 15px;
52+
53+
.input-text {
54+
width: 40%;
55+
}
5256
}
5357
}
5458
}
@@ -119,7 +123,7 @@
119123
margin: 0 0 @indent__base;
120124

121125
.primary {
122-
.action-update {
126+
.action-update {
123127
margin-bottom: 20px;
124128
margin-right: 0;
125129
}
@@ -133,7 +137,7 @@
133137
.lib-css(line-height, @checkout-billing-address-details__line-height);
134138
.lib-css(padding, @checkout-billing-address-details__padding);
135139
}
136-
140+
137141
input[type="checkbox"] {
138142
vertical-align: top;
139143
}

0 commit comments

Comments
 (0)