Skip to content

Commit 383ad4a

Browse files
committed
MC-6311: Checking double Import of products CSV file
1 parent cb73be4 commit 383ad4a

File tree

4 files changed

+591
-0
lines changed

4 files changed

+591
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenProductIndexPageActionGroup">
11+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndexPage"/>
12+
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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="AdminCheckDoubleImportOfProductsTest">
12+
<annotations>
13+
<description value="Checking double Import of products CSV file"/>
14+
<stories value="Import Products"/>
15+
<features value="Import/Export"/>
16+
<title value="Admin check double import of products test"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-6311"/>
19+
<group value="importExport"/>
20+
</annotations>
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
25+
<!-- Create additional store views -->
26+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstStoreView">
27+
<argument name="customStore" value="secondStoreView"/>
28+
</actionGroup>
29+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
30+
<argument name="customStore" value="thirdStoreView"/>
31+
</actionGroup>
32+
</before>
33+
<after>
34+
<!-- Delete all imported products -->
35+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/>
36+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
37+
<actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage">
38+
<argument name="perPage" value="100"/>
39+
</actionGroup>
40+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
41+
42+
<!-- Delete additional store views -->
43+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView">
44+
<argument name="customStore" value="secondStoreView"/>
45+
</actionGroup>
46+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteSecondStoreView">
47+
<argument name="customStore" value="thirdStoreView"/>
48+
</actionGroup>
49+
50+
<!-- Log out -->
51+
<actionGroup ref="logout" stepKey="logout"/>
52+
</after>
53+
54+
<!-- Import products with add/update behavior -->
55+
<actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsFirstTime">
56+
<argument name="behavior" value="Add/Update"/>
57+
<argument name="importFile" value="prepared-for-sample-data.csv"/>
58+
<argument name="importMessage" value="Created: 100, Updated: 3, Deleted: 0"/>
59+
</actionGroup>
60+
61+
<!-- Import products with add/update behavior again -->
62+
<actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsSecondTime">
63+
<argument name="behavior" value="Add/Update"/>
64+
<argument name="importFile" value="prepared-for-sample-data.csv"/>
65+
<argument name="importMessage" value="Created: 0, Updated: 300, Deleted: 0"/>
66+
</actionGroup>
67+
</test>
68+
</tests>

app/code/Magento/Store/Test/Mftf/Data/StoreData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,14 @@
184184
<data key="store_type">store</data>
185185
<data key="store_action">add</data>
186186
</entity>
187+
188+
<!-- Store views from file "prepared-for-sample-data.csv"-->
189+
<entity name="secondStoreView" type="store">
190+
<data key="name">second_storeview</data>
191+
<data key="code">second_storeview</data>
192+
</entity>
193+
<entity name="thirdStoreView" type="store">
194+
<data key="name">third_store_view</data>
195+
<data key="code">third_store_view</data>
196+
</entity>
187197
</entities>

0 commit comments

Comments
 (0)