Skip to content

Commit d9ce5ae

Browse files
committed
ACQE-6642: Create Partial Refund for Order Paid with PayPal Payflow Pro
Added files
1 parent 3056e9c commit d9ce5ae

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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="AdminCreatePartialRefundForOrderPaidWithPayPalPayflowProTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Paypal Payments Pro"/>
14+
<title value="Create Partial Refund for Order Paid with PayPal Payflow Pro"/>
15+
<description value="Admin Create Partial Refund for Order Paid with PayPal Payflow Pro from the storefront"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5264"/>
18+
<group value="paypalPayflowPro"/>
19+
</annotations>
20+
<before>
21+
<!--Create Simple product-->
22+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
23+
<!--Create Customer-->
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
25+
<!--Reindex and Clean cache-->
26+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
27+
<argument name="indices" value=""/>
28+
</actionGroup>
29+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache">
30+
<argument name="tags" value="full_page config"/>
31+
</actionGroup>
32+
<!--Login to admin-->
33+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
34+
<!--Login to storefront-->
35+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
36+
<argument name="Customer" value="$createCustomer$" />
37+
</actionGroup>
38+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
39+
<argument name="product" value="$$createSimpleProduct$$"/>
40+
</actionGroup>
41+
<!-- Add product to cart with qty 2 and proceed to checkout-->
42+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addVirtualProductToCart">
43+
<argument name="productQty" value="2"/>
44+
</actionGroup>
45+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
46+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
47+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickOnNextButton"/>
48+
<!-- Checkout select Credit Card (Payflow Pro) and place order-->
49+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" visible="true" stepKey="selectCreditCardPaymentMethod"/>
50+
<waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
51+
<!--Fill Card Data and place an order-->
52+
<actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardData">
53+
<argument name="cardData" value="VisaDefaultCard"/>
54+
</actionGroup>
55+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
56+
</before>
57+
<after>
58+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
59+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
60+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
61+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
62+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
63+
</after>
64+
<waitForElement selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumber"/>
65+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
66+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
67+
<argument name="orderId" value="{$grabOrderNumber}"/>
68+
</actionGroup>
69+
<!--Go to invoice page and submit invoice-->
70+
<actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrderPage"/>
71+
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoiceIntoOrder"/>
72+
<!--Open Invoice tab and create credit memo for partial refund from created invoice-->
73+
<actionGroup ref="AdminOpenInvoiceTabFromOrderPageActionGroup" stepKey="openInvoiceTab"/>
74+
<waitForElementClickable selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="waitForInvoicesTabOpenedOne"/>
75+
<click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="seeForInvoicesTabOpenedOne"/>
76+
<waitForPageLoad stepKey="waitForInvoicePageToBeLoaded"/>
77+
<actionGroup ref="AdminStartToCreateCreditMemoFromInvoicePageActionGroup" stepKey="clickOnCreditMemoFromInvoiceTab"/>
78+
<waitForElementVisible selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" stepKey="waitToItemToRefundTextField"/>
79+
<fillField selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" userInput="1" stepKey="partialRefund"/>
80+
<waitForElementClickable selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="waitToClickUpdateQuantity"/>
81+
<click selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="updateQuantityToRefund"/>
82+
<waitForPageLoad stepKey="waitForQuantityApplied"/>
83+
<actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo">
84+
<argument name="refundButton" value="{{AdminInvoiceMainActionsSection.submitNewRefundFromInvoice}}"/>
85+
</actionGroup>
86+
<!--Assert Order status-->
87+
<waitForText selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/>
88+
<!-- Grab transaction ID for refund and assert refund message in comments history tab-->
89+
<waitForElement selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionID"/>
90+
<grabTextFrom selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
91+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
92+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('refunded')}}" userInput="We refunded $133.00 online. Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotesForRefund"/>
93+
<!--Open credit memo tab and assert created credit memo grand total-->
94+
<waitForElementClickable selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="waitToClickCreditMemoTab"/>
95+
<click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemoTab"/>
96+
<actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="clickOnCreditMemosTab"/>
97+
<actionGroup ref="AssertAdminCreditMemoGrandTotalActionGroup" stepKey="assertGrandTotal">
98+
<argument name="expectedGrandTotal" value="$133.00"/>
99+
</actionGroup>
100+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitToClickBackButtonFromCreditMemo"/>
101+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonFromCreditMemo"/>
102+
<!--Open transaction Tab and assert the transaction types Authorization, Capture and Refund are present-->
103+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertAuthorizationTransactionType">
104+
<argument name="transactionType" value="authorization"/>
105+
</actionGroup>
106+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/>
107+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedFromAuthorization"/>
108+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonFromAuthorization"/>
109+
<!-- Assert Capture Transaction-->
110+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertCaptureTransactionType">
111+
<argument name="transactionType" value="capture"/>
112+
</actionGroup>
113+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForCapture"/>
114+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedFromCapture"/>
115+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonFromCapture"/>
116+
<!-- Assert Refund Transaction-->
117+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertRefundTransactionType">
118+
<argument name="transactionType" value="refund"/>
119+
</actionGroup>
120+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForRefund"/>
121+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedFromRefund"/>
122+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonFromRefund"/>
123+
</test>
124+
</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 © 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="AdminStartToCreateCreditMemoFromInvoicePageActionGroup">
12+
<annotations>
13+
<description>Admin start to create credit memo from invoice tab</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{AdminInvoiceTotalSection.creditMemosButton}}" stepKey="waitToClickCreditMemo"/>
16+
<click selector="{{AdminInvoiceTotalSection.creditMemosButton}}" stepKey="clickCreditMemo"/>
17+
</actionGroup>
18+
</actionGroups>

0 commit comments

Comments
 (0)