Skip to content

Commit fd7190e

Browse files
Merge branch 'ACQE-8628' into ACQE-functional-deployment-v4-1
2 parents c2bb7e3 + ee4fb67 commit fd7190e

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

app/code/Magento/Paypal/Test/Mftf/Data/PaypalData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,6 @@
323323
<data key="amount_note">Voided authorization. Amount: $15.00.</data>
324324
<data key="status">void</data>
325325
<data key="label">Voided</data>
326+
<data key="cancelled_note">Canceled order online Amount: $15.00.</data>
326327
</entity>
327328
</entities>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminCancelSalesOrderWithPaypalBillingAgreementTest">
12+
<annotations>
13+
<features value="PayPal"/>
14+
<stories value="Cancel Order with billing agreement"/>
15+
<title value="Cancel order placed within Billing Agreement"/>
16+
<description value="Place an order with billing agreement as payment method and Cancel the Order"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-5299"/>
19+
<group value="3rd_party_integration"/>
20+
<group value="pr_exclude"/>
21+
</annotations>
22+
<before>
23+
<!-- Simple product is created -->
24+
<createData entity="SimpleProduct" stepKey="createProduct">
25+
<field key="price">10</field>
26+
</createData>
27+
<!-- US Customer is created -->
28+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/>
29+
<!-- Set Billing Agreement value to Auto -->
30+
<magentoCLI command="config:set {{BillingAgreement.path}} {{BillingAgreement.value}}" stepKey="enableAutoBilling"/>
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
32+
<!-- Configure PayPal Express Checkout -->
33+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
34+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminPayPalExpressCheckoutEnableBillingAgreementActionGroup" stepKey="enableBillingAgreement">
37+
<argument name="countryCode" value="{{MerchantUnitedStates.value}}"/>
38+
</actionGroup>
39+
<!-- Precondition Step 1: Order is placed within PayPal Billing Agreement -->
40+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
41+
<argument name="Customer" value="$$createCustomer$$"/>
42+
</actionGroup>
43+
<!-- Add product to cart -->
44+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
45+
<argument name="product" value="$$createProduct$$"/>
46+
</actionGroup>
47+
<!-- Go to Checkout Page -->
48+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
49+
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
50+
<!-- Click on PayPal payment radio button -->
51+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
52+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
53+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
54+
<!-- Login to Paypal in-context-->
55+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
56+
<!-- Click PayPal button and go back to Magento site -->
57+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
58+
</before>
59+
<after>
60+
<actionGroup ref="AdminPayPalExpressCheckoutDisableActionGroup" stepKey="disablePaypalExpressCheckout"/>
61+
<!-- Login to Paypal in-context-->
62+
<actionGroup ref="AdminClearPayPalExpressCheckoutDataActionGroup" stepKey="clearPaypalExpressCheckoutFields"/>
63+
<actionGroup ref="AdminPayPalExpressCheckoutDisableBillingAgreementActionGroup" stepKey="disableBillingAgreement">
64+
<argument name="countryCode" value="{{MerchantUnitedStates.value}}"/>
65+
</actionGroup>
66+
<!-- Set Billing Agreement value to default -->
67+
<magentoCLI command="config:set {{BillingAgreement.path}} {{BillingAgreement.default}}" stepKey="disableAutoBilling"/>
68+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
69+
<!-- Delete Data -->
70+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
71+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
72+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
73+
</after>
74+
<actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertOrderSuccess"/>
75+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
76+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.billingAgreement}}" stepKey="waitForBillingAgreement"/>
77+
<grabTextFrom selector="{{CheckoutSuccessMainSection.billingAgreement}}" stepKey="billingAgreement"/>
78+
<assertNotEmpty stepKey="assertOrderIdIsNotEmpty">
79+
<actualResult type="const">$orderNumber</actualResult>
80+
</assertNotEmpty>
81+
<assertNotEmpty stepKey="assertBillingAgreementIsNotEmpty">
82+
<actualResult type="const">$billingAgreement</actualResult>
83+
</assertNotEmpty>
84+
<!-- Step 2&3: Go to Sales > Orders & Open the Order from preconditions -->
85+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
86+
<argument name="orderId" value="{$orderNumber}"/>
87+
</actionGroup>
88+
<!-- Step 4&5: Cancel the Order& Click OK button-->
89+
<actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/>
90+
<!-- Step 6: Observe order data -->
91+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForGrabLastTransactionID"/>
92+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryTab"/>
93+
<grabTextFrom selector="{{AdminOrderCommentsTabSection.orderCommentsWithType(BillingAgreement.comment)}}" stepKey="grabOrderStatus"/>
94+
<waitForText selector="{{AdminOrderCommentsTabSection.orderComments}}" userInput="{{BillingAgreement.cancelled_note}}" stepKey="seeOrderHistoryPrice"/>
95+
<!-- Check the last transaction of the order and validate the details -->
96+
<waitForElementClickable selector="{{AdminTransactionsGridSection.transactionsSectionBtn}}" stepKey="waitForTransactionsTabToBeClicked"/>
97+
<click selector="{{AdminTransactionsGridSection.transactionsSectionBtn}}" stepKey="clickTransactionsTab"/>
98+
<waitForElementVisible selector="{{AdminTransactionsGridSection.orderTxnTable}}" stepKey="orderTransactionsTableIsVisible"/>
99+
<selectOption selector="{{AdminTransactionsGridSection.orderTxnTableTypeFilter}}" userInput="{{BillingAgreement.status}}" stepKey="selectVoidTypeTxn"/>
100+
<waitForElementClickable selector="{{AdminTransactionsGridSection.orderTxnTableSearchBtn}}" stepKey="waitToClickSearch"/>
101+
<click selector="{{AdminTransactionsGridSection.orderTxnTableSearchBtn}}" stepKey="clickSearch"/>
102+
<waitForPageLoad stepKey="waitForFilterToLoad"/>
103+
<waitForElementClickable selector="{{AdminTransactionsGridSection.orderTxnTableFirstRow}}" stepKey="clickOnVoidTransaction"/>
104+
<click selector="{{AdminTransactionsGridSection.orderTxnTableFirstRow}}" stepKey="clickVoidTxn"/>
105+
<waitForPageLoad stepKey="waitForTxnToLoad"/>
106+
<assertStringContainsString stepKey="assertEquals">
107+
<expectedResult type="string">{{BillingAgreement.comment}}</expectedResult>
108+
<actualResult type="variable">$grabOrderStatus</actualResult>
109+
</assertStringContainsString>
110+
<waitForText selector="{{AdminTransactionsGridSection.transactionData(AdminMenuPaypalTransaction.status)}}" userInput="{{StorefrontPaypalEnableSkipOrderReviewStepConfigData.label}}" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
111+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
112+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
113+
<actionGroup ref="AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey="validateAuthTransaction"/>
114+
<waitForText selector="{{AdminTransactionsGridSection.transactionData(AdminMenuPaypalTransaction.status)}}" userInput="{{StorefrontPaypalEnableSkipOrderReviewStepConfigData.label}}" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/>
115+
</test>
116+
</tests>

0 commit comments

Comments
 (0)