Skip to content

Commit a9d8b8f

Browse files
Fixed review comments
1 parent 4616ec8 commit a9d8b8f

File tree

4 files changed

+44
-45
lines changed

4 files changed

+44
-45
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@
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']"/>
2726
</section>
2827
</sections>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
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"/>
30-
</section>
28+
<element name="orderTotalPrices" type="text" selector="//strong[text()='{{GrandTotal}}']//ancestor::tr//span[@class = 'price' and text()='{{price}}']" parameterized="true"/>
29+
<element name="subtotalAndShipping" type="text" selector="//td[@class='label' and contains(text(),'{{SubTotal}}')]//parent::tr//span[@class='price' and text()='{{price}}']" parameterized="true"/> </section>
3130
</sections>
Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<test name="CreateCreditMemowithBaseCurrencyUSDandDisplayCurrencyEuroTest">
1111
<annotations>
1212
<features value="Order"/>
13-
<stories value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
14-
<title value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
15-
<description value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/>
16-
<severity value="MAJOR"/>
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"/>
1717
<testCaseId value="AC-4521"/>
1818
</annotations>
1919
<before>
@@ -22,7 +22,6 @@
2222
<!-- Create SimpleProductWithPrice100 -->
2323
<createData entity="SimpleProduct_100" stepKey="createProduct"/>
2424
<!-- Currency Options settings -->
25-
<magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSD"/>
2625
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURandUSD"/>
2726
<magentoCLI command="config:set {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEUR"/>
2827
<!-- Login as Admin -->
@@ -35,42 +34,47 @@
3534
<argument name="secondCurrency" value="EUR"/>
3635
<argument name="rate" value="0.7067"/>
3736
</actionGroup>
38-
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
39-
<magentoCLI stepKey="flushCache" command="cache:flush"/>
37+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
38+
<argument name="tags" value="config full_page"/>
39+
</actionGroup>
4040
</before>
4141
<after>
4242
<magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="resetCurrencyBaseBackToUSD"/>
4343
<magentoCLI command="config:set {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="resetDefaultCurrencyBaseBackToUSD"/>
4444
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="resetAllowedCurrencyBaseBackToUSD"/>
45+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
46+
<argument name="tags" value="config full_page"/>
47+
</actionGroup>
48+
<!-- Customer log out -->
49+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
4550
<!-- Delete customer -->
4651
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
4752
<!-- Delete product -->
4853
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
4954
<!-- Admin log out -->
5055
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
51-
<!-- Customer log out -->
52-
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
5356
</after>
5457
<!--Login as customer -->
5558
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
5659
<argument name="Customer" value="$$createCustomer$$"/>
5760
</actionGroup>
5861
<!--Navigate To Simple Product Page -->
59-
<comment userInput="Add product to the shopping cart" stepKey="addSimpleProductToCart"/>
60-
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
61-
<waitForPageLoad stepKey="waitForProductPageLoad"/>
62-
<!-- Verify price for simple product with attribute option €70.67 -->
63-
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertFirstSimpleProductPrices">
62+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToSimpleProductPage">
63+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
64+
</actionGroup>
65+
<!-- Verify product prices for simple product-->
66+
<actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertSimpleProductPrices">
6467
<argument name="productPrice" value="€70.67"/>
6568
<argument name="productFinalPrice" value="€70.67"/>
6669
</actionGroup>
67-
<!-- Customer placed order from storefront with payment method -->
70+
<!-- Add product to cart -->
6871
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
6972
<argument name="product" value="$$createProduct$$"/>
7073
</actionGroup>
71-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
74+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCart"/>
75+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/>
7276
<!-- verify flat rate €3.53-->
73-
<see selector="{{CheckoutShippingMethodsSection.price}}" stepKey="seeflatRate" userInput="€3.53"/>
77+
<waitForText selector="{{CheckoutShippingMethodsSection.price}}" stepKey="seeflatRate" userInput="€3.53"/>
7478
<!-- click on Next button -->
7579
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
7680
<!-- verify order summary -->
@@ -80,45 +84,43 @@
8084
<argument name="shippingMethod" value="Flat Rate - Fixed"/>
8185
<argument name="total" value="€74.20"/>
8286
</actionGroup>
83-
<!-- application issue -->
84-
<see userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/>
87+
<waitForText userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/>
8588
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
89+
<waitForElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderId"/>
8690
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>
8791
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
8892
<!-- clear filter if set -->
89-
<conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
90-
<actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchForOrder">
91-
<argument name="keyword" value="{$orderId}"/>
93+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
94+
<argument name="entityId" value="{$orderId}"/>
9295
</actionGroup>
93-
<click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/>
94-
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
95-
<!-- Generate invoice -->
96-
<click selector="{{AdminOrderFormItemsSection.tab_invoice}}" stepKey="clickOnInvoiceBtn"/>
97-
<click selector="{{AdminOrderFormItemsSection.invoice_submit}}" stepKey="submitInvoice"/>
98-
<waitForElementVisible selector="{{AdminMessagesSection.successMsg}}" stepKey="waitForSuccessMessage"/>
96+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickOnInvoiceBtn"/>
97+
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
98+
99+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
99100
<!-- Click 'Credit Memo' button and create new memo -->
100-
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo"/>
101-
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage"/>
102-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle"/>
101+
<actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="createCreditMemo"/>
103102
<actionGroup ref="AssertAdminCreditMemoNewPageTotalsActionGroup" stepKey="assertCreditMemoRefundTotals">
104103
<argument name="refundShipping" value="5.00"/>
105104
<argument name="adjustmentRefund" value="0.00"/>
106105
<argument name="adjustmentFee" value="0.00"/>
107106
<argument name="subtotalRow" value="$100.00"/>
108107
<argument name="grandTotal" value="$105.00"/>
109108
</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"/>
109+
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.orderTotalPrices('Grand Total','€74.20')}}" stepKey="seeGrandTotalValueEURO"/>
110+
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.subtotalAndShipping('Subtotal','€70.67')}}" stepKey="seeSubTotalValueEURO"/>
111+
<actionGroup ref="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup" stepKey="clickRefundOffline"/>
115112
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPageAgain"/>
116113
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
117114
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsdropDown"/>
118115
<checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Total Refunded')}}" stepKey="showRefundedColumn"/>
119116
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsdropDown"/>
120-
<seeElement selector="{{AdminGridHeaders.headerNameandValueUSD('Grand Total (Base)','105.00')}}" stepKey="seeGrandTotalBase"/>
121-
<seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/>
122-
<seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/>
117+
<waitForElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="waitForGrandTotalBaseValue"/>
118+
<grabTextFrom selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="grabGrandTotalBaseValue"/>
119+
<assertEquals stepKey="seeGrandTotalBase">
120+
<actualResult type="const">$grabGrandTotalBaseValue</actualResult>
121+
<expectedResult type="string">$105.00</expectedResult>
122+
</assertEquals>
123+
<waitForElementVisible selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/>
124+
<waitForElementVisible selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/>
123125
</test>
124126
</tests>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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"/>
16+
<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"/>
1817
</section>
1918
</sections>

0 commit comments

Comments
 (0)