Skip to content

Commit 2e44caf

Browse files
committed
Merge branch 'MAGETWO-97033' into 2.2-develop-mftf-pr12
2 parents f0e7a3a + 403426a commit 2e44caf

File tree

6 files changed

+117
-1
lines changed

6 files changed

+117
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminImportIndexPage" url="admin/import/" area="admin" module="Magento_ImportExport">
12+
<section name="AdminImportHeaderSection"/>
13+
<section name="AdminImportMainSection"/>
14+
</page>
15+
</pages>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminImportHeaderSection">
12+
<element name="checkDataButton" type="button" selector="#upload_button" timeout="30"/>
13+
</section>
14+
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminImportMainSection">
12+
<element name="entityType" type="select" selector="#entity"/>
13+
<element name="importBehavior" type="select" selector="#basic_behavior"/>
14+
<element name="selectFileToImport" type="input" selector="#import_file"/>
15+
<element name="importButton" type="button" selector="#import_validation_container button" timeout="30"/>
16+
</section>
17+
</sections>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="AdminImportProductsWithDeleteBehaviorTest">
12+
<annotations>
13+
<description value="Verify Magento native import products with delete behavior."/>
14+
<stories value="Verify Magento native import products with delete behavior."/>
15+
<features value="Import/Export"/>
16+
<title value="Verify Magento native import products with delete behavior."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-79495"/>
19+
<group value="importExport"/>
20+
</annotations>
21+
<before>
22+
<!--Create Simple product-->
23+
<createData entity="SimpleProduct3" stepKey="createSimpleProduct">
24+
<field key="name">Simple Product for Test</field>
25+
<field key="sku">Simple Product for Test</field>
26+
</createData>
27+
<!--Create Virtual product-->
28+
<createData entity="VirtualProduct" stepKey="createVirtualProduct">
29+
<field key="name">Virtual Product for Test</field>
30+
<field key="sku">Virtual Product for Test</field>
31+
</createData>
32+
<!-- Create Downloadable product -->
33+
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct">
34+
<field key="name">Api Downloadable Product for Test</field>
35+
<field key="sku">Api Downloadable Product for Test</field>
36+
</createData>
37+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
38+
</before>
39+
<after>
40+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndexPage"/>
41+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductFilters"/>
42+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
43+
</after>
44+
<amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/>
45+
<selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/>
46+
<waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/>
47+
<selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="Delete" stepKey="selectDeleteOption"/>
48+
<attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="catalog_products.csv" stepKey="attachFileForImport"/>
49+
<click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/>
50+
<click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/>
51+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Import successfully done" stepKey="assertSuccessMessage"/>
52+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchSimpleProductOnBackend">
53+
<argument name="product" value="$$createSimpleProduct$$"/>
54+
</actionGroup>
55+
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/>
56+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchVirtualProductOnBackend">
57+
<argument name="product" value="$$createVirtualProduct$$"/>
58+
</actionGroup>
59+
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage1"/>
60+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchDownloadableProductOnBackend">
61+
<argument name="product" value="$$createDownloadableProduct$$"/>
62+
</actionGroup>
63+
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage2"/>
64+
</test>
65+
</tests>

app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminDataGridTableSection">
1212
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
1313
<element name="columnHeader" type="button" selector="//div[@data-role='grid-wrapper']//table[contains(@class, 'data-grid')]/thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/>
@@ -20,5 +20,6 @@
2020
<element name="rowViewAction" type="button" selector=".data-grid tbody > tr:nth-of-type({{row}}) .action-menu-item" parameterized="true" timeout="30"/>
2121
<element name="rowActionSelect" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap"/>
2222
<element name="rowEditAction" type="button" selector="[data-role='grid'] tbody tr .action-select-wrap._active [data-action='item-edit']" timeout="30"/>
23+
<element name="dataGridEmpty" type="block" selector=".data-grid-tr-no-data td"/>
2324
</section>
2425
</sections>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,deferred_stock_update,use_config_deferred_stock_update,related_skus,related_position,crosssell_skus,crosssell_position,upsell_skus,upsell_position,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,bundle_shipment_type,configurable_variations,configurable_variation_labels,associated_skus
2+
"Simple Product for Test",,Default,simple,,base,"Simple Product for Test",,,,1,"Taxable Goods","Catalog, Search",123.0000,,,,simple-product-for-test,,,,,,,,,,,,"12/26/18, 5:05 AM","12/26/18, 5:05 AM",,,"Block after Info Column",,,,,,,,,,,"Use config",,,1000.0000,0.0000,1,0,0,1,1.0000,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,
3+
"Virtual Product for Test",,Default,virtual,,base,"Virtual Product for Test",,,0.0000,1,"Taxable Goods","Catalog, Search",99.9900,,,,virtual-product-for-test,,,,,,,,,,,,"12/26/18, 5:05 AM","12/26/18, 5:05 AM",,,"Block after Info Column",,,,,,,,,,,"Use config",,,1000.0000,0.0000,1,0,0,1,1.0000,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,
4+
"Api Downloadable Product for Test",,Default,downloadable,,base,"Api Downloadable Product for Test","API Product Description5c23605cc09b71","API Product Short Description5c23605cc0a111",,1,"Taxable Goods","Catalog, Search",123.0000,,,,api-downloadable-product-for-test,,,,,,,,,,,,"12/26/18, 5:05 AM","12/26/18, 5:05 AM",,,"Block after Info Column",,,,,,,,,,,"Use config",,,1000.0000,0.0000,1,0,0,1,1.0000,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,

0 commit comments

Comments
 (0)