Skip to content

Commit e7df778

Browse files
committed
Merge remote-tracking branch 'origin/MC-4405' into mtf-eol
2 parents ff970ca + f4ad401 commit e7df778

File tree

11 files changed

+260
-2
lines changed

11 files changed

+260
-2
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,30 @@
328328
</assertEquals>
329329
</actionGroup>
330330

331+
<!-- This action group goes to the product index page, opens the drop down and clicks the specified product type for adding a product -->
332+
<actionGroup name="GoToSpecifiedCreateProductPage">
333+
<arguments>
334+
<argument type="string" name="productType" defaultValue="simple"/>
335+
</arguments>
336+
<comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/>
337+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
338+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
339+
<click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/>
340+
<waitForPageLoad stepKey="waitForFormToLoad"/>
341+
</actionGroup>
342+
343+
<!-- This action group simply navigates to the product catalog page -->
344+
<actionGroup name="GoToProductCatalogPage">
345+
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
346+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
347+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
348+
</actionGroup>
349+
350+
<actionGroup name="SetProductUrlKey">
351+
<arguments>
352+
<argument name="product" defaultValue="_defaultProduct"/>
353+
</arguments>
354+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
355+
<fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
356+
</actionGroup>
331357
</actionGroups>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminProductDeletePage" url="catalog/product/delete/id/{{productId}}/" area="admin" module="Magento_Catalog" parameterized="true">
12+
<!-- This page object only exists for the url. Use the AdminProductCreatePage for selectors. -->
13+
</page>
14+
</pages>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<element name="productImage" type="text" selector="img.product-image-photo"/>
2626
<element name="productLink" type="text" selector="a.product-item-link"/>
2727
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
28-
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
28+
<element name="productPrice" type="text" selector=".price-final_price"/>
2929
<element name="categoryImage" type="text" selector=".category-image"/>
3030
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
3131
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<element name="productName" type="text" selector=".base"/>
1414
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
1515
<element name="productPriceLabel" type="text" selector=".price-label"/>
16-
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
16+
<element name="productPrice" type="text" selector=".price-final_price"/>
1717
<element name="qty" type="input" selector="#qty"/>
1818
<element name="specialPrice" type="text" selector=".special-price"/>
1919
<element name="specialPriceAmount" type="text" selector=".special-price span.price"/>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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="AdminCreateSimpleProductSwitchToVirtualTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Type Switching"/>
15+
<title value="Admin should be able to switch a new product from simple to virtual"/>
16+
<description value="After selecting a simple product when adding Admin should be switch to virtual implicitly"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-10925"/>
19+
<group value="catalog"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
27+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct">
28+
<argument name="product" value="_defaultProduct"/>
29+
</actionGroup>
30+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/>
31+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
32+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
33+
</after>
34+
35+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
36+
<!-- Open Dropdown and select simple product option -->
37+
<comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/>
38+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
39+
<argument name="productType" value="simple"/>
40+
</actionGroup>
41+
42+
<!-- Fill form for Virtual Product Type -->
43+
<comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/>
44+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm">
45+
<argument name="product" value="_defaultProduct"/>
46+
</actionGroup>
47+
<actionGroup ref="SetProductUrlKey" stepKey="setProductUrl">
48+
<argument name="product" value="_defaultProduct"/>
49+
</actionGroup>
50+
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>
51+
<!-- Check that product was added with implicit type change -->
52+
<comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/>
53+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
54+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/>
55+
<actionGroup ref="filterProductGridByName" stepKey="searchForProduct">
56+
<argument name="product" value="_defaultProduct"/>
57+
</actionGroup>
58+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/>
59+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
60+
<argument name="product" value="_defaultProduct"/>
61+
</actionGroup>
62+
</test>
63+
<test name="AdminCreateVirtualProductSwitchToSimpleTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
64+
<annotations>
65+
<features value="Catalog"/>
66+
<stories value="Product Type Switching"/>
67+
<title value="Admin should be able to switch a new product from virtual to simple"/>
68+
<description value="After selecting a virtual product when adding Admin should be switch to simple implicitly"/>
69+
<severity value="CRITICAL"/>
70+
<testCaseId value="MC-10925"/>
71+
<group value="catalog"/>
72+
<group value="mtf_migrated"/>
73+
</annotations>
74+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
75+
<argument name="productType" value="virtual"/>
76+
</actionGroup>
77+
<!-- Fill form for Virtual Product Type -->
78+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
79+
<argument name="product" value="_defaultProduct"/>
80+
</actionGroup>
81+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/>
82+
</test>
83+
</tests>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,10 @@
150150
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
151151
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
152152
</actionGroup>
153+
154+
<actionGroup name="saveConfiguredProduct">
155+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
156+
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
157+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
158+
</actionGroup>
153159
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,13 @@
2424
<see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/>
2525
<see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/>
2626
</actionGroup>
27+
28+
<!-- Check Storefront Configurable Product Option -->
29+
<actionGroup name="VerifyOptionInProductStorefront">
30+
<arguments>
31+
<argument name="attributeCode" type="string"/>
32+
<argument name="optionName" type="string"/>
33+
</arguments>
34+
<seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/>
35+
</actionGroup>
2736
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<!-- Parameter is the order number of the attribute on the page (1 is the newest) -->
1818
<element name="nthAttributeOnPage" type="block" selector="tr:nth-of-type({{numElement}}) .data" parameterized="true"/>
1919
<element name="stockIndication" type="block" selector=".stock" />
20+
<element name="attributeOptionByAttributeID" type="select" selector="//div[@class='fieldset']//div[//span[text()='{{attribute_code}}']]//option[text()='{{optionName}}']" parameterized="true"/>
2021
</section>
2122
</sections>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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="AdminCreateConfigurableProductSwitchToSimpleTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Type Switching"/>
15+
<title value="Admin should be able to switch a new product from configurable to simple"/>
16+
<description value="After selecting a configurable product when adding Admin should be switch to simple implicitly"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-10925"/>
19+
<group value="catalog"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
23+
<argument name="productType" value="configurable"/>
24+
</actionGroup>
25+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
26+
<argument name="product" value="_defaultProduct"/>
27+
</actionGroup>
28+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/>
29+
</test>
30+
<test name="AdminCreateConfigurableProductSwitchToVirtualTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
31+
<annotations>
32+
<features value="Catalog"/>
33+
<stories value="Product Type Switching"/>
34+
<title value="Admin should be able to switch a new product from configurable to virtual"/>
35+
<description value="After selecting a configurable product when adding Admin should be switch to virtual implicitly"/>
36+
<severity value="CRITICAL"/>
37+
<testCaseId value="MC-10925"/>
38+
<group value="catalog"/>
39+
<group value="mtf_migrated"/>
40+
</annotations>
41+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
42+
<argument name="productType" value="configurable"/>
43+
</actionGroup>
44+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/>
45+
</test>
46+
<test name="AdminCreateSimpleProductSwitchToConfigurableTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
47+
<annotations>
48+
<features value="Catalog"/>
49+
<stories value="Product Type Switching"/>
50+
<title value="Admin should be able to switch a new product from simple to configurable"/>
51+
<description value="After selecting a simple product when adding Admin should be switch to configurable implicitly"/>
52+
<severity value="CRITICAL"/>
53+
<testCaseId value="MC-10925"/>
54+
<group value="catalog"/>
55+
<group value="mtf_migrated"/>
56+
</annotations>
57+
<before>
58+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
59+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
60+
<requiredEntity createDataKey="createConfigProductAttribute"/>
61+
</createData>
62+
</before>
63+
<after>
64+
<deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/>
65+
</after>
66+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
67+
<argument name="productType" value="simple"/>
68+
</actionGroup>
69+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
70+
<argument name="product" value="_defaultProduct"/>
71+
</actionGroup>
72+
<comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/>
73+
<actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm">
74+
<argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/>
75+
</actionGroup>
76+
<actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/>
77+
<see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/>
78+
<actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage">
79+
<argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/>
80+
<argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/>
81+
</actionGroup>
82+
</test>
83+
</tests>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="AdminCreateDownloadableProductSwitchToSimpleTest" extends="AdminCreateSimpleProductSwitchToVirtualTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Type Switching"/>
15+
<title value="Admin should be able to switch a new product from downloadable to simple"/>
16+
<description value="After selecting a downloadable product when adding Admin should be switch to simple implicitly"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-10925"/>
19+
<group value="catalog"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm">
23+
<argument name="productType" value="downloadable"/>
24+
</actionGroup>
25+
<!-- Fill form for Virtual Product Type -->
26+
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
27+
<argument name="product" value="_defaultProduct"/>
28+
</actionGroup>
29+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/>
30+
</test>
31+
</tests>

0 commit comments

Comments
 (0)