Skip to content

Commit 59d3ff0

Browse files
Merge branch 'ACQE-6500' into ACQE-6651_mainline_PR_deployment
2 parents 977f796 + 17e1da6 commit 59d3ff0

File tree

2 files changed

+138
-1
lines changed

2 files changed

+138
-1
lines changed

app/code/Magento/Paypal/Test/Mftf/Data/PaypalConfigData.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317
<data key="path">payment/payflowpro_cc_vault/active</data>
318318
<data key="value">0</data>
319319
</entity>
320-
<entity name="StorefrontPaypalPayflowProSalePaymentActionOptionConfigData">
320+
<entity name="StorefrontPaypalPayflowProSalePaymentActionOptionConfigData">
321321
<data key="path">payment/payflowpro/payment_action</data>
322322
<data key="scope_id">1</data>
323323
<data key="label">No</data>
@@ -329,4 +329,10 @@
329329
<data key="label">No</data>
330330
<data key="value">Authorization</data>
331331
</entity>
332+
<entity name="StorefrontPaypalExpressAuthorizationBillingAgreementPaymentActionOptionConfigData">
333+
<data key="path">payment/paypal_billing_agreement/payment_action</data>
334+
<data key="scope_id">1</data>
335+
<data key="label">No</data>
336+
<data key="value">Authorization</data>
337+
</entity>
332338
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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="StorefrontLoginForPaypalExpressCheckoutWithSmartButtonProductPageTest">
12+
<annotations>
13+
<features value="Paypal"/>
14+
<stories value="PayPal Express Checkout"/>
15+
<title value="Paypal Express Checkout with Smart Button on Product Page"/>
16+
<description value="Customers should be able to perform PayPal Express Checkout method using PayPal Smart Button on Product Page"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-6137"/>
19+
<group value="3rd_party_integration"/>
20+
<group value="pr_exclude"/>
21+
</annotations>
22+
<before>
23+
<createData entity="SimpleProduct" stepKey="simpleProduct"/>
24+
<!-- Create Customer -->
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
<!-- Enable free shipping method -->
27+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/>
28+
<magentoCLI command="config:set {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.value}}" stepKey="setPaymentAction"/>
29+
<magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationBillingAgreementPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationBillingAgreementPaymentActionOptionConfigData.value}}" stepKey="setBillingPaymentAction"/>
30+
<magentoCLI command="config:set {{StorefrontPaypalEnableTransferCartLineConfigData.path}} {{StorefrontPaypalEnableTransferCartLineConfigData.value}}" stepKey="enableTransferCartLine"/>
31+
<magentoCLI command="config:set {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.value}}" stepKey="enableSkipOrderReview"/>
32+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
33+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress">
34+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<!-- Disable free shipping method -->
39+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
40+
<magentoCLI command="config:set {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.value}}" stepKey="disableSkipOrderReview"/>
41+
<magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="returnPaymentActionDefaultValue"/>
42+
<magentoCLI command="config:set {{StorefrontPaypalDisableTransferCartLineConfigData.path}} {{StorefrontPaypalDisableTransferCartLineConfigData.value}}" stepKey="disableTransferCartLine"/>
43+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
44+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
45+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46+
<!-- Logout -->
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
48+
</after>
49+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
50+
<argument name="indices" value=""/>
51+
</actionGroup>
52+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
53+
<argument name="tags" value="config full_page"/>
54+
</actionGroup>
55+
<!--Login to storefront as previously created customer-->
56+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
57+
<argument name="Customer" value="$$createCustomer$$"/>
58+
</actionGroup>
59+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
60+
<argument name="productUrlKey" value="$$simpleProduct.custom_attributes[url_key]$$"/>
61+
</actionGroup>
62+
<!--Click Paypal button-->
63+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
64+
<!--Login to Paypal in-context-->
65+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
66+
<!--Click PayPal button and go back to Magento site-->
67+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/>
68+
<actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod">
69+
<argument name="shippingMethod" value="Free - $0.00"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/>
72+
<!-- I see order successful Page instead of Order Review Page -->
73+
<actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertCheckoutSuccess"/>
74+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
75+
<!--Go to Admin and check order information-->
76+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid">
77+
<argument name="orderId" value="$grabOrderNumber"/>
78+
</actionGroup>
79+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
80+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
81+
<argument name="status" value="Processing"/>
82+
</actionGroup>
83+
<!--Assert the total-->
84+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$123.00" stepKey="checkGrandTotal"/>
85+
<!--Grab the transaction id-->
86+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
87+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
88+
<!--Open comment history tab and assert the comment-->
89+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
90+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Ordered amount')}}" userInput="Ordered amount of $123.00 Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotes"/>
91+
<waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/>
92+
<!--Assert Authorize button is present and Invoice button is absent-->
93+
<actionGroup ref="AdminAssertAuthorizeButtonOnOrderPageActionGroup" stepKey="assertAuthorizeButtonIsPresent"/>
94+
<dontSee selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="dontSeeInvoiceButton"/>
95+
<!--Open transaction tab and assert transaction type is order-->
96+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionType">
97+
<argument name="transactionType" value="order"/>
98+
</actionGroup>
99+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
100+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
101+
<!--Authorize the order-->
102+
<actionGroup ref="AdminAuthorizeAnOrderActionGroup" stepKey="authorizeTheOrder"/>
103+
<!--Open Comments history tab and assert the comment for authorization-->
104+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppeared"/>
105+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/>
106+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterAuthorizing"/>
107+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Authorized amount')}}" userInput="Authorized amount of $123.00. Transaction ID: &quot;{$grabLastTransactionID}&quot;" stepKey="seeOrderHistoryNotesAfterAuthorizing"/>
108+
<dontSee selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="dontSeeAuthorizationButtonAfterAuthorizing"/>
109+
<!--Assert the invoice button is present-->
110+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoiceButtonToBeAppeared"/>
111+
<!--Assert the authorization transaction is present in transaction grid-->
112+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
113+
<argument name="transactionType" value="authorization"/>
114+
</actionGroup>
115+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedAfterAsserting"/>
116+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonAfterAsserting"/>
117+
<!--Submit invoice-->
118+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
119+
<seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType"/>
120+
<!--Submit creating invoice into the order and assert the status of the order-->
121+
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoiceIntoOrder"/>
122+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus">
123+
<argument name="status" value="Processing"/>
124+
</actionGroup>
125+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/>
126+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/>
127+
<!--Open the comment history tab and assert the comment-->
128+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/>
129+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $123.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
130+
</test>
131+
</tests>

0 commit comments

Comments
 (0)