Skip to content

Commit 52de864

Browse files
Automated ACQE-4268
1 parent 8ea62ab commit 52de864

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
2424
<element name="warningMessage" type="text" selector=".message-warning"/>
2525
<element name="noticeMessage" type="text" selector=".message-notice"/>
26+
<element name="successMsg" type="text" selector="#messages div.message-success div[data-ui-id='messages-message-success']"/>
2627
</section>
2728
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
7373
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
7474
<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" />
7576
</section>
7677
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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="CreateCreditMemowithBaseCurrencyUSDandDisplayCurrencyEuroTest">
12+
<annotations>
13+
<features value="Order"/>
14+
<stories value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
15+
<title value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
16+
<description value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4521"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Create customer -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<!-- Create SimpleProductWithPrice100 -->
25+
<createData entity="SimpleProduct_100" stepKey="createProduct"/>
26+
<!-- Currency Options settings -->
27+
<magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSD"/>
28+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURandUSD"/>
29+
<magentoCLI command="config:set {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEUR"/>
30+
<!-- Login as Admin -->
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
32+
<!-- Navigate to curency rates page -->
33+
<actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="naviagteToCurrencyRatesPage"/>
34+
<!-- Currency Rates (Stores > Currency Rates): 1.000 USD = 0.7067 EUR -->
35+
<actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates">
36+
<argument name="firstCurrency" value="USD"/>
37+
<argument name="secondCurrency" value="EUR"/>
38+
<argument name="rate" value="0.7067"/>
39+
</actionGroup>
40+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
41+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
42+
</before>
43+
44+
<after>
45+
<!-- Admin log out -->
46+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
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+
</after>
54+
55+
<!--Login as customer -->
56+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
57+
<argument name="Customer" value="$$createCustomer$$"/>
58+
</actionGroup>
59+
<!--Navigate To Simple Product Page -->
60+
<comment userInput="Add product to the shopping cart" stepKey="addSimpleProductToCart"/>
61+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
62+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
63+
64+
<!-- Verify price for simple product with attribute option €70.67 -->
65+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertFirstSimpleProductPrices">
66+
<argument name="productPrice" value="€70.67"/>
67+
<argument name="productFinalPrice" value="€70.67"/>
68+
</actionGroup>
69+
70+
<!-- Customer placed order from storefront with payment method -->
71+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
72+
<argument name="product" value="$$createProduct$$"/>
73+
</actionGroup>
74+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
75+
<!-- verify flat rate €3.53-->
76+
<see 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+
<!-- application issue -->
87+
<see userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/>
88+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
89+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>
90+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
91+
<click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/>
92+
93+
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
94+
<!-- Generate invoice -->
95+
<click selector="{{AdminOrderFormItemsSection.tab_invoice}}" stepKey="clickOnInvoiceBtn"/>
96+
<click selector="{{AdminOrderFormItemsSection.invoice_submit}}" stepKey="submitInvoice"/>
97+
<waitForElementVisible selector="{{AdminMessagesSection.successMsg}}" stepKey="waitForSuccessMessage"/>
98+
<!-- Click 'Credit Memo' button and create new memo -->
99+
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo"/>
100+
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage"/>
101+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle"/>
102+
103+
<actionGroup ref="AssertAdminCreditMemoNewPageTotalsActionGroup" stepKey="assertCreditMemoRefundTotals">
104+
<argument name="refundShipping" value="5.00"/>
105+
<argument name="adjustmentRefund" value="0.00"/>
106+
<argument name="adjustmentFee" value="0.00"/>
107+
<argument name="subtotalRow" value="$100.00"/>
108+
<argument name="grandTotal" value="$105.00"/>
109+
</actionGroup>
110+
<seeElement selector="{{AdminCreditMemoTotalSection.orderTotalPrices('Grand Total','€74.20')}}" stepKey="seeGrandTotalValueEURO"/>
111+
<seeElement selector="{{AdminCreditMemoTotalSection.subtotalAndShipping('Subtotal','€70.67')}}" stepKey="seeSubTotalValueEURO"/>
112+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/>
113+
<waitForElementVisible selector="{{AdminMessagesSection.successMsg}}" stepKey="waitForMessageAppears"/>
114+
<see selector="{{AdminMessagesSection.successMsg}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/>
115+
116+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPageAgain"/>
117+
118+
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsdropDown"/>
119+
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Total Refunded')}}" stepKey="showRefundedColumn"/>
120+
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsdropDown"/>
121+
122+
<seeElement selector="{{AdminGridHeaders.headerNameandValueUSD('Grand Total (Base)','105.00')}}" stepKey="seeGrandTotalBase"/>
123+
<seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/>
124+
<seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/>
125+
126+
</test>
127+
</tests>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@
2525
<element name="refundOffline" type="button" selector=".order-totals-actions button[data-ui-id='order-items-submit-offline']"/>
2626
<element name="updateTotals" type="button" selector=".update-totals-button" timeout="30"/>
2727
<element name="disabledUpdateTotals" type="button" selector=".update-totals-button.disabled" timeout="30"/>
28+
<element name="orderTotalPrices" type="text" selector="//td//strong[text()='{{arg1}}']/../..//span[@class='price' and text()='{{arg2}}']" parameterized="true"/>
29+
<element name="subtotalAndShipping" type="text" selector="//td[@class='label' and contains(text(),'{{arg1}}')]/../..//span[@class='price' and text()='{{arg2}}']" parameterized="true"/>
2830
</section>
2931
</sections>

app/code/Magento/Ui/Test/Mftf/Section/AdminGridControlsSection/AdminGridHeadersSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
<element name="columnsNames" type="text" selector="[data-role='grid-wrapper'] .data-grid-th &gt; span"/>
1414
<element name="totalRecords" type="text" selector="div.admin__data-grid-header-row.row.row-gutter div.row div.admin__control-support-text"/>
1515
<element name="numberOfPages" type="text" selector="div.admin__data-grid-header-row.row.row-gutter div.row div.admin__data-grid-pager > label"/>
16+
<element name="headerNameandValueOtherCurrency" type="text" selector="//div[@data-role='grid-wrapper']//span[@class='data-grid-cell-content' and contains(text(), '{{var1}}')]/parent::*/../../..//tbody//div[@class='data-grid-cell-content' and text()='{{var2}}']" parameterized="true"/>
17+
<element name="headerNameandValueUSD" type="text" selector="//div[@data-role='grid-wrapper']//span[@class='data-grid-cell-content' and contains(text(), '{{var1}}')]/parent::*/../../..//tbody//div[@class='data-grid-cell-content' and text()='${{var2}}']" parameterized="true"/>
1618
</section>
1719
</sections>

0 commit comments

Comments
 (0)