Skip to content

Commit 604afc9

Browse files
DeepthiPulluruDeepthiPulluru
authored andcommitted
ACQE-5936:AdminCheckoutUsingPaypalInContextWithDifferentCurrenciesTest
Checkout using Paypal in-context with different currencies
1 parent 995a05c commit 604afc9

File tree

2 files changed

+184
-0
lines changed

2 files changed

+184
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CheckoutPaymentSection">
12+
<element name="isPaymentSection" type="text" selector="//*[@class='opc-progress-bar']/li[contains(@class, '_active') and span[contains(.,'Review &amp; Payments')]]"/>
13+
<element name="availablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div:nth-child(2)>div.payment-method-title.field.choice"/>
14+
<element name="notAvailablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div.payment-method._active>div.payment-method-title.field.choice"/>
15+
<element name="billingNewAddressForm" type="text" selector="[data-form='billing-new-address']"/>
16+
<element name="billingAddressNotSameCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-checkmo"/>
17+
<element name="editAddress" type="button" selector="button.action.action-edit-address"/>
18+
<element name="addressDropdown" type="select" selector="[name=billing_address_id]"/>
19+
<element name="addressDropdownSelected" type="select" selector="[name=billing_address_id] option:checked"/>
20+
<element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/>
21+
<element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update" timeout="30"/>
22+
<element name="guestFirstName" type="input" selector=".payment-method._active .billing-address-form input[name='firstname']"/>
23+
<element name="guestLastName" type="input" selector=".payment-method._active .billing-address-form input[name*='lastname']"/>
24+
<element name="guestStreet" type="input" selector=".payment-method._active .billing-address-form input[name*='street[0]']"/>
25+
<element name="guestStreet2" type="input" selector=".payment-method._active .billing-address-form input[name*='street[1]']"/>
26+
<element name="guestStreet3" type="input" selector=".payment-method._active .billing-address-form input[name*='street[2]']"/>
27+
<element name="guestStreet4" type="input" selector=".payment-method._active .billing-address-form input[name*='street[3]']"/>
28+
<element name="guestCity" type="input" selector=".payment-method._active .billing-address-form input[name*='city']"/>
29+
<element name="guestCountry" type="select" selector=".payment-method._active .billing-address-form select[name*='country_id']"/>
30+
<element name="guestRegion" type="select" selector=".payment-method._active .billing-address-form select[name*='region_id']"/>
31+
<element name="guestPostcode" type="input" selector=".payment-method._active .billing-address-form input[name*='postcode']"/>
32+
<element name="guestTelephone" type="input" selector=".payment-method._active .billing-address-form input[name*='telephone']"/>
33+
<element name="billingAddress" type="text" selector=".payment-method._active div.billing-address-details"/>
34+
<element name="cartItems" type="text" selector="ol.minicart-items"/>
35+
<element name="cartItemsArea" type="button" selector="div.block.items-in-cart"/>
36+
<element name="cartItemsAreaActive" type="textarea" selector="div.block.items-in-cart.active" timeout="30"/>
37+
<element name="checkMoneyOrderPayment" type="radio" selector="input#checkmo.radio" timeout="30"/>
38+
<element name="purchaseOrderPayment" type="radio" selector="input#purchaseorder.radio" timeout="30"/>
39+
<element name="placeOrder" type="button" selector=".payment-method._active button.action.primary.checkout" timeout="60"/>
40+
<element name="placeOrderWithoutTimeout" type="button" selector=".payment-method._active button.action.primary.checkout"/>
41+
<element name="paymentSectionTitle" type="text" selector="//*[@id='checkout-payment-method-load']//div[@data-role='title']" />
42+
<element name="orderSummarySubtotal" type="text" selector="//tr[@class='totals sub']//span[@class='price']" />
43+
<element name="orderSummaryShippingTotal" type="text" selector="//tr[@class='totals shipping excl']//span[@class='price']" />
44+
<element name="orderSummaryShippingMethod" type="text" selector="//tr[@class='totals shipping excl']//span[@class='value']" />
45+
<element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price" />
46+
<element name="ProductItemByName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']" parameterized="true" />
47+
<element name="ProductOptionsByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true" />
48+
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
49+
<element name="ProductOptionLinkActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']//a[text() = '{{var2}}']" parameterized="true" />
50+
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
51+
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
52+
<element name="shippingInformationSection" type="text" selector=".ship-to .shipping-information-content" />
53+
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
54+
<element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/>
55+
<element name="productOptionsActiveByProductItemPrice" type="text" selector="//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true"/>
56+
<element name="productItemPriceByName" type="text" selector="//div[@class='product-item-details'][contains(., '{{ProductName}}')]//span[@class='price']" parameterized="true"/>
57+
<element name="tax" type="text" selector="[data-th='Tax'] span" timeout="30"/>
58+
<element name="taxDetails" type="text" selector=".totals-tax-details th.mark" timeout="30"/>
59+
<element name="taxPercentage" type="text" selector=".totals-tax-details .mark"/>
60+
<element name="orderSummaryTotalIncluding" type="text" selector="//tr[@class='grand totals incl']//span[@class='price']" />
61+
<element name="orderSummaryTotalExcluding" type="text" selector="//tr[@class='grand totals excl']//span[@class='price']" />
62+
<element name="myShippingAndBillingAddressSame" type="input" selector=".billing-address-same-as-shipping-block"/>
63+
<element name="addressAction" type="button" selector="//span[text()='{{action}}']" parameterized="true"/>
64+
<element name="addressBook" type="button" selector="//a[text()='Address Book']"/>
65+
<element name="noQuotes" type="text" selector=".no-quotes-block"/>
66+
<element name="paymentMethodByName" type="text" selector="//*[@id='checkout-payment-method-load']//*[contains(@class, 'payment-group')]//label[normalize-space(.)='{{var1}}']" parameterized="true"/>
67+
<element name="bankTransfer" type="radio" selector="#banktransfer"/>
68+
<element name="billingAddressNotSameBankTransferCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-banktransfer"/>
69+
<element name="billingAddressSelectShared" type="select" selector=".checkout-billing-address select[name='billing_address_id']"/>
70+
<element name="discount" type="block" selector="tr.totals.discount"/>
71+
<element name="discountPrice" type="text" selector=".discount .price"/>
72+
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
73+
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
74+
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
75+
<element name="productChargedFor" type="text" selector="tr.totals.charge span.price"/>
76+
<element name="productCharged" type="text" selector="//tr[@class='grand totals']//span[@class='price' and contains(text(),'HK$')]"/>
77+
</section>
78+
</sections>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminCheckoutUsingPaypalInContextWithDifferentCurrenciesTest">
11+
<annotations>
12+
<features value="Order"/>
13+
<stories value="Currencies"/>
14+
<title value="Checkout using Paypal in-context with different currencies"/>
15+
<description value="The purpose of this test is to checkout with Paypal with base currency as HKD and display currency as HKD and validate the corresponding prices and currency symbols"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6118"/>
18+
<group value="3rd_party_integration"/>
19+
<group value="paypalExpress"/>
20+
<group value="pr_exclude" />
21+
</annotations>
22+
<before>
23+
<!-- Currency Options settings -->
24+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForHKD.value}}" stepKey="setAllowedCurrencyEURAndUSD"/>
25+
<magentoCLI command="config:set currency/options/default HKD" stepKey="setCurrencyDefaultHKD"/>
26+
<magentoCLI command="config:set currency/options/base HKD" stepKey="setCurrencyBaseHKD"/>
27+
<!-- Enable free shipping method -->
28+
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
29+
<!-- Create customer -->
30+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
31+
<!-- Create SimpleProductWithPrice100 -->
32+
<createData entity="SimpleProduct_100" stepKey="createProduct"/>
33+
<!-- Login as Admin -->
34+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
35+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
36+
<argument name="tags" value="config full_page"/>
37+
</actionGroup>
38+
</before>
39+
<after>
40+
<magentoCLI command="config:set {{SetDefaultCurrencyHKDConfig.path}} {{SetDefaultCurrencyHKDConfig.value}}" stepKey="resetDefaultCurrencyBaseBackToHKD"/>
41+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForHKD.value}}" stepKey="resetAllowedCurrencyBaseBackToUSD"/>
42+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
43+
<argument name="tags" value="config full_page"/>
44+
</actionGroup>
45+
<!-- Customer log out -->
46+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
47+
<!-- Delete customer -->
48+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
49+
<!-- Delete product -->
50+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
51+
<!-- Admin log out -->
52+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
53+
<!-- Disable Free Shipping -->
54+
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
55+
</after>
56+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJob">
57+
<argument name="indices" value="cataloginventory_stock"/>
58+
</actionGroup>
59+
<!-- Login as customer -->
60+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
61+
<argument name="Customer" value="$$createCustomer$$"/>
62+
</actionGroup>
63+
<!-- Navigate To Simple Product Page -->
64+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToSimpleProductPage">
65+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
66+
</actionGroup>
67+
<!-- Add product to cart -->
68+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
69+
<argument name="product" value="$$createProduct$$"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCart"/>
72+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout">
73+
</actionGroup>
74+
<!-- Select Free Shipping -->
75+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
76+
<argument name="shippingMethodName" value="Free Shipping"/>
77+
</actionGroup>
78+
<!-- click on Next button -->
79+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
80+
<!-- verify order summary -->
81+
<actionGroup ref="CheckOrderSummaryInCheckoutActionGroup" stepKey="checkOrderSummary">
82+
<argument name="subtotal" value="HK$100.00"/>
83+
<argument name="shippingTotal" value="HK$0.00"/>
84+
<argument name="shippingMethod" value="Free Shipping - Free"/>
85+
<argument name="total" value="HK$100.00"/>
86+
</actionGroup>
87+
<waitForText userInput="HK$100.00" selector="{{CheckoutPaymentSection.productCharged}}" stepKey="assertProductChargedFor"/>
88+
<!-- Click on PayPal payment radio button -->
89+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
90+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
91+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
92+
<!-- Login to Paypal in-context and verify order total on paypal page-->
93+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
94+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
95+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumberToBeGrabbed"/>
96+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
97+
<!-- Navigate to Sales order page -->
98+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
99+
<!-- Open created order -->
100+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
101+
<argument name="entityId" value="{$grabOrderNumber}"/>
102+
</actionGroup>
103+
<!--Verify Success Message-->
104+
<waitForText userInput="The order was placed using HKD" stepKey="successMessageIsBeingDisplayed"/>
105+
</test>
106+
</tests>

0 commit comments

Comments
 (0)