Skip to content

Commit a12e16e

Browse files
committed
Merge branch 'ACQE-5754' into ACQE-7118-mainline-deployment
2 parents 8c237d5 + af46b6e commit a12e16e

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
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>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRegisteredUserPayPalExpressCheckoutMethodAndFlatRateTest">
12+
<annotations>
13+
<features value="PayPal"/>
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"/>
18+
<testCaseId value="AC-6147"/>
19+
<group value="3rd_party_integration"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Product -->
23+
<createData entity="_defaultProduct" stepKey="createProduct">
24+
<field key="price">10</field>
25+
</createData>
26+
<!-- Create Customer -->
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
28+
<!-- Admin Login -->
29+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
30+
<!-- Enabling PayPal Express Checkout -->
31+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress">
32+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
33+
</actionGroup>
34+
<!-- Changing PayPal Express Checkout Basic Settings -->
35+
<magentoCLI command="config:set {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.value}}" stepKey="changePaymentAction"/>
36+
</before>
37+
<!--Login to storefront as previously created customer-->
38+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
39+
<argument name="Customer" value="$$createCustomer$$"/>
40+
</actionGroup>
41+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
42+
<argument name="indices" value=""/>
43+
</actionGroup>
44+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
45+
<argument name="tags" value="full_page"/>
46+
</actionGroup>
47+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnProductPage">
48+
<argument name="product" value="$createProduct$"/>
49+
</actionGroup>
50+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
51+
<argument name="productName" value="$$createProduct.name$$"/>
52+
<argument name="productQty" value="2"/>
53+
</actionGroup>
54+
<!-- Go to Checkout -->
55+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutPage"/>
56+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate">
57+
<argument name="shippingMethodName" value="Flat Rate"/>
58+
</actionGroup>
59+
<!-- Go to Order review -->
60+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
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"/>
68+
<!-- Click on Paypal paypal button-->
69+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
70+
<!--Login to Paypal in-context-->
71+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
72+
<!--Verify Buyer shipping address -->
73+
<waitForText selector="{{PayPalPaymentSection.shippingAddress}}" userInput="7700 West Parmer Lane, Austin, TX 78729" stepKey="assertShippingAddress"/>
74+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
75+
<!-- See order successful Page instead of Order Review Page -->
76+
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
77+
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/>
78+
<!--Grab order number-->
79+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/>
80+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/>
81+
<!--Go to admin sales page and open the order id-->
82+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
83+
<argument name="orderId" value="{$grabOrderNumber}"/>
84+
</actionGroup>
85+
<!--Assert the total-->
86+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$30.00" stepKey="checkGrandTotal"/>
87+
<!--Grab the transaction id-->
88+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
89+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
90+
<!--Open comment history tab and assert the comment-->
91+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
92+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $30.00 online. Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotes"/>
93+
<waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/>
94+
<!-- Open Invoice and check -->
95+
<actionGroup ref="AdminOpenInvoiceFromOrderPageActionGroup" stepKey="openInvoiceFromOrder"/>
96+
<after>
97+
<!--Delete product -->
98+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
99+
<!-- Disable PayPal Express Checkout and Basic setting change -->
100+
<actionGroup ref="AdminPayPalExpressCheckoutDisableActionGroup" stepKey="configPaypalExpressCheckoutDisable"/>
101+
<magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="paymentActionChangeToAuthorization"/>
102+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
103+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
104+
<!--Delete customer -->
105+
<deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/>
106+
</after>
107+
</test>
108+
</tests>

0 commit comments

Comments
 (0)