Skip to content

Commit 2d5f881

Browse files
MAGETWO-44165: [FT] Magento\Catalog\Test\TestCase\Product\ProductTypeSwitchingOnCreationTest fails
- Migrate tests to mftf.
1 parent 6cc68c6 commit 2d5f881

File tree

1 file changed

+106
-3
lines changed

1 file changed

+106
-3
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml

Lines changed: 106 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
<testCaseId value="MC-10930"/>
5454
<group value="catalog"/>
5555
<group value="mtf_migrated"/>
56-
<skip>
57-
<issueId value="MAGETWO-62808"/>
58-
</skip>
5956
</annotations>
6057
<before>
6158
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
@@ -83,4 +80,110 @@
8380
<argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/>
8481
</actionGroup>
8582
</test>
83+
<test name="AdminCreateSimpleProductSwitchToConfigurableTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
84+
<annotations>
85+
<features value="Catalog"/>
86+
<stories value="Product Type Switching"/>
87+
<title value="Admin should be able to switch a new product from simple to configurable"/>
88+
<description value="After selecting a simple product when adding Admin should be switch to configurable implicitly"/>
89+
<severity value="CRITICAL"/>
90+
<testCaseId value="MAGETWO-29398"/>
91+
<group value="catalog"/>
92+
<group value="mtf_migrated"/>
93+
</annotations>
94+
<before>
95+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
96+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
97+
<requiredEntity createDataKey="createConfigProductAttribute"/>
98+
</createData>
99+
</before>
100+
<after>
101+
<deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/>
102+
</after>
103+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
104+
<argument name="productType" value="simple"/>
105+
</actionGroup>
106+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
107+
<argument name="product" value="_defaultProduct"/>
108+
</actionGroup>
109+
<comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/>
110+
<actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm">
111+
<argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/>
112+
</actionGroup>
113+
<actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/>
114+
<see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/>
115+
<actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage">
116+
<argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/>
117+
<argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/>
118+
</actionGroup>
119+
</test>
120+
<test name="AdminCreateDownloadableProductSwitchToConfigurableTest">
121+
<annotations>
122+
<features value="Catalog"/>
123+
<stories value="Product Type Switching"/>
124+
<title value="Admin should be able to switch a new product from downloadable to configurable"/>
125+
<description value="After selecting a downloadable product when adding Admin should be switch to configurable implicitly"/>
126+
<severity value="CRITICAL"/>
127+
<testCaseId value="MAGETWO-29398"/>
128+
<group value="catalog"/>
129+
<group value="mtf_migrated"/>
130+
</annotations>
131+
<before>
132+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
133+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
134+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
135+
<requiredEntity createDataKey="createConfigProductAttribute"/>
136+
</createData>
137+
</before>
138+
<after>
139+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
140+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct">
141+
<argument name="product" value="_defaultProduct"/>
142+
</actionGroup>
143+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/>
144+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
145+
<deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/>
146+
<actionGroup ref="logout" stepKey="logout"/>
147+
</after>
148+
149+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
150+
<!-- Open Dropdown and select downloadable product option -->
151+
<comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/>
152+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
153+
<argument name="productType" value="downloadable"/>
154+
</actionGroup>
155+
156+
<scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInfo" />
157+
<wait stepKey="2" time="3"/>
158+
<uncheckOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/>
159+
160+
<!-- Fill form for Downloadable Product Type -->
161+
<comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/>
162+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
163+
<argument name="product" value="_defaultProduct"/>
164+
</actionGroup>
165+
<actionGroup ref="SetProductUrlKey" stepKey="setProductUrl">
166+
<argument name="product" value="_defaultProduct"/>
167+
</actionGroup>
168+
<comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/>
169+
<actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration">
170+
<argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/>
171+
</actionGroup>
172+
<actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/>
173+
<!-- Check that product was added with implicit type change -->
174+
<comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/>
175+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
176+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/>
177+
<actionGroup ref="filterProductGridByName" stepKey="searchForProduct">
178+
<argument name="product" value="_defaultProduct"/>
179+
</actionGroup>
180+
<see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/>
181+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
182+
<argument name="product" value="_defaultProduct"/>
183+
</actionGroup>
184+
<actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption">
185+
<argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/>
186+
<argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/>
187+
</actionGroup>
188+
</test>
86189
</tests>

0 commit comments

Comments
 (0)