Skip to content

Commit 0e0f413

Browse files
committed
MAGETWO-97034: Import Products with Delete Entities
1 parent b1d3061 commit 0e0f413

File tree

6 files changed

+129
-0
lines changed

6 files changed

+129
-0
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: 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+
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+
<element name="noticeMessage" type="text" selector="#import_validation_messages .message.message-notice.notice"/>
17+
</section>
18+
</sections>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminImportProductsWithDeleteEntitiesTest">
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-30587"/>
19+
<group value="importExport"/>
20+
</annotations>
21+
<before>
22+
<!--Create Simple product-->
23+
<createData entity="SimpleProduct2" 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 Gift Card product-->
33+
<createData entity="ApiGiftCard" stepKey="createApiGiftCard">
34+
<field key="name">Api Gift Card for Test</field>
35+
<field key="sku">Api Gift Card for Test</field>
36+
</createData>
37+
<!-- Create Downloadable product -->
38+
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct">
39+
<field key="name">Api Downloadable Product for Test</field>
40+
<field key="sku">Api Downloadable Product for Test</field>
41+
</createData>
42+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
43+
</before>
44+
<after>
45+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/>
46+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
47+
</after>
48+
<amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/>
49+
<selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/>
50+
<waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/>
51+
<selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="Delete" stepKey="selectDeleteOption"/>
52+
<attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="catalog_products.csv" stepKey="attachFileForImport"/>
53+
<click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/>
54+
<waitForAjaxLoad stepKey="waitForFileToImportProcessed"/>
55+
<click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/>
56+
<waitForAjaxLoad stepKey="waitForFileToImportProcessed1"/>
57+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Import successfully done" stepKey="assertSuccessMessage"/>
58+
<see selector="{{AdminImportMainSection.noticeMessage}}" userInput="Created: 0, Updated: 0, Deleted: 4" stepKey="assertNoticeMessage"/>
59+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchSimpleProductOnBackend">
60+
<argument name="product" value="$$createSimpleProduct$$"/>
61+
</actionGroup>
62+
<see selector="{{AdminDataGridTableSection.dataGridNoData}}" userInput="We couldn't find any records." stepKey="assertDataGridNoDataMessage"/>
63+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchVirtualProductOnBackend">
64+
<argument name="product" value="$$createVirtualProduct$$"/>
65+
</actionGroup>
66+
<see selector="{{AdminDataGridTableSection.dataGridNoData}}" userInput="We couldn't find any records." stepKey="assertDataGridNoDataMessage1"/>
67+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchGiftCardOnBackend">
68+
<argument name="product" value="$$createApiGiftCard$$"/>
69+
</actionGroup>
70+
<see selector="{{AdminDataGridTableSection.dataGridNoData}}" userInput="We couldn't find any records." stepKey="assertDataGridNoDataMessage2"/>
71+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchDownloadableProductOnBackend">
72+
<argument name="product" value="$$createDownloadableProduct$$"/>
73+
</actionGroup>
74+
<see selector="{{AdminDataGridTableSection.dataGridNoData}}" userInput="We couldn't find any records." stepKey="assertDataGridNoDataMessage3"/>
75+
</test>
76+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<!--Specific cell e.g. {{Section.gridCell('1', 'Name')}}-->
1919
<element name="gridCell" type="text" selector="//tr[{{row}}]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true"/>
2020
<element name="rowViewAction" type="button" selector=".data-grid tbody > tr:nth-of-type({{row}}) .action-menu-item" parameterized="true" timeout="30"/>
21+
<element name="dataGridNoData" type="block" selector=".data-grid-tr-no-data td"/>
2122
</section>
2223
</sections>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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/17/18, 8:49 AM","12/17/18, 8:49 AM",,,"Block after Info Column",,,,,,,,,,,,,,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/17/18, 8:49 AM","12/17/18, 8:49 AM",,,"Block after Info Column",,,,,,,,,,,,,,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 Gift Card for Test",,Default,giftcard,,base,"Api Gift Card for Test","API Product Description5c17b791672531","API Product Short Description5c17b791672a11",,1,,"Catalog, Search",,,,,api-gift-card-for-test,,,,,,,,,,,,"12/17/18, 8:49 AM","12/17/18, 8:49 AM",,,"Block after Info Column",,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,
5+
"Api Downloadable Product for Test",,Default,downloadable,,base,"Api Downloadable Product for Test","API Product Description5c17b791672532","API Product Short Description5c17b791672a12",,1,"Taxable Goods","Catalog, Search",123.0000,,,,api-downloadable-product-for-test,,,,,,,,,,,,"12/17/18, 8:49 AM","12/17/18, 8:49 AM",,,"Block after Info Column",,,,,,,,,,,,,,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)