Skip to content

Commit 4829741

Browse files
committed
ACQE-6542 : [AC-4795] Partial Capture for a sales order placed with PayPal Payflow Pro
CreatedTestFileAsAdminCreatePartialCaptureForSalesOrderPlacedWithPaypalPayflowProTest
1 parent fcc6f0a commit 4829741

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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="AdminCreatePartialCaptureForSalesOrderPlacedWithPaypalPayflowProTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Payment methods"/>
14+
<title value="Create partial Capture for Order Placed with PayPal Payflow Pro"/>
15+
<description value="Create partial Capture for a Paypal Payflow Pro Order and and verify the transaction status after submit the Invoice."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4795"/>
18+
<group value="paypalPaymentsPro"/>
19+
<group value="3rd_party_integration"/>
20+
<!-- <group value="pr_exclude" />-->
21+
</annotations>
22+
<before>
23+
<!--Create a customer-->
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
25+
<!-- Simple product is created -->
26+
<!-- <createData entity="simpleProductWithoutCategory" stepKey="createProduct">-->
27+
<!-- <field key="price">10.00</field>-->
28+
<!-- </createData>-->
29+
<!--Create Simple product-->
30+
<createData entity="_defaultCategory" stepKey="createCategory"/>
31+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
32+
<field key="price">10.00</field>
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexConfig">
36+
<argument name="indices" value=""/>
37+
</actionGroup>
38+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheConfig">
39+
<argument name="tags" value="config full_page"/>
40+
</actionGroup>
41+
<!-- Login to admin-->
42+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
43+
</before>
44+
<after>
45+
<!-- Delete product and customer-->
46+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
47+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
48+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
49+
<!-- Logout-->
50+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
51+
</after>
52+
<!-- Login as Customer -->
53+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
54+
<argument name="Customer" value="$$createCustomer$$"/>
55+
</actionGroup>
56+
<!-- <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToStorefront"/>-->
57+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/>
58+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
59+
<argument name="product" value="$$createSimpleProduct$$"/>
60+
<argument name="productCount" value="1"/>
61+
</actionGroup>
62+
<!-- Add product 1 to cart -->
63+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
64+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
65+
</actionGroup>
66+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
67+
<!-- Select shipping -->
68+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate">
69+
<argument name="shippingMethodName" value="Flat Rate"/>
70+
</actionGroup>
71+
<!-- Go to Order review -->
72+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
73+
<!-- Checkout select Credit Card (Payflow Pro) and place order-->
74+
<waitForPageLoad stepKey="waitForPaymentPageLoad"/>
75+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/>
76+
<waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
77+
<!--Fill Card Data and place an order-->
78+
<actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal">
79+
<argument name="cardData" value="VisaDefaultCard"/>
80+
</actionGroup>
81+
<waitForPageLoad stepKey="waitForFillCardData"/>
82+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
83+
<!-- Grab order number-->
84+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOderNumber"/>
85+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
86+
<!--Go to Admin and check order information-->
87+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid">
88+
<argument name="orderId" value="$grabOrderNumber"/>
89+
</actionGroup>
90+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
91+
<!-- Check status -->
92+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
93+
<argument name="status" value="Processing"/>
94+
</actionGroup>
95+
<!-- Go to invoice tab and fill data -->
96+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceAction"/>
97+
<fillField selector="{{AdminOrderInvoiceViewSection.invoiceQty}}" userInput="2" stepKey="fillInvoiceQuantity"/>
98+
<click selector="{{AdminOrderInvoiceViewSection.updateInvoiceBtn}}" stepKey="clickUpdateQtyInvoiceBtn"/>
99+
<!-- <fillField selector="{{AdminInvoiceTotalSection.invoiceComment}}" userInput="comment" stepKey="writeComment"/>-->
100+
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
101+
<!-- Assert invoice with shipment success message -->
102+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
103+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus">
104+
<argument name="status" value="Processing"/>
105+
</actionGroup>
106+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/>
107+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/>
108+
<!--Open the comment history tab and assert the comment-->
109+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/>
110+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $128.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
111+
112+
<!--Go to invoice page into the order-->
113+
<actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrderPage"/>
114+
115+
<!-- <click selector="{{StorefrontOrderInvoicesSection.invoiceTab}}" stepKey="clickInvoiceTabOnStorefront"/>-->
116+
<!-- <see selector="{{StorefrontOrderInvoicesSection.grandTotalPrice}}" userInput="128.00" stepKey="seePrice"/>-->
117+
118+
<!--Go to Invoice Tab and Verify Invoice Grand Total-->
119+
<actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrder1"/>
120+
<see selector="{{AdminInvoiceTotalSection.grandTotal}}" userInput="$45" stepKey="seeInvoiceSubTotal1"/>
121+
122+
<!--Assert the authorization transaction is present in transaction grid-->
123+
<!-- <actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">-->
124+
<!-- <argument name="transactionType" value="authorization"/>-->
125+
<!-- </actionGroup>-->
126+
127+
<!--Assert the authorization transaction is present in transaction grid-->
128+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
129+
<argument name="transactionType" value="authorization"/>
130+
</actionGroup>
131+
<!--Assert the authorization transaction is present in transaction grid-->
132+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="assertTransactionTypeHasCapture">
133+
<argument name="transactionType" value="capture"/>
134+
</actionGroup>
135+
136+
</test>
137+
</tests>

0 commit comments

Comments
 (0)