Skip to content

Commit 41f6a07

Browse files
committed
ACQE-6542 : [AC-4795] Partial Capture for a sales order placed with PayPal Payflow Pro
AddedTestfile
1 parent 953d960 commit 41f6a07

7 files changed

+62
-43
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontGoToCheckoutFromMinicartNewActionGroup">
12+
<annotations>
13+
<description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on 'Proceed to Checkout'.</description>
14+
</annotations>
15+
16+
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/>
17+
<wait time="5" stepKey="waitMinicartRendering"/>
18+
<waitForElementClickable selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="waitForGoToCheckoutButtonToBeClickable"/>
19+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Test/AdminCreatePartialCaptureForSalesOrderPlacedWithPaypalPayflowProTest.xml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<before>
2323
<!--Create a customer-->
2424
<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>-->
2925
<!--Create Simple product-->
3026
<createData entity="_defaultCategory" stepKey="createCategory"/>
3127
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
@@ -44,32 +40,23 @@
4440
</before>
4541
<after>
4642
<!-- Delete product and customer-->
47-
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
48-
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
43+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
44+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4945
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
5047
<!-- Logout-->
5148
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
5249
</after>
5350
<!-- Login as Customer -->
5451
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
5552
<argument name="Customer" value="$$createCustomer$$"/>
5653
</actionGroup>
57-
<!-- <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToStorefront"/>-->
5854
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/>
59-
<!-- <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">-->
60-
<!-- <argument name="product" value="$$createSimpleProduct$$"/>-->
61-
<!-- <argument name="productCount" value="1"/>-->
62-
<!-- </actionGroup>-->
63-
<!-- Add product 1 to cart -->
64-
<!-- <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">-->
65-
<!-- <argument name="productName" value="$$createSimpleProduct.name$$"/>-->
66-
<!-- </actionGroup>-->
67-
6855
<actionGroup ref="StorefrontAddCategoryProductToCartWithQuantityNewActionGroup" stepKey="addToCartFromStorefrontProductPage1">
6956
<argument name="product" value="$$createSimpleProduct$$"/>
7057
<argument name="quantity" value="5"/>
7158
</actionGroup>
72-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
59+
<actionGroup ref="StorefrontGoToCheckoutFromMinicartNewActionGroup" stepKey="goToCheckoutFromMinicart"/>
7360
<!-- Select shipping -->
7461
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate">
7562
<argument name="shippingMethodName" value="Flat Rate"/>
@@ -102,9 +89,7 @@
10289
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceAction"/>
10390
<fillField selector="{{AdminOrderInvoiceViewSection.invoiceQty}}" userInput="2" stepKey="fillInvoiceQuantity"/>
10491
<waitForPageLoad stepKey="wait"/>
105-
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction1"/>
10692
<click selector="{{AdminOrderInvoiceViewSection.updateInvoiceBtn}}" stepKey="clickUpdateQtyInvoiceBtn"/>
107-
<!-- <fillField selector="{{AdminInvoiceTotalSection.invoiceComment}}" userInput="comment" stepKey="writeComment"/>-->
10893
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
10994
<!-- Assert invoice with shipment success message -->
11095
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
@@ -115,31 +100,20 @@
115100
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/>
116101
<!--Open the comment history tab and assert the comment-->
117102
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/>
118-
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $20.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
119-
120-
<!--Go to invoice page into the order-->
121-
<actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrderPage"/>
122-
123-
<!-- <click selector="{{StorefrontOrderInvoicesSection.invoiceTab}}" stepKey="clickInvoiceTabOnStorefront"/>-->
124-
<!-- <see selector="{{StorefrontOrderInvoicesSection.grandTotalPrice}}" userInput="128.00" stepKey="seePrice"/>-->
125-
103+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $271.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
126104
<!--Go to Invoice Tab and Verify Invoice Grand Total-->
127-
<actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrder1"/>
128-
<see selector="{{AdminInvoiceTotalSection.grandTotal}}" userInput="$45" stepKey="seeInvoiceSubTotal1"/>
129-
130-
<!--Assert the authorization transaction is present in transaction grid-->
131-
<!-- <actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">-->
132-
<!-- <argument name="transactionType" value="authorization"/>-->
133-
<!-- </actionGroup>-->
134-
135-
<!--Assert the authorization transaction is present in transaction grid-->
136-
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
105+
<click selector="{{StorefrontOrderInvoicesSection.invoiceTab1}}" stepKey="clickInvoiceTabOnStorefront"/>
106+
<click selector="{{StorefrontOrderInvoicesSection.clickView}}" stepKey="clickViewButton"/>
107+
<see selector="{{AdminInvoiceTotalSection.grandTotal}}" userInput="$271.00" stepKey="seeInvoiceSubTotal1"/>
108+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedAfterAsserting"/>
109+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonAfterAsserting"/>
110+
<actionGroup ref="AdminAssertTransitionTypeStatusNewActionGroup" stepKey="assertTransactionTypeStatusForAuthorization">
137111
<argument name="transactionType" value="authorization"/>
112+
<argument name="transitionTypeStatus" value="No"/>
138113
</actionGroup>
139-
<!--Assert the authorization transaction is present in transaction grid-->
140-
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="assertTransactionTypeHasCapture">
114+
<actionGroup ref="AdminAssertTransitionTypeStatusNewActionGroup" stepKey="assertTransactionTypeStatusForCapture">
141115
<argument name="transactionType" value="capture"/>
116+
<argument name="transitionTypeStatus" value="No"/>
142117
</actionGroup>
143-
144118
</test>
145119
</tests>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminAssertTransitionTypeStatusNewActionGroup" extends="AdminOpenTransactionsTabActionGroup">
12+
<arguments>
13+
<argument name="transitionTypeStatus" type="string"/>
14+
</arguments>
15+
<remove keyForRemoval="clickOnVoidTransaction"/>
16+
<remove keyForRemoval="clickFirstRow"/>
17+
<waitForText selector="{{AdminTransactionsGridSection.transitionStatus}}" userInput="{{transitionTypeStatus}}" stepKey="verifyTransitionTypeStatus"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnNewMemoPageActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<actionGroup name="AdminClickRefundOfflineOnNewMemoPageActionGroup">
1212
<annotations>
1313
<description>Click the Refund Offline button on the New Memo page</description>
14-
</annotations>
14+
</annotations>
1515
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/>
1616
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccesMessage"/>
1717
<see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeSuccessMessage"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
<element name="skuColumn" type="text" selector=".order-creditmemo-tables .product-sku-block"/>
2727
<element name="childItemQtyToRefund" type="input" selector=".order-creditmemo-tables tr:nth-child({{row}}) td .qty-input" parameterized="true"/>
2828
</section>
29-
</sections>
29+
</sections>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
<element name="orderTxnTableTypeFilter" type="button" selector="#order_transactions_filter_txn_type"/>
1717
<element name="orderTxnTableSearchBtn" type="button" selector="#container button[title='Search']" />
1818
<element name="transactionData" type="text" selector="//th[text()='{{transactionData}}']/following-sibling::td" parameterized="true"/>
19+
<!-- <element name="transitionStatus" type="text" selector="//tr[@data-role='row']//td[@data-column='is_closed']" />-->
20+
<element name="transitionStatus" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']" />
21+
1922
</section>
20-
</sections>
23+
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
<section name="StorefrontOrderInvoicesSection">
1212
<element name="invoiceTab" type="button" selector="//a[contains(text(), 'Invoices')]"/>
1313
<element name="grandTotalPrice" type="text" selector="[data-th='Grand Total'] .price"/>
14+
<element name="invoiceTab1" type="button" selector="//a[@name='order_invoices']"/>
15+
<element name="clickView" type="button" selector="#sales_order_view_tabs_order_invoices_content > div > div.admin__data-grid-wrap > table > tbody > tr > td.data-grid-actions-cell > a"/>
1416
</section>
1517
</sections>

0 commit comments

Comments
 (0)