Skip to content

Commit ae4eee5

Browse files
committed
Added MFTF Test coverage for the js issue fix
1 parent 19c17f5 commit ae4eee5

File tree

3 files changed

+166
-0
lines changed

3 files changed

+166
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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="AddTextSwatchToConfigurableProductActionGroup">
12+
<annotations>
13+
<description>Add text swatch property attribute.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/>
17+
<argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/>
18+
<argument name="4" defaultValue="4" type="string"/>
19+
<argument name="24" defaultValue="24" type="string"/>
20+
<argument name="30" defaultValue="30" type="string"/>
21+
<argument name="usedInProductListing" defaultValue="No" type="string"/>
22+
<argument name="usedInLayeredNavigation" defaultValue="No" type="string"/>
23+
</arguments>
24+
25+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/>
26+
<waitForPageLoad stepKey="waitForNewProductAttributePage"/>
27+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
28+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/>
29+
<selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="Yes" stepKey="setUpdateProductPreviewImage"/>
30+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/>
31+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{4}}" stepKey="fillSwatch1"/>
32+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{4}}" stepKey="fillSwatch1Description"/>
33+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/>
34+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{24}}" stepKey="fillSwatch2"/>
35+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{24}}" stepKey="fillSwatch2Description"/>
36+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/>
37+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{30}}" stepKey="fillSwatch3"/>
38+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{30}}" stepKey="fillSwatch3Description"/>
39+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/>
40+
<selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/>
41+
<fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/>
42+
<scrollToTopOfPage stepKey="scrollToTabs"/>
43+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
44+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/>
45+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/>
46+
<selectOption selector="{{AttributePropertiesSection.useInLayeredNavigation}}" userInput="{{usedInLayeredNavigation}}" stepKey="useInLayeredNavigation"/>
47+
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/>
48+
</actionGroup>
49+
</actionGroups>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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="StorefrontConfigurableOptionsImportSameBaseImageTest">
12+
<annotations>
13+
<features value="Swatches"/>
14+
<stories value="Configurable product with swatch attribute"/>
15+
<title value="Check thumbnail images and active image for Configurable Product with swatch attribute"/>
16+
<description value="Login as admin, create attribute with three options, configurable product with three
17+
associated simple products. Add few images for products, check the fotorama thumbnail images
18+
(visible and active) for each selected option for the configurable product"/>
19+
<severity value="MAJOR"/>
20+
<group value="swatches"/>
21+
</annotations>
22+
<before>
23+
<!-- Login as Admin -->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
25+
26+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages">
27+
<argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument>
28+
</helper>
29+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage">
30+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.baseImage}}</argument>
31+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.baseImage}}</argument>
32+
</helper>
33+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage">
34+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.baseImage}}</argument>
35+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.baseImage}}</argument>
36+
</helper>
37+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage">
38+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument>
39+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument>
40+
</helper>
41+
</before>
42+
<after>
43+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute">
44+
<argument name="productAttributeLabel" value="Set Size" />
45+
</actionGroup>
46+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory">
47+
<argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument>
48+
</helper>
49+
<!-- Logout -->
50+
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
51+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
52+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
53+
</after>
54+
<!--Create text swatch attribute with 3 options: Small, Medium and Large-->
55+
<actionGroup ref="AddTextSwatchToConfigurableProductActionGroup" stepKey="addSizeAttribute">
56+
<argument name="attributeName" value="Set Size"/>
57+
<argument name="attributeCode" value="set_size"/>
58+
<argument name="4" value="4"/>
59+
<argument name="24" value="24"/>
60+
<argument name="30" value="30"/>
61+
</actionGroup>
62+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
63+
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/>
64+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
65+
<dragAndDrop selector1="{{UnassignedAttributes.ProductAttributeName('set_size')}}" selector2="{{Group.FolderName('Product Details')}}" stepKey="moveProductAttributeToGroup"/>
66+
<click selector="{{AttributeSetSection.Save}}" stepKey="saveAttributeSet"/>
67+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" />
68+
69+
<actionGroup ref="AdminImportProductsWithCustomImagesDirectoryActionGroup" stepKey="adminImportProduct">
70+
<argument name="behavior" value="Add/Update"/>
71+
<argument name="importFile" value="import_configurable_product_same_images.csv"/>
72+
<argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/>
73+
</actionGroup>
74+
75+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
76+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
77+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
78+
<argument name="tags" value="config full_page"/>
79+
</actionGroup>
80+
81+
<!-- Open the configurable product page on storefront -->
82+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
83+
<argument name="productUrlKey" value="{{ImportProduct_Configurable.name}}"/>
84+
</actionGroup>
85+
<!-- Select first option -->
86+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectFirstOptionValue">
87+
<argument name="optionName" value="4"/>
88+
</actionGroup>
89+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(ImportProductSimple3_Configurable.baseImage)}}" stepKey="seeFirstImageInRibbon"/>
90+
<!-- Select second option -->
91+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectSecondOptionValue">
92+
<argument name="optionName" value="24"/>
93+
</actionGroup>
94+
<!-- Select third option -->
95+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectThirdOptionValue">
96+
<argument name="optionName" value="30"/>
97+
</actionGroup>
98+
99+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
100+
<argument name="sku" value="import-product-configurable"/>
101+
</actionGroup>
102+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct2">
103+
<argument name="sku" value="import-product-simple1-configurable"/>
104+
</actionGroup>
105+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct3">
106+
<argument name="sku" value="import-product-simple2-configurable"/>
107+
</actionGroup>
108+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct4">
109+
<argument name="sku" value="import-product-simple3-configurable"/>
110+
</actionGroup>
111+
</test>
112+
</tests>
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,associated_skus,downloadable_links,downloadable_samples,configurable_variations,configurable_variation_labels
2+
import-product-simple1-configurable,,Default,simple,,base,import-product-simple1-configurable,,,1,1,Taxable Goods,Search,11,,,,import-product-simple1-configurable,,,,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,Use config,China,set_size=24,101,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,"magento-logo.png,m-logo.gif,adobe-base.jpg",,,,,,,,,,,,,,
3+
import-product-simple2-configurable,,Default,simple,,base,import-product-simple2-configurable,,,2,1,Taxable Goods,Search,12,,,,import-product-simple2-configurable,,,,m-logo.gif,M Logo,m-logo.gif,M Logo,m-logo.gif,M Logo,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,Use config,China,set_size=30,102,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,"m-logo.gif,adobe-base.jpg,magento-logo.png",,,,,,,,,,,,,,
4+
import-product-simple3-configurable,,Default,simple,,base,import-product-simple3-configurable,,,3,1,Taxable Goods,Search,13,,,,import-product-simple3-configurable,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,Use config,China,set_size=4,103,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,"adobe-base.jpg,m-logo.gif,magento-logo.png",,,,,,,,,,,,,,
5+
import-product-configurable,,Default,configurable,Default Category,base,import-product-configurable,,,,1,Taxable Goods,"Catalog, Search",,,,,import-product-configurable,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,Use config,China,,,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,adobe-base.jpg,,,,,,,,,,,,,"sku=import-product-simple1-configurable,set_size=24|sku=import-product-simple2-configurable,set_size=30|sku=import-product-simple3-configurable,set_size=4",set_size=Set Size

0 commit comments

Comments
 (0)