Skip to content

Commit 21d42cb

Browse files
committed
B2B-1640: Add MFTF test for MC-38222
- Adding MFTF import test for MC-38222
1 parent 63434d2 commit 21d42cb

9 files changed

+397
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateToCategoryUrlActionGroup">
10+
<annotations>
11+
<description>Goes to the Storefront Category page for the provided Category URL.</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="categoryUrl" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="goToStorefrontCategoryPage"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageSelectDropDownOptionValueActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
</arguments>
1919

2020
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="fillDropDownAttributeOption"/>
21+
<waitForPageLoad stepKey="waitForPageLoad"/>
2122
</actionGroup>
2223
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<element name="imageFileUpload" type="input" selector="#fileupload"/>
1414
<element name="imageUploadButton" type="button" selector="div.image div.fileinput-button"/>
1515
<element name="imageFile" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]" parameterized="true"/>
16+
<element name="imageElement" type="text" selector="#media_gallery_content img"/>
1617
<element name="removeImageButton" type="button" selector=".action-remove"/>
1718
<element name="removeImageButtonForExactImage" type="button" selector="[id='media_gallery_content'] img[src*='{{imageName}}'] + div[class='actions'] button[class='action-remove']" parameterized="true"/>
1819
<element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickCheckDataImportActionGroup">
12+
<annotations>
13+
<description>Clicks the 'Check Data' button on the Admin Import page.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="waitForCheckDataButton"/>
16+
<click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/>
17+
<waitForPageLoad stepKey="waitForPageLoad"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickImportActionGroup">
12+
<annotations>
13+
<description>Clicks the 'Import' button on the Admin Import page.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{AdminImportMainSection.importButton}}" stepKey="waitForImportButton"/>
16+
<click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/>
17+
<waitForPageLoad stepKey="waitForPageLoad"/>
18+
<waitForElementVisible selector="{{AdminImportValidationMessagesSection.notice}}" stepKey="waitForNoticeMessage"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillImportFormActionGroup">
12+
<annotations>
13+
<description>Fills the form on the System > Data Transfer > Import page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="entityType" defaultValue="Products" type="string"/>
17+
<argument name="importBehavior" defaultValue="Add/Update" type="string"/>
18+
<argument name="validationStrategy" defaultValue="Stop on Error" type="string" />
19+
<argument name="allowedErrorsCount" defaultValue="10" type="string" />
20+
<argument name="importFile" type="string"/>
21+
</arguments>
22+
<waitForElementVisible selector="{{AdminImportMainSection.entityType}}" stepKey="waitForEntityType"/>
23+
<selectOption selector="{{AdminImportMainSection.entityType}}" userInput="{{entityType}}" stepKey="selectEntityType"/>
24+
<waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehavior"/>
25+
<selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="{{importBehavior}}" stepKey="selectImportBehaviorOption"/>
26+
<selectOption selector="{{AdminImportMainSection.validationStrategy}}" userInput="{{validationStrategy}}" stepKey="selectValidationStrategyOption"/>
27+
<fillField selector="{{AdminImportMainSection.allowedErrorsCount}}" userInput="{{allowedErrorsCount}}" stepKey="fillAllowedErrorsCountField"/>
28+
<attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="{{importFile}}" stepKey="attachFileForImport"/>
29+
</actionGroup>
30+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToImportPageActionGroup">
12+
<annotations>
13+
<description>Navigates to the admin System > Data Transfer > Import page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToImportPage"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<!-- Categories -->
12+
<entity name="Import1" type="category">
13+
<data key="name">Import1</data>
14+
<data key="name_lwr">import1</data>
15+
<data key="is_active">true</data>
16+
<data key="include_in_menu">true</data>
17+
</entity>
18+
19+
<!-- Products -->
20+
<entity name="ImportSimple1" type="product">
21+
<data key="name">import-simple1</data>
22+
<data key="sku">import-simple1</data>
23+
<data key="type_id">simple</data>
24+
<data key="attribute_set_id">4</data>
25+
<data key="price">12.00</data>
26+
<data key="visibility">4</data>
27+
<data key="status">1</data>
28+
<data key="quantity">100</data>
29+
<data key="urlKey">import-simple1</data>
30+
<data key="weight">12</data>
31+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
32+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
33+
</entity>
34+
<entity name="ImportSimple2" type="product">
35+
<data key="name">import-simple2</data>
36+
<data key="sku">import-simple2</data>
37+
<data key="type_id">simple</data>
38+
<data key="attribute_set_id">4</data>
39+
<data key="price">15.00</data>
40+
<data key="visibility">4</data>
41+
<data key="status">1</data>
42+
<data key="quantity">100</data>
43+
<data key="urlKey">import-simple2</data>
44+
<data key="weight">12</data>
45+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
46+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
47+
</entity>
48+
<entity name="ImportSimple3" type="product">
49+
<data key="name">import-simple3</data>
50+
<data key="sku">import-simple3</data>
51+
<data key="type_id">simple</data>
52+
<data key="attribute_set_id">4</data>
53+
<data key="price">10.00</data>
54+
<data key="visibility">4</data>
55+
<data key="status">1</data>
56+
<data key="quantity">100</data>
57+
<data key="urlKey">import-simple3</data>
58+
<data key="weight">12</data>
59+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
60+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
61+
</entity>
62+
<entity name="ImportConfigurable" type="product">
63+
<data key="name">import-configurable</data>
64+
<data key="sku">import-configurable</data>
65+
<data key="type_id">configurable</data>
66+
<data key="attribute_set_id">4</data>
67+
<data key="price"/>
68+
<data key="visibility">4</data>
69+
<data key="status">1</data>
70+
<data key="quantity"/>
71+
<data key="urlKey">import-configurable</data>
72+
<data key="weight">12</data>
73+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
74+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
75+
</entity>
76+
77+
<!-- Product Attributes -->
78+
<entity name="ProductAttributeFrontendLabelImport1" type="FrontendLabel">
79+
<data key="store_id">0</data>
80+
<data key="label">import_attribute1</data>
81+
</entity>
82+
<entity name="ProductAttributeWithThreeOptionsForImport" extends="productAttributeDropdownTwoOptions" type="ProductAttribute">
83+
<data key="attribute_code">import_attribute1</data>
84+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelImport1</requiredEntity>
85+
</entity>
86+
<entity name="ProductAttributeOptionThreeForImport" extends="productAttributeOption3" type="ProductAttributeOption">
87+
<data key="label">option3</data>
88+
</entity>
89+
90+
<!-- Images -->
91+
<entity name="TestImageImageContentExportImport" extends="TestImageContent" type="ImageContent">
92+
<data key="name">test_image.jpg</data>
93+
</entity>
94+
<entity name="ApiProductAttributeMediaGalleryForExportImport2" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry">
95+
<data key="label">Test Image</data>
96+
<requiredEntity type="ImageContent">TestImageImageContentExportImport</requiredEntity>
97+
</entity>
98+
</entities>

0 commit comments

Comments
 (0)