Skip to content

Commit 4c353b2

Browse files
Sahil.kumarManjusha.S
authored andcommitted
MQE-3372:Checkbox return to stock on creditmemo
1 parent 7ba6279 commit 4c353b2

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCreateCreditMemoWithReturnToStockActionGroup">
11+
<annotations>
12+
<description>Create shipment with 'return to stock'. Starts on order page.</description>
13+
</annotations>
14+
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoAction"/>
15+
<click selector="{{AdminCreditMemoItemsSection.itemReturnToStock('1')}}" stepKey="returnToStockCheckbox"/>
16+
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/>
17+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/>
18+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/>
19+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,14 @@
3333
<data key="label">No</data>
3434
<data key="value">0</data>
3535
</entity>
36+
<entity name="CatalogInventoryManageStockAutoReturnEnable">
37+
<!-- Magento default value -->
38+
<data key="path">cataloginventory/item_options/auto_return</data>
39+
<data key="value">1</data>
40+
</entity>
41+
<entity name="CatalogInventoryManageStockAutoReturnDisable">
42+
<!-- Magento default value -->
43+
<data key="path">cataloginventory/item_options/auto_return</data>
44+
<data key="value">0</data>
45+
</entity>
3646
</entities>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="AdminUncheckesReturnToStockCheckboxTest" extends="CustomerOrderSimpleProductTest">
12+
<annotations>
13+
<features value="CatalogInventory"/>
14+
<stories value="Sales restrictions"/>
15+
<title value="Verify that Checkbox return to stock on creditmemo"/>
16+
<description value="Verify that Checkbox return to stock on creditmemo"/>
17+
<severity value="MAJOR"/>
18+
<useCaseId value="MC-27229"/>
19+
<testCaseId value="MC-27229"/>
20+
<group value="catalog"/>
21+
<group value="catalogInventory"/>
22+
</annotations>
23+
<before>
24+
<!-- Enabling Automatically Return Credit Memo Item to Stock -->
25+
<magentoCLI command="config:set {{CatalogInventoryManageStockAutoReturnEnable.path}} {{CatalogInventoryManageStockAutoReturnEnable.value}}" stepKey="manageStockEnable"/>
26+
</before>
27+
<after>
28+
<!-- Disabling Automatically Return Credit Memo Item to Stock -->
29+
<magentoCLI command="config:set {{CatalogInventoryManageStockAutoReturnDisable.path}} {{CatalogInventoryManageStockAutoReturnDisable.value}}" stepKey="manageStockDisable"/>
30+
</after>
31+
<!-- Log in as admin-->
32+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
33+
<!-- go to orders page and validate the order details -->
34+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
35+
<argument name="orderId" value="{$getOrderNumber}"/>
36+
</actionGroup>
37+
38+
<!--Create Invoice-->
39+
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/>
40+
41+
<!--Create Credit Memo-->
42+
<actionGroup ref="AdminCreateCreditMemoWithReturnToStockActionGroup" stepKey="createCreditMemo"/>
43+
44+
45+
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/>
46+
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/>
47+
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct">
48+
<argument name="product" value="_defaultProduct"/>
49+
</actionGroup>
50+
51+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeQuantity">
52+
<argument name="row" value="1"/>
53+
<argument name="column" value="Quantity"/>
54+
<argument name="value" value="${{_defaultProduct.quantity}}"/>
55+
</actionGroup>
56+
57+
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
58+
</test>
59+
</tests>
60+

0 commit comments

Comments
 (0)