Skip to content

Commit 920162c

Browse files
committed
ACQE-5754 : Create Order User PayPalExpress Checkout With Payment Action Is Sale
paypal expreess checkout with flatrate shipping
1 parent 569dd91 commit 920162c

File tree

4 files changed

+88
-27
lines changed

4 files changed

+88
-27
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminSelectPayPalExpressCheckoutPaymentActionGroup">
12+
<annotations>
13+
<description>Selects the 'PayPal Express' Payment Method on the Storefront Checkout page.</description>
14+
</annotations>
15+
16+
<waitForElementClickable selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/>
17+
<click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/>
18+
<waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontAssertOrderDetailsOnPayPalPageActionGroup">
11+
<annotations>
12+
<description>On PayPal page asserts order amount and shipping details .</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="subtotalAmount" type="string" defaultValue="$10.00"/>
16+
<argument name="shippingAmount" type="string" defaultValue="$5.00"/>
17+
<argument name="totalAmount" type="string" defaultValue="$15.00"/>
18+
<argument name="shippingAddress" type="string" defaultValue="4145 Madison Ave, Culver City, CA 90232"/>
19+
</arguments>
20+
<waitForElementClickable selector="{{PayPalPaymentSection.orderTotalOnPaypalCheckout}}" stepKey="waitForAmountButtonToBeClickable"/>
21+
<click selector="{{PayPalPaymentSection.orderTotalOnPaypalCheckout}}" stepKey="clickAmountToOpen"/>
22+
<waitForElementVisible selector="{{PayPalPaymentSection.subtotal(subtotalAmount)}}" stepKey="assertSubtotal"/>
23+
<waitForElementVisible selector="{{PayPalPaymentSection.shipping(shippingAmount)}}" stepKey="assertShipping"/>
24+
<waitForText selector="{{PayPalPaymentSection.total}}" userInput="{{totalAmount}}" stepKey="assertTotal"/>
25+
<waitForElementClickable selector="{{PayPalPaymentSection.close}}" stepKey="waitForCLoseButtonToBeClickable"/>
26+
<click selector="{{PayPalPaymentSection.close}}" stepKey="clickCloseButton"/>
27+
<waitForText selector="{{PayPalPaymentSection.shippingAddress}}" userInput="{{shippingAddress}}" stepKey="assertShippingAddress"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Section/PayPalExpressCheckoutConfigSection/PayPalPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
<element name="paypalCart" type="text" selector="#transactionCart"/>
2727
<element name="productNamePosition" type="text" selector=".itemName"/>
2828
<element name="orderTotalOnPaypalCheckout" type="text" selector="//div[@id='cart']//span[contains(text(),'$')]"/>
29+
<element name="shippingAddress" type="text" selector="//div[@data-testid='shipping-address']/p[@data-testid='ship-to-address']"/>
2930
</section>
3031
</sections>
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminRegisteredUsingPayPalExpressCheckoutMethodAndFlatRateTest">
11+
<test name="AdminRegisteredUserPayPalExpressCheckoutMethodAndFlatRateTest">
1212
<annotations>
1313
<features value="PayPal"/>
14-
<stories value="Checkout Using PayPalExpress Checkout With Payment Action Is Sale"/>
15-
<title value="Checkout Using PayPalExpress Checkout Method And Flat Rate"/>
16-
<description value="Create Order Using PayPalExpress Checkout With Payment Action Is Sale."/>
17-
<severity value="MAJOR"/>
14+
<stories value="Checkout User PayPalExpress Checkout With Payment Action Is Sale"/>
15+
<title value="Checkout User PayPalExpress Checkout Method And Flat Rate"/>
16+
<description value="Create Order User PayPalExpress Checkout With Payment Action Is Sale."/>
17+
<severity value="CRITICAL"/>
1818
<testCaseId value="AC-6147"/>
1919
<group value="3rd_party_integration"/>
2020
</annotations>
2121
<before>
22-
<!-- Create Category and Product -->
23-
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<!-- Create Product -->
2423
<createData entity="_defaultProduct" stepKey="createProduct">
2524
<field key="price">10</field>
26-
<requiredEntity createDataKey="createCategory"/>
2725
</createData>
2826
<!-- Create Customer -->
2927
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
@@ -43,8 +41,8 @@
4341
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
4442
<argument name="indices" value=""/>
4543
</actionGroup>
46-
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
47-
<argument name="tags" value=""/>
44+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
45+
<argument name="tags" value="full_page"/>
4846
</actionGroup>
4947
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnProductPage">
5048
<argument name="product" value="$createProduct$"/>
@@ -60,35 +58,48 @@
6058
</actionGroup>
6159
<!-- Go to Order review -->
6260
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
63-
<waitForElementClickable selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/>
64-
<click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/>
65-
<waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/>
61+
<actionGroup ref="VerifyCheckoutPaymentOrderSummaryActionGroup" stepKey="verifyCheckoutPaymentOrderSummary">
62+
<argument name="orderSummarySubTotal" value="$20.00"/>
63+
<argument name="orderSummaryShippingTotal" value="$10.00"/>
64+
<argument name="orderSummaryTotal" value="$30.00"/>
65+
</actionGroup>
66+
<!-- Select Paypal paypal radio button-->
67+
<actionGroup ref="AdminSelectPayPalExpressCheckoutPaymentActionGroup" stepKey="selectPayPalExpressCheckout"/>
6668
<!-- Click on Paypal paypal button-->
6769
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
6870
<!--Login to Paypal in-context-->
6971
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
72+
<!--Verify Buyer shipping address -->
73+
<actionGroup ref="StorefrontAssertOrderDetailsOnPayPalPageActionGroup" stepKey="assertOrderDetails">
74+
<argument name="shippingAddress" value="7700 West Parmer Lane, Austin, TX 78729"/>
75+
</actionGroup>
7076
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
7177
<!-- See order successful Page instead of Order Review Page -->
7278
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
7379
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/>
7480
<!--Grab order number-->
7581
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/>
7682
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/>
77-
<!--Go to admin sales page and open the order id-->
78-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
83+
<!--Go to admin sales page and open the order id-->
84+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
7985
<argument name="orderId" value="{$grabOrderNumber}"/>
80-
</actionGroup>
81-
<!--Assert the total-->
82-
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$30.00" stepKey="checkGrandTotal"/>
83-
<!--Grab the transaction id-->
84-
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
85-
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
86-
<!--Open comment history tab and assert the comment-->
87-
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
88-
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Ordered amount')}}" userInput="Ordered amount of $30.00 Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotes"/>
89-
<waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/>
90-
<!-- Open Invoice and check -->
91-
<actionGroup ref="AdminOpenInvoiceFromOrderPageActionGroup" stepKey="openInvoiceFromOrder"/>
86+
</actionGroup>
87+
<!--Assert the total-->
88+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$30.00" stepKey="checkGrandTotal"/>
89+
<!--Grab the transaction id-->
90+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
91+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
92+
<!--Open comment history tab and assert the comment-->
93+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
94+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $30.00 online. Transaction ID: &quot;{$grabLastTransactionID}&quot;" stepKey="seeOrderHistoryNotes"/>
95+
<waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/>
96+
<!-- Open Invoice and check -->
97+
<actionGroup ref="AdminOpenInvoiceFromOrderPageActionGroup" stepKey="openInvoiceFromOrder"/>
98+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/>
99+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/>
100+
<!--Open the comment history tab and assert the comment-->
101+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/>
102+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $128.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
92103
<after>
93104
<!-- delete category and product -->
94105
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

0 commit comments

Comments
 (0)