Skip to content

Commit 5cdfee6

Browse files
committed
ACQE-6500 : [AC-6137]PayPalSmartButtonInProductPage
AddedFiles
1 parent b0c49b2 commit 5cdfee6

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

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

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

0 commit comments

Comments
 (0)