From a070cf368ed4b19c5e63b4453d9af2d72451901e Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 18 Mar 2020 15:00:43 +0200 Subject: [PATCH] magento/magento2#25540: MFTF test added. --- .../Test/UpdateBundleProductViaImportTest.xml | 70 +++++++++++++++++++ .../_data/catalog_product_import_bundle.csv | 3 + 2 files changed, 73 insertions(+) create mode 100644 app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml create mode 100644 dev/tests/acceptance/tests/_data/catalog_product_import_bundle.csv diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml new file mode 100644 index 0000000000000..45b4c4f5ededd --- /dev/null +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -0,0 +1,70 @@ + + + + + + + + + <description + value="Check that Bundle products are displaying on the storefront after updating product via importing CSV"/> + <severity value="MAJOR"/> + <group value="importExport"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Delete products created via import --> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> + <argument name="sku" value="Bundle"/> + </actionGroup> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSimpleProduct"> + <argument name="sku" value="Simple"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + </after> + + <!-- Create Bundle product via import --> + <actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsCreate"> + <argument name="behavior" value="Add/Update"/> + <argument name="importFile" value="catalog_product_import_bundle.csv"/> + <argument name="importNoticeMessage" value="Created: 2, Updated: 0, Deleted: 0"/> + </actionGroup> + <magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCacheAfterCreate"/> + <magentoCLI command="indexer:reindex" stepKey="indexerReindexAfterCreate"/> + + <!-- Check Bundle product is visible on the storefront--> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPageAfterCreation"> + <argument name="categoryName" value="New"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" + stepKey="assertBundleProductInStockAfterCreation"> + <argument name="productName" value="Bundle"/> + </actionGroup> + + <!-- Update Bundle product via import --> + <actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsUpdate"> + <argument name="behavior" value="Add/Update"/> + <argument name="importFile" value="catalog_product_import_bundle.csv"/> + <argument name="importNoticeMessage" value="Created: 0, Updated: 2, Deleted: 0"/> + </actionGroup> + <magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCacheAfterUpdate"/> + <magentoCLI command="indexer:reindex" stepKey="indexerReindexAfterUpdate"/> + + <!-- Check Bundle product is still visible on the storefront--> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPageAfterUpdate"> + <argument name="categoryName" value="New"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" + stepKey="assertBundleProductInStockAfterUpdate"> + <argument name="productName" value="Bundle"/> + </actionGroup> + </test> +</tests> diff --git a/dev/tests/acceptance/tests/_data/catalog_product_import_bundle.csv b/dev/tests/acceptance/tests/_data/catalog_product_import_bundle.csv new file mode 100644 index 0000000000000..6804675940a02 --- /dev/null +++ b/dev/tests/acceptance/tests/_data/catalog_product_import_bundle.csv @@ -0,0 +1,3 @@ +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,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,associated_skus,downloadable_links,downloadable_samples,configurable_variations,configurable_variation_labels +Simple,,Default,simple,"Default Category/New",base,Simple,,,1.000000,1,"Taxable Goods","Catalog, Search",100.000000,,,,simple,Simple,Simple,"Simple ",,,,,,,,,"3/18/20, 6:56 AM","3/18/20, 6:56 AM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config",,,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, +Bundle,,Default,bundle,"Default Category/New",base,Bundle,,,,1,"Taxable Goods","Catalog, Search",,,,,bundle,Bundle,Bundle,"Bundle ",,,,,,,,,"3/18/20, 6:57 AM","3/18/20, 6:57 AM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config",,,0.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,dynamic,dynamic,"Price range",dynamic,"name=Test Option,type=select,required=1,sku=Simple,price=0.0000,default=1,default_qty=1.0000,price_type=fixed,can_change_qty=0",together,,,,,