Skip to content

Commit 6fb9980

Browse files
committed
ACP2E-4001: Cancel invoice redirects to 404
1 parent 522ffad commit 6fb9980

File tree

4 files changed

+127
-1
lines changed

4 files changed

+127
-1
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminPayPalExpressCheckoutCancelInvoiceNotCaptureTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Invoice for Online Payment"/>
14+
<title value="Cancel No Capture Invoice for Online Payment"/>
15+
<description value="Cancel invoice when online payment has not capture invoice"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-15016"/>
18+
<useCaseId value="ACP2E-4001"/>
19+
<!-- <group value="3rd_party_integration"/>
20+
<group value="paypalExpress"/>
21+
<group value="pr_exclude"/>
22+
-->
23+
</annotations>
24+
<before>
25+
<!-- Simple product is created -->
26+
<createData entity="SimpleProduct" stepKey="createProduct">
27+
<field key="price">10.00</field>
28+
</createData>
29+
<!-- US Customer is created -->
30+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
32+
</before>
33+
<after>
34+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
35+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
36+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
37+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
38+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
39+
</after>
40+
<!-- Go to StoreFront -->
41+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
42+
<!-- Add product to cart -->
43+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
44+
<argument name="product" value="$$createProduct$$"/>
45+
</actionGroup>
46+
<!-- Goto Checkout Page -->
47+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
48+
<!--Fill Shipping Address-->
49+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress">
50+
<argument name="customer" value="$$createCustomer$$" />
51+
<argument name="address" value="US_Address_TX"/>
52+
</actionGroup>
53+
<!-- Select shipping -->
54+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatRate">
55+
<argument name="shippingMethodName" value="Flat Rate"/>
56+
</actionGroup>
57+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
58+
<!-- Click on PayPal payment radio button -->
59+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
60+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
61+
<!-- <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
62+
-->
63+
<!-- Login to Paypal in-context and verify order total on paypal page-->
64+
<!-- <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
65+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
66+
-->
67+
<!-- I see order successful Page -->
68+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>
69+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
70+
<waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/>
71+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
72+
<argument name="orderId" value="{$grabOrderNumber}"/>
73+
</actionGroup>
74+
<waitForElementVisible selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
75+
<grabTextFrom selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
76+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$15.00" stepKey="checkGrandTotal"/>
77+
<!-- Create invoice with not capture amount -->
78+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoicebtn"/>
79+
<actionGroup ref="AdminCreateInvoiceNotCaptureActionGroup" stepKey="createInvoiceNotCapture"/>
80+
<!-- Open invoice and cancel it -->
81+
<actionGroup ref="AdminOpenInvoiceFromOrderPageActionGroup" stepKey="openInvoiceFromOrderPage"/>
82+
<actionGroup ref="AdminClickCancelButtonInInvoiceActionGroup" stepKey="clickCancelInvoiceButton"/>
83+
<waitForPageLoad stepKey="waitForLoadPage2"/>
84+
<waitForText userInput="You canceled the invoice." stepKey="seeMessageInvoiceCanceled"/>
85+
</test>
86+
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminClickCancelButtonInInvoiceActionGroup">
12+
<annotations>
13+
<description>Admin clicks cancel button on invoice page.</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{AdminInvoiceMainActionsSection.cancel}}" stepKey="waitForHoldButtonToBeClickable"/>
16+
<click selector="{{AdminInvoiceMainActionsSection.cancel}}" stepKey="clickCancelButton"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminCreateInvoiceNotCaptureActionGroup">
12+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/>
13+
<waitForPageLoad stepKey="waitForInvoicePage"/>
14+
<scrollTo selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" x="0" y="-80" stepKey="scrollToAmount"/>
15+
<selectOption userInput="Not Capture" selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" stepKey="selectNotCaptureUnderAmount"/>
16+
<waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitForSubmitInvoicebtn"/>
17+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/>
18+
<waitForPageLoad stepKey="waitForLoadPage"/>
19+
<waitForText userInput="The invoice has been created." stepKey="seeMessageInvoiceCreated"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2017 Adobe
55
* All Rights Reserved.
66
*/
77
-->
@@ -12,6 +12,7 @@
1212
<element name="submitInvoice" type="button" selector=".action-default.scalable.save.submit-button.primary" timeout="60"/>
1313
<element name="openNewCreditMemoFromInvoice" type="button" selector=".action-default.scalable.credit-memo"/>
1414
<element name="submitNewRefundFromInvoice" type="button" selector=".action-default.scalable.save.submit-button.refund.primary"/>
15+
<element name="cancel" type="button" selector=".action-default.scalable.delete"/>
1516
<element name="selectModeOfAmount" type="select" selector=".admin__control-select"/>
1617
</section>
1718
</sections>

0 commit comments

Comments
 (0)