Skip to content

Commit 67eacd5

Browse files
“Pavan-bj”“Pavan-bj”
authored andcommitted
[Captivators]ACQE-7154|Admin Checking offline refund warning for PayPal Express Checkout orders
1 parent 651928c commit 67eacd5

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 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="AdminCheckOfflineRefundWarningForPayPalExpressCheckoutTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Paypal express checkout configuration"/>
14+
<title value="Paypal Express Checkout configuration with valid credentials"/>
15+
<description value="Admin Checking offline refund warning for PayPal Express Checkout orders"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-4375"/>
18+
<group value="3rd_party_integration"/>
19+
<group value="paypalExpress"/>
20+
<!-- <group value="pr_exclude"/>-->
21+
</annotations>
22+
<before>
23+
<!-- Simple product is created -->
24+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct">
25+
<field key="price">10.00</field>
26+
</createData>
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
28+
</before>
29+
<after>
30+
<!-- Roll back configuration -->
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
33+
</after>
34+
<!-- Navigate to StoreFront -->
35+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
36+
<!-- Add product to cart -->
37+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
38+
<argument name="product" value="$$createProduct$$"/>
39+
</actionGroup>
40+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
41+
<!--Fill Shipping Address-->
42+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/>
43+
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="Texas" stepKey="fillState"/>
44+
<waitForPageLoad stepKey="waitForShippingPageToLoad"/>
45+
<!-- Click Next button -->
46+
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
47+
<!-- Click on PayPal payment radio button -->
48+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
49+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
50+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
51+
<!-- Login to Paypal in-context and verify order total on paypal page-->
52+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
53+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
54+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>
55+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
56+
<waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/>
57+
<!--Assert order in orders grid -->
58+
<!-- Go to order page -->
59+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage">
60+
<argument name="orderId" value="{$grabOrderNumber}"/>
61+
</actionGroup>
62+
<!-- Check status -->
63+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
64+
<argument name="status" value="Processing"/>
65+
</actionGroup>
66+
<!-- Create invoice with capture online amount -->
67+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoicebtn"/>
68+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/>
69+
<waitForPageLoad stepKey="waitForInvoicePage"/>
70+
<scrollTo selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" x="0" y="-80" stepKey="scrollToAmount"/>
71+
<selectOption userInput="Capture Online" selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" stepKey="selectCaptureOnlineUnderAmount"/>
72+
<waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitForSubmitInvoicebtn"/>
73+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/>
74+
<waitForPageLoad stepKey="waitForLoadPage"/>
75+
<waitForText userInput="The invoice has been created." stepKey="seeMessageInvoiceCreated"/>
76+
<!-- Admin verify offline refund warning after clicking on credit memo -->
77+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="waitForCreditMemobtn"/>
78+
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickOnCreditMemobtn"/>
79+
<waitForText userInput="This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?" selector="{{AdminOrderDetailsMainActionsSection.creditMemoWarning}}" stepKey="waitForOfflineRefundWarning"/>
80+
</test>
81+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
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="selectModeOfAmount" type="select" selector=".admin__control-select"/>
1516
</section>
1617
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="ok" type="button" selector=".//*[@data-role='action']"/>
3131
<element name="void" type="button" selector="#void_payment span"/>
3232
<element name="invoiceTabContent1" type="text" selector="#sales_order_view_tabs_order_invoices_content > div > div.admin__data-grid-wrap > table > tbody > tr > td"/>
33+
<element name="creditMemoWarning" type="text" selector="//div[@class='modal-content']//div[text()='This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?']"/>
3334
</section>
3435
</sections>

0 commit comments

Comments
 (0)