Skip to content

Commit ab21550

Browse files
committed
ACQE-6260: In-Context Checkout with PayPal Express Checkout with API Credentials from checkout page
1 parent 57a3231 commit ab21550

File tree

2 files changed

+132
-0
lines changed

2 files changed

+132
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="AdminPaypalExpressCheckoutWithAPICredentialsFromCheckoutPageTest">
10+
<annotations>
11+
<features value="PayPal"/>
12+
<stories value="Payment methods"/>
13+
<title value="Enable Paypal Express Checkout with API credentials and validate Paypal Express checkout working from Checkout Page."/>
14+
<description value="Enable Paypal Express Checkout with API credentials and validate Paypal Express checkout working from Checkout Page."/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-5206"/>
17+
<group value="3rd_party_integration"/>
18+
<!-- <group value="paypalExpress"/>-->
19+
<!-- <group value="pr_exclude"/>-->
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProduct" stepKey="simpleProduct"/>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<magentoCLI command="config:set {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.value}}" stepKey="setPaymentActionOrder"/>
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<!--Add new tax rates. Go to tax rule page -->
27+
<actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/>
28+
<fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRule.name}}"/>
29+
<!-- Adding product rate tax for NY -->
30+
<actionGroup ref="AddNewTaxRateNoZipUIActionGroup" stepKey="addProductTaxRateForCA">
31+
<argument name="taxCode" value="SimpleTaxTexas"/>
32+
</actionGroup>
33+
<!-- Save Tax Rule -->
34+
<actionGroup ref="ClickSaveButtonActionGroup" stepKey="saveAnotherTaxRule">
35+
<argument name="message" value="You saved the tax rule."/>
36+
</actionGroup>
37+
<!-- Enable flat rate method -->
38+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
39+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
40+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
41+
</actionGroup>
42+
</before>
43+
<after>
44+
<!-- Disable flat rate method -->
45+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
46+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
47+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
48+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
49+
<!-- Go to the tax rule page and delete the row created-->
50+
<actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulesPageA"/>
51+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule">
52+
<argument name="name" value="{{TaxRule.name}}"/>
53+
<argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/>
54+
</actionGroup>
55+
<!-- Deleting Tax zones and rate for Product Tax -->
56+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresTaxZonesAndRatesPage">
57+
<argument name="menuUiId" value="{{AdminMenuStores.dataUiId}}"/>
58+
<argument name="submenuUiId" value="{{AdminMenuStoresTaxZonesAndRates.dataUiId}}"/>
59+
</actionGroup>
60+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteProductTaxRule1">
61+
<!-- <argument name="name" value="{{SimpleTaxCA.identifier}}-{{SimpleTaxCA.rate}}"/>-->
62+
<argument name="name" value="{{SimpleTaxTexas.identifier}}-{{SimpleTaxTexas.rate}}"/>
63+
<argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/>
64+
</actionGroup>
65+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
66+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
67+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
68+
</after>
69+
70+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
71+
<argument name="indices" value=""/>
72+
</actionGroup>
73+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
74+
<argument name="tags" value="config full_page"/>
75+
</actionGroup>
76+
77+
<!--Go to storefront and add product to cart -->
78+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
79+
<argument name="Customer" value="$createCustomer$" />
80+
</actionGroup>
81+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
82+
<argument name="product" value="$$simpleProduct$$"/>
83+
</actionGroup>
84+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart">
85+
<argument name="productName" value="$simpleProduct.name$"/>
86+
</actionGroup>
87+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutPage"/>
88+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate">
89+
<argument name="shippingMethodName" value="Flat Rate"/>
90+
</actionGroup>
91+
<!-- Go to Order review -->
92+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
93+
<waitForElement selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/>
94+
<click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/>
95+
<waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/>
96+
<!-- Click on Paypal paypal button-->
97+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
98+
<!--Login to Paypal in-context-->
99+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
100+
<!--Transfer Cart Line and Shipping Method assertion-->
101+
<actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/>
102+
<!--Click PayPal button and go back to Magento site-->
103+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/>
104+
<!-- <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>-->
105+
<!-- <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>-->
106+
<!-- <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/>-->
107+
<!-- &lt;!&ndash; Go to order page &ndash;&gt;-->
108+
<!-- <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage">-->
109+
<!-- <argument name="orderId" value="{$grabOrderNumber}"/>-->
110+
<!-- </actionGroup>-->
111+
<!-- See order successful Page instead of Order Review Page -->
112+
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
113+
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/>
114+
<!--Grab order number-->
115+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/>
116+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/>
117+
<!--Go to admin sales page and open the order id-->
118+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
119+
<argument name="orderId" value="{$grabOrderNumber}"/>
120+
</actionGroup>
121+
<!-- Check status -->
122+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
123+
<argument name="status" value="Processing"/>
124+
</actionGroup>
125+
<!--Open Invoice-->
126+
<waitForElementClickable selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="waitForInvoicesTabClickable" />
127+
<click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="openInvoicesTab"/>
128+
<!--Assert Invoice amount -->
129+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoiceTabDetails}}" stepKey="waitForInvoiceSectionDetailsToBeAppeared"/>
130+
</test>
131+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<element name="hold" type="button" selector="#order-view-hold-button" timeout="30"/>
1818
<element name="invoice" type="button" selector="#order_invoice" timeout="30"/>
1919
<element name="invoiceTab" type="button" selector="#sales_order_view_tabs_order_invoices" timeout="30"/>
20+
<element name="invoiceTabDetails" type="text" selector="#sales_order_view_tabs_order_invoices_content > div > div.admin__data-grid-wrap > table > tbody > tr > td" timeout="30"/>
2021
<element name="ship" type="button" selector="#order_ship" timeout="30"/>
2122
<element name="reorder" type="button" selector="#order_reorder" timeout="30"/>
2223
<element name="edit" type="button" selector="#order_edit" timeout="30"/>

0 commit comments

Comments
 (0)