Skip to content

Commit f068a11

Browse files
ACQE-6376:"Guest checkout with PayPal button from Product page and use Free Shipping" is automated.
1 parent be7b88d commit f068a11

File tree

5 files changed

+195
-0
lines changed

5 files changed

+195
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="SelectShippingAddressOnPayPalPaymentPageActionGroup">
12+
<annotations>
13+
<description>Select shipping address on paypal account payment page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="shippingAddress" type="string" />
17+
<argument name="selectedShippingAddress" type="string" />
18+
</arguments>
19+
<waitForElementClickable selector="{{PayPalPaymentSection.changeShippingAddressButton}}" stepKey="waitForChangeShippingAddressButton"/>
20+
<click selector="{{PayPalPaymentSection.changeShippingAddressButton}}" stepKey="clickChangeShippingAddressButton"/>
21+
<waitForElementVisible selector="{{PayPalPaymentSection.ShippingAddressDropdown}}" stepKey="waitForAddressDropdown"/>
22+
<selectOption selector ="{{PayPalPaymentSection.ShippingAddressDropdown}}" userInput="{{shippingAddress}}" stepKey="selectShippingAddress"/>
23+
<waitForElementVisible selector="{{PayPalPaymentSection.selectedShippingAddress(selectedShippingAddress)}}" stepKey="verifyAddressIsSelected"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@
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="changeShippingAddressButton" type="button" selector="#change-shipping"/>
30+
<element name="ShippingAddressDropdown" type="select" selector="#shippingDropdown"/>
31+
<element name="selectedShippingAddress" type="text" selector="//div/p[contains(text(), '{{selectedAddress}}')]" parameterized="true"/>
32+
33+
2934
</section>
3035
</sections>
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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="GuestCheckoutWithPayPalButtonFromCheckoutPageFreeShippingTest">
12+
<annotations>
13+
<features value="Paypal"/>
14+
<stories value="PayPal Express Checkout"/>
15+
<title value="Guest checkout with PayPal button from Product page and use Free Shipping"/>
16+
<description value="Customer is able to buy goods using Checkout with PayPal button from Product page and use Free Shipping"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-5210"/>
19+
<group value="3rd_party_integration"/>
20+
<!-- <group value="pr_exclude"/>-->
21+
</annotations>
22+
<before>
23+
<!-- Login -->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25+
26+
<!-- Create Product -->
27+
<createData entity="_defaultCategory" stepKey="createCategory"/>
28+
<createData entity="SimpleProduct" stepKey="createProduct">
29+
<field key="price">10.00</field>
30+
</createData>
31+
<!-- Enabling PayPal Express Checkout -->
32+
33+
<magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="setPaymentActionOrder"/>
34+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress">
35+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
36+
</actionGroup>
37+
38+
<!-- Enable Free Shipping method -->
39+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
40+
41+
<!-- Create Tax Rule w/ NY & CA Tax Rates -->
42+
<actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="goToCreateTaxRulePage"/>
43+
<fillField selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{SimpleTaxRule.code}}" stepKey="fillRuleName"/>
44+
<actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate">
45+
<argument name="taxCode" value="SimpleTaxNY"/>
46+
</actionGroup>
47+
<actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate">
48+
<argument name="taxCode" value="SimpleTaxCA"/>
49+
</actionGroup>
50+
<actionGroup ref="AdminSaveTaxRuleActionGroup" stepKey="saveTaxRule"/>
51+
52+
</before>
53+
<after>
54+
<!-- Delete Product -->
55+
<deleteData stepKey="deleteCategory" createDataKey="createCategory"/>
56+
<deleteData stepKey="deleteProduct" createDataKey="createProduct"/>
57+
<!-- Disable Free Shipping method -->
58+
<createData entity="FreeShippingMethodDisableConfig" stepKey="disableFreeShipping"/>
59+
<!-- Revert to default tax rate and rule -->
60+
<actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/>
61+
<actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulesPage"/>
62+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule">
63+
<argument name="name" value="{{SimpleTaxRule.code}}"/>
64+
<argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/>
65+
</actionGroup>
66+
<actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRatesPage"/>
67+
<actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/>
68+
<!-- Logout -->
69+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
70+
71+
</after>
72+
<!-- Go to StoreFront -->
73+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
74+
75+
<!-- Add simple product to cart -->
76+
<actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart">
77+
<argument name="product" value="$$createProduct$$"/>
78+
<argument name="quantity" value="1"/>
79+
</actionGroup>
80+
81+
<!-- Open mini cart from product page -->
82+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniShoppingCart"/>
83+
84+
<!--Click Paypal button-->
85+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
86+
87+
88+
<!--Login to Paypal in-context-->
89+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
90+
91+
<!--Select US shipping address-->
92+
<actionGroup ref="SelectShippingAddressOnPayPalPaymentPageActionGroup" stepKey="selectUSShippingAddress">
93+
<argument name="shippingAddress" value="US cust1 - 6161 West Centinela Avenue, Culver city, CA 90230"/>
94+
<argument name="selectedShippingAddress" value="6161 West Centinela Avenue, Culver city, CA 90230"/>
95+
</actionGroup>
96+
97+
<!--Click PayPal button and go back to Magento site-->
98+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="ClickContinueGoBackToMagentoSite"/>
99+
100+
<!--Select free shipping-->
101+
<actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod">
102+
<argument name="shippingMethod" value="Free - $0.00"/>
103+
</actionGroup>
104+
105+
<!--Assert grand total-->
106+
<actionGroup ref="StorefrontAssertOrderReviewSummaryWithTaxActionGroup" stepKey="verifyCheckoutPaymentOrderSummary">
107+
<argument name="orderSummarySubTotal" value="$10.00"/>
108+
<argument name="orderSummaryShippingTotal" value="$0.00"/>
109+
<argument name="orderSummaryTax" value="$0.83"/>
110+
<argument name="orderSummaryTotal" value="$10.83"/>
111+
</actionGroup>
112+
113+
<!--SubmitOrder-->
114+
<actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/>
115+
116+
<!--See success messages-->
117+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
118+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
119+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>
120+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
121+
122+
<!-- Go to order page -->
123+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage">
124+
<argument name="orderId" value="{$grabOrderNumber}"/>
125+
</actionGroup>
126+
<!-- Check order status -->
127+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus">
128+
<argument name="status" value="Processing"/>
129+
</actionGroup>
130+
<!-- Check grand total -->
131+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$10.83" stepKey="checkGrandTotal"/>
132+
<!-- Check comment history -->
133+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
134+
<waitForText selector="{{AdminOrderCommentsTabSection.orderComment}}" userInput="Authorized amount of $10.83." stepKey="seeOrderHistoryNotes"/>
135+
<!-- Check transaction tab and is closed values-->
136+
<actionGroup ref="AdminOpenOrderTransactionActionGroup" stepKey="clickOnTransactionTab"/>
137+
<waitForElementVisible selector="{{AdminOrderDetailsOrderViewSection.transactionTable('increment_id','{$grabOrderNumber}')}}" stepKey="verifyTransactionIsPresent"/>
138+
<waitForElementVisible selector="{{AdminOrderDetailsOrderViewSection.transactionTable('is_closed','No')}}" stepKey="verifyTransactionIsClosedValue"/>
139+
140+
141+
142+
</test>
143+
</tests>
144+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminOpenOrderTransactionActionGroup">
12+
<annotations>
13+
<description>Clicks on the 'Transaction' on Admin View Order page.</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{AdminOrderDetailsOrderViewSection.transaction}}" stepKey="waitForTransactionTab"/>
16+
<click selector="{{AdminOrderDetailsOrderViewSection.transaction}}" stepKey="clickOnTabTransaction"/>
17+
</actionGroup>
18+
</actionGroups>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
<element name="creditMemos" type="button" selector="#sales_order_view_tabs_order_creditmemos"/>
1515
<element name="shipments" type="button" selector="#sales_order_view_tabs_order_shipments"/>
1616
<element name="commentsHistory" type="button" selector="#sales_order_view_tabs_order_history"/>
17+
<element name="transaction" type="button" selector="#sales_order_view_tabs_order_transactions"/>
18+
<element name="transactionTable" type="block" selector="//table[@id='order_transactions_table']//tbody//tr//td[@data-column='{{columnName}}'][contains(text(),'{{columnValue}}')]" parameterized="true"/>
19+
1720
</section>
1821
</sections>

0 commit comments

Comments
 (0)