Skip to content

Commit 70415c5

Browse files
akaashakaash
authored andcommitted
Merge branch 'ACQE-4268' into ACQE-6098-functional-mainline-ce
2 parents 1bac27b + 793c365 commit 70415c5

File tree

4 files changed

+137
-0
lines changed

4 files changed

+137
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<element name="priceForGiftsWrapping" type="input" selector="//input[@name='product[gift_wrapping_price]']"/>
4747
<element name="productCollapsibleColumnsScheduleUpdate" type="button" selector="//div[@class='modal-component']//div[@class='entry-edit form-inline']//div[@data-state-collapsible='{{state}}']//strong[@class='admin__collapsible-title']//span[text()='{{expandTitle}}']" parameterized="true"/>
4848
<element name="allowGiftMessageToggleVerify" type="button" selector="//input[@type='checkbox' and @name='product[gift_message_available]' and @value='{{var1}}']" parameterized="true"/>
49+
<element name="headerNameAndValueOtherCurrency" type="text" selector="//span[@class='data-grid-cell-content' and contains(text(), '{{gridName}}')]/ancestor::thead/following-sibling::tbody//div[@class = 'data-grid-cell-content' and contains(text(),'{{currencyNumber}}')]" parameterized="true"/>
4950
</section>
5051
</sections>
5152

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
7676
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
7777
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
78+
<element name="productChargedFor" type="text" selector="tr.totals.charge span.price"/>
7879
<element name="customerAddressAttribute" type="input" selector="//div[@name='billingAddresscheckmo.custom_attributes.{{attribute}}']//input[@name='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/>
7980
</section>
8081
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
<element name="taxRule1" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='Canada-GST-5% (5%)']/following-sibling::td//span[@class='price']"/>
2222
<element name="taxRule2" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='Canada-GST-PST-5% (5%)']/following-sibling::td//span[@class='price']"/>
2323
<element name="subTotal1" type="text" selector=".//*[@class='col-subtotal col-price']"/>
24+
<element name="orderTotalPrices" type="text" selector="//strong[text()='{{GrandTotal}}']//ancestor::tr//span[@class = 'price' and text()='{{price}}']" parameterized="true"/>
25+
<element name="subTotalAndShipping" type="text" selector="//td[@class='label' and contains(text(),'{{SubTotal}}')]//parent::tr//span[@class='price' and text()='{{price}}']" parameterized="true"/>
2426
<element name="catalogTotalPriceExclTax" type="text" selector="//tbody//tr[@class='col-catalog_price_excl_tax']//span[@class='price' and contains(text(),'{{value}}')]" parameterized="true"/>
2527
<element name="catalogTotalPriceInclTax" type="text" selector="//tbody//tr[@class='col-catalog_price_incl_tax']//span[@class='price' and contains(text(),'{{value}}')]" parameterized="true"/>
2628
<element name="negotiatedDiscount" type="text" selector="//tbody//tr[@class='col-negotiated_discount']//span[@class='price' and contains(text(),'{{value}}')]" parameterized="true"/>
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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="CreateCreditMemoWithBaseCurrencyUSDAndDisplayCurrencyEuroTest">
11+
<annotations>
12+
<features value="Order"/>
13+
<stories value="Create Credit Memo"/>
14+
<title value="Create Credit Memo with Base Currency as USD and Display Currency as Euro"/>
15+
<description value="The purpose of this test is to create credit memo with base currency as USD and display currency as Euro and validate the corresponding prices and currency symbols"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-4521"/>
18+
</annotations>
19+
<before>
20+
<!-- Create customer -->
21+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
22+
<!-- Create SimpleProductWithPrice100 -->
23+
<createData entity="SimpleProduct_100" stepKey="createProduct"/>
24+
<!-- Currency Options settings -->
25+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURAndUSD"/>
26+
<magentoCLI command="config:set currency/options/default EUR" stepKey="setCurrencyDefaultEUR"/>
27+
<!-- Login as Admin -->
28+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
29+
<!-- Navigate to currency rates page -->
30+
<actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="naviagteToCurrencyRatesPage"/>
31+
<!-- Currency Rates (Stores > Currency Rates): 1.000 USD = 0.7067 EUR -->
32+
<actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates">
33+
<argument name="firstCurrency" value="USD"/>
34+
<argument name="secondCurrency" value="EUR"/>
35+
<argument name="rate" value="0.7067"/>
36+
</actionGroup>
37+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
38+
<argument name="tags" value="config full_page"/>
39+
</actionGroup>
40+
</before>
41+
<after>
42+
<magentoCLI command="config:set {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="resetDefaultCurrencyBaseBackToUSD"/>
43+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="resetAllowedCurrencyBaseBackToUSD"/>
44+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
45+
<argument name="tags" value="config full_page"/>
46+
</actionGroup>
47+
<!-- Customer log out -->
48+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
49+
<!-- Delete customer -->
50+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
51+
<!-- Delete product -->
52+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
53+
<!-- Admin log out -->
54+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
55+
</after>
56+
<!-- Login as customer -->
57+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
58+
<argument name="Customer" value="$$createCustomer$$"/>
59+
</actionGroup>
60+
<!-- Navigate To Simple Product Page -->
61+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToSimpleProductPage">
62+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
63+
</actionGroup>
64+
<!-- Verify product prices for simple product -->
65+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertSimpleProductPrices">
66+
<argument name="productPrice" value="€70.67"/>
67+
<argument name="productFinalPrice" value="€70.67"/>
68+
</actionGroup>
69+
<!-- Add product to cart -->
70+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
71+
<argument name="product" value="$$createProduct$$"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCart"/>
74+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/>
75+
<!-- verify flat rate €3.53 -->
76+
<waitForText selector="{{CheckoutShippingMethodsSection.price}}" stepKey="seeFlatRate" userInput="€3.53"/>
77+
<!-- click on Next button -->
78+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
79+
<!-- verify order summary -->
80+
<actionGroup ref="CheckOrderSummaryInCheckoutActionGroup" stepKey="checkOrderSummary">
81+
<argument name="subtotal" value="€70.67"/>
82+
<argument name="shippingTotal" value="€3.53"/>
83+
<argument name="shippingMethod" value="Flat Rate - Fixed"/>
84+
<argument name="total" value="€74.20"/>
85+
</actionGroup>
86+
<waitForText userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/>
87+
<!-- Place order -->
88+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
89+
<waitForElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderId"/>
90+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>
91+
<!-- Navigate to Sales order page -->
92+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
93+
<!-- Open created order -->
94+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
95+
<argument name="entityId" value="{$orderId}"/>
96+
</actionGroup>
97+
<!-- Submit invoice -->
98+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickOnInvoiceBtn"/>
99+
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
100+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
101+
<!-- Click 'Credit Memo' button and create new memo -->
102+
<actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="createCreditMemo"/>
103+
<!-- Assert Credit Memo refund prices -->
104+
<actionGroup ref="AssertAdminCreditMemoNewPageTotalsActionGroup" stepKey="assertCreditMemoRefundTotals">
105+
<argument name="refundShipping" value="5.00"/>
106+
<argument name="adjustmentRefund" value="0.00"/>
107+
<argument name="adjustmentFee" value="0.00"/>
108+
<argument name="subtotalRow" value="$100.00"/>
109+
<argument name="grandTotal" value="$105.00"/>
110+
</actionGroup>
111+
<!-- Assert Grand total and subtotal value -->
112+
<waitForElementVisible selector="{{AdminOrderTotalSection.orderTotalPrices('Grand Total','€74.20')}}" stepKey="waitForGrandTotalValueEURO"/>
113+
<waitForElementVisible selector="{{AdminOrderTotalSection.subTotalAndShipping('Subtotal','€70.67')}}" stepKey="waitForSubTotalValueEURO"/>
114+
<!-- Refund Offline -->
115+
<actionGroup ref="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup" stepKey="clickRefundOffline"/>
116+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPageAgain"/>
117+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
118+
<waitForElementClickable selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="waitForColumnsDropdownToBeOpened"/>
119+
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropDown"/>
120+
<!-- Enable to display Total Refunded column and validate currency -->
121+
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Total Refunded')}}" stepKey="showRefundedColumn"/>
122+
<waitForElementClickable selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="waitForColumnsDropdownToBeClickedToClose"/>
123+
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropDown"/>
124+
<waitForElement selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="waitForGrandTotalBaseValue"/>
125+
<grabTextFrom selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="grabGrandTotalBaseValue"/>
126+
<assertEquals stepKey="seeGrandTotalBase">
127+
<actualResult type="const">$grabGrandTotalBaseValue</actualResult>
128+
<expectedResult type="string">$105.00</expectedResult>
129+
</assertEquals>
130+
<waitForElementVisible selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/>
131+
<waitForElementVisible selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/>
132+
</test>
133+
</tests>

0 commit comments

Comments
 (0)