Skip to content

Commit e4323a2

Browse files
committed
ACQE-5766: Cancel a Sales Order placed with PayPal Payflow Link
- New Automation Test file and Actiongroup are added
1 parent 98b2848 commit e4323a2

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="StorefrontFillCreditCardDetailsActionGroup">
12+
<annotations>
13+
<description>Fills in the provided Credit Card details. And Clicks on PayNow Button</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="creditCardDetails" defaultValue="Visa3DSecureCard"/>
17+
</arguments>
18+
<!--Fill the required details for Credit card-->
19+
<waitForElementVisible selector="{{CheckoutPaymentSection.creditCardField}}" stepKey="waitForCreditCardField"/>
20+
<scrollTo selector="{{CheckoutPaymentSection.creditCardField}}" stepKey="scrollToPayment" />
21+
<click selector="{{CheckoutPaymentSection.creditCardField}}" stepKey="clickCreditCardField"/>
22+
<fillField selector ="{{CheckoutPaymentSection.creditCardField}}" userInput="{{creditCardDetails.cardNumber}}" stepKey="inputCreditcardNumber"/>
23+
<fillField selector ="{{CheckoutPaymentSection.expirationMonth}}" userInput="{{creditCardDetails.month}}" stepKey="inputExpirationMonth"/>
24+
<fillField selector ="{{CheckoutPaymentSection.expirationYear}}" userInput="{{creditCardDetails.year}}" stepKey="inputExpirationYear"/>
25+
<fillField selector ="{{CheckoutPaymentSection.cvv}}" userInput="{{creditCardDetails.cvv}}" stepKey="inputCvv"/>
26+
<click selector="{{CheckoutPaymentSection.payNowBtn}}" stepKey="clickPayNowBtn"/>
27+
</actionGroup>
28+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="StorefrontSwitchToPayPalPayflowActionGroup">
12+
<annotations>
13+
<description>Switch to Paypal Payflow IFrame</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="elementNumber" type="string" defaultValue="0"/>
17+
</arguments>
18+
<!--set ID for iframe of PayPal group button-->
19+
<executeJS function="document.getElementsByClassName('paypal iframe')[{{elementNumber}}].setAttribute('name', 'paypalFrame');" stepKey="setIDForIframe"/>
20+
<!--switch to iframe of PayPal group button-->
21+
<switchToIFrame userInput="paypalFrame" stepKey="switchToIframe"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="AdminCancelSalesOrderPlacedWithPaypalPayflowLinkTest">
11+
<annotations>
12+
<features value="Payflow"/>
13+
<stories value="Payment Payflow Link methods"/>
14+
<title value="Sales Order Cancellation Using PayPal Payflow Link"/>
15+
<description value="Admin can cancel orders placed by customers using PayPal Payflow"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5429"/>
18+
<group value="3rd_party_integration"/>
19+
</annotations>
20+
<before>
21+
<!-- Simple product is created -->
22+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct">
23+
<field key="price">10.00</field>
24+
</createData>
25+
<!-- US Customer is created -->
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<!-- Precondition Step1: Login To admin -->
28+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
29+
<actionGroup ref="AdminEnablePayPalPayFlowLinkActionGroup" stepKey="ConfigPayPalPayFlowLink">
30+
<argument name="credentials" value="SamplePaypalPaymentsFlowLinkConfig"/>
31+
</actionGroup>
32+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
33+
<argument name="Customer" value="$$createCustomer$$"/>
34+
</actionGroup>
35+
<!-- Add product to cart -->
36+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
37+
<argument name="product" value="$$createProduct$$"/>
38+
</actionGroup>
39+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
40+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
41+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
42+
<!-- Click on PayPal payment radio button -->
43+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPayflowLinkRadio}}" stepKey="waitForPayPalRadioButton"/>
44+
<click selector="{{CheckoutPaymentSection.PayPalPayflowLinkRadio}}" stepKey="selectPaypalPayment"/>
45+
<checkOption selector="{{CheckoutPaymentSection.selectCheckboxforBilling}}" stepKey="selectCheckboxForBilling"/>
46+
<click selector="{{CheckoutPaymentSection.cntinuebtn}}" stepKey="submitContinueButton"/>
47+
<actionGroup ref="StorefrontSwitchToPayPalPayflowActionGroup" stepKey="switchToPaypalPayflowIframe"/>
48+
<actionGroup ref="StorefrontFillCreditCardDetailsActionGroup" stepKey="inputCreditCardNumberFillCreditCardDetails"/>
49+
<waitForPageLoad stepKey="waitForOrderData"/>
50+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
51+
<!-- Go to order page & Open the order-->
52+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById">
53+
<argument name="orderId" value="$grabOrderNumber"/>
54+
</actionGroup>
55+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
56+
</before>
57+
<after>
58+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
59+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
60+
<createData entity="RollbackPaypalPayflowPro" stepKey="rollbackPaypalPayflowProConfig"/>
61+
<!-- Logout from storefront -->
62+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
63+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
64+
</after>
65+
66+
<!-- Step 4&5: Click on Cancel button then OK Button-->
67+
<actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/>
68+
<!-- Step6: Observe the Data -->
69+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
70+
<argument name="status" value="Canceled"/>
71+
</actionGroup>
72+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
73+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
74+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
75+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Canceled order')}}" userInput="Canceled order online Amount: $15.00. Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotesAfterCancelingOrder"/>
76+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasAuthorization">
77+
<argument name="transactionType" value="authorization"/>
78+
</actionGroup>
79+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/>
80+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
81+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
82+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasVoid">
83+
<argument name="transactionType" value="void"/>
84+
</actionGroup>
85+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
86+
</test>
87+
</tests>

0 commit comments

Comments
 (0)