Skip to content

Commit 017b813

Browse files
committed
MQE-990: Re-add ConfigurableProduct test changes
1 parent b16dfc6 commit 017b813

12 files changed

+615
-124
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/CategoryData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<data key="is_active">true</data>
1515
</entity>
1616
<entity name="ApiCategory" type="category">
17-
<data key="name" unique="suffix">Api Category</data>
17+
<data key="name" unique="suffix">ApiCategory</data>
1818
<data key="is_active">true</data>
1919
</entity>
2020
<entity name="SimpleSubCategory" type="category">

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridFilterSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductGridFilterSection">
1212
<element name="filters" type="button" selector="button[data-action='grid-filter-expand']"/>
13-
<element name="clearAll" type="button" selector=".admin__data-grid-header .admin__data-grid-filters-current._show .action-clear"/>
13+
<element name="clearAll" type="button" selector=".admin__data-grid-header .admin__data-grid-filters-current._show .action-clear" timeout="30"/>
1414
<element name="enabledFilters" type="textarea" selector=".admin__data-grid-header .admin__data-grid-filters-current._show"/>
1515
<element name="basicSearchFilter" type="textarea" selector=".admin__control-text.data-grid-search-control"/>
1616
<element name="basicSearchFilterButton" type="button" selector=".data-grid-search-control-wrap button.action-submit"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<element name="bulkActionDropdown" type="button" selector="div.admin__data-grid-header-row.row div.action-select-wrap button.action-select"/>
2424
<element name="bulkActionOption" type="button" selector="//div[contains(@class,'admin__data-grid-header-row') and contains(@class, 'row')]//div[contains(@class, 'action-select-wrap')]//ul/li/span[text() = '{{label}}']" parameterized="true"/>
2525
<element name="productGridXRowYColumnButton" type="input" selector="table.data-grid tr.data-row:nth-child({{row}}) td:nth-child({{column}})" parameterized="true" timeout="30"/>
26+
<element name="table" type="text" selector="#container > div > div.admin__data-grid-wrap > table"/>
2627
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
2728
</section>
2829
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminUpdateAttributesSection">
12+
<element name="saveButton" type="button" selector="button[title='Save']" timeout="30"/>
13+
14+
<element name="toggleCountryOfManufacture" type="checkbox" selector="#toggle_country_of_manufacture"/>
15+
<element name="toggleCustomDesign" type="checkbox" selector="#toggle_custom_design"/>
16+
<element name="toggleCustomDesignFrom" type="checkbox" selector="#toggle_custom_design_from"/>
17+
<element name="toggleCustomDesignTo" type="checkbox" selector="#toggle_custom_design_to"/>
18+
<element name="toggleCustomLayout" type="checkbox" selector="#toggle_custom_layout"/>
19+
<element name="toggleCustomLayoutUpdate" type="checkbox" selector="#toggle_custom_layout_update"/>
20+
<element name="toggleDescription" type="checkbox" selector="#toggle_description"/>
21+
<element name="toggleMetaDescription" type="checkbox" selector="#toggle_meta_description"/>
22+
<element name="toggleMetaKeyword" type="checkbox" selector="#toggle_meta_keyword"/>
23+
<element name="toggleMetaTitle" type="checkbox" selector="#toggle_meta_title"/>
24+
<element name="toggleName" type="checkbox" selector="#toggle_name"/>
25+
<element name="toggleNewsFromDate" type="checkbox" selector="#toggle_news_from_date"/>
26+
<element name="toggleNewsToDate" type="checkbox" selector="#toggle_news_to_date"/>
27+
<element name="toggleOptionsContainer" type="checkbox" selector="#toggle_options_container"/>
28+
<element name="togglePageLayout" type="checkbox" selector="#toggle_page_layout"/>
29+
<element name="togglePrice" type="checkbox" selector="#toggle_price"/>
30+
<element name="toggleShortDescription" type="checkbox" selector="#toggle_short_description"/>
31+
<element name="toggleSpecialFromDate" type="checkbox" selector="#toggle_special_from_date"/>
32+
<element name="toggleSpecialPrice" type="checkbox" selector="#toggle_special_price"/>
33+
<element name="toggleSpecialToDate" type="checkbox" selector="#toggle_special_to_date"/>
34+
<element name="toggleTaxClass" type="checkbox" selector="#toggle_tax_class_id"/>
35+
<element name="toggleVisibility" type="checkbox" selector="#toggle_visibility"/>
36+
<element name="toggleWeight" type="checkbox" selector="#toggle_weight"/>
37+
<element name="toggleColor" type="checkbox" selector="#toggle_color"/>
38+
39+
<element name="description" type="input" selector="#description"/>
40+
</section>
41+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryMainSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategoryMainSection">
12+
<element name="modeListButton" type="button" selector="#mode-list"/>
1213
<element name="CategoryTitle" type="text" selector="#page-title-heading span"/>
1314
<element name="ProductItemInfo" type="button" selector=".product-item-info"/>
1415
<element name="specifiedProductItemInfo" type="button" selector="//a[@class='product-item-link'][contains(text(), '{{var1}}')]" parameterized="true"/>
@@ -18,5 +19,9 @@
1819
<element name="CatalogDescription" type="text" selector="//div[@class='category-description']//p"/>
1920
<element name="mediaDescription" type="text" selector="img[alt='{{var1}}']" parameterized="true"/>
2021
<element name="imageSource" type="text" selector="//img[contains(@src,'{{var1}}')]" parameterized="true"/>
22+
<element name="productImage" type="text" selector="img.product-image-photo"/>
23+
<element name="productLink" type="text" selector="a.product-item-link"/>
24+
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
25+
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
2126
</section>
2227
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/ActionGroup/AdminConfigurableProductActionGroup.xml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,72 @@
3535

3636
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
3737
</actionGroup>
38+
39+
<!--
40+
41+
Create a configurable product with three options for color: red, white, and blue
42+
43+
Expected start state = logged in as an admin
44+
End state = on the product edit page in the admin
45+
46+
-->
47+
<actionGroup name="createConfigurableProduct">
48+
<arguments>
49+
<argument name="product" defaultValue="_defaultProduct"/>
50+
<argument name="category" defaultValue="_defaultCategory"/>
51+
</arguments>
52+
53+
<!-- fill in basic configurable product values -->
54+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
55+
<waitForPageLoad time="30" stepKey="wait1"/>
56+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/>
57+
<click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/>
58+
<fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
59+
<fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
60+
<fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
61+
<fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
62+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/>
63+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
64+
<fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
65+
66+
<!-- create configurations for colors the product is available in -->
67+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
68+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/>
69+
<waitForPageLoad stepKey="waitForIFrame"/>
70+
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
71+
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/>
72+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/>
73+
<waitForPageLoad stepKey="waitForSaveAttribute"/>
74+
<switchToIFrame stepKey="switchOutOfIFrame"/>
75+
<waitForPageLoad stepKey="waitForFilters"/>
76+
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
77+
<fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/>
78+
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>
79+
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/>
80+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/>
81+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/>
82+
<fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/>
83+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/>
84+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/>
85+
<fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/>
86+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/>
87+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/>
88+
<fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/>
89+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/>
90+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/>
91+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/>
92+
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/>
93+
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/>
94+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/>
95+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/>
96+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/>
97+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
98+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/>
99+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
100+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
101+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
102+
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
103+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
104+
<seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/>
105+
</actionGroup>
38106
</actionGroups>
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
12+
13+
<test name="AdminConfigurableProductCreateTest">
14+
<annotations>
15+
<features value="ConfigurableProduct"/>
16+
<stories value="Create, Read, Update, Delete"/>
17+
<title value="admin should be able to create a configurable product with attributes"/>
18+
<description value="admin should be able to create a configurable product with attributes"/>
19+
<severity value="CRITICAL"/>
20+
<testCaseId value="MAGETWO-89941"/>
21+
<group value="configurable"/>
22+
<group value="product"/>
23+
</annotations>
24+
25+
<before>
26+
<createData entity="ApiCategory" stepKey="createCategory"/>
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
28+
</before>
29+
30+
<after>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
33+
</after>
34+
35+
<!-- Create a configurable product via the UI -->
36+
<actionGroup ref="createConfigurableProduct" stepKey="createProduct">
37+
<argument name="product" value="_defaultProduct"/>
38+
<argument name="category" value="$$createCategory$$"/>
39+
</actionGroup>
40+
41+
<!-- assert color configurations on the admin create product page -->
42+
<seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/>
43+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/>
44+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/>
45+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeName3InField"/>
46+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeSku1InField"/>
47+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeSku2InField"/>
48+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeSku3InField"/>
49+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute1.price}}" stepKey="seeUniquePrice1InField"/>
50+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute2.price}}" stepKey="seeUniquePrice2InField"/>
51+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute3.price}}" stepKey="seeUniquePrice3InField"/>
52+
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsQuantityCells}}" userInput="{{colorProductAttribute.attribute_quantity}}" stepKey="seeQuantityInField"/>
53+
54+
<!-- assert storefront category list page -->
55+
<amOnPage url="/" stepKey="amOnStorefront"/>
56+
<waitForPageLoad stepKey="waitForPageLoad3"/>
57+
<click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/>
58+
<waitForPageLoad stepKey="waitForPageLoad4"/>
59+
<see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/>
60+
<see userInput="{{colorProductAttribute1.price}}" stepKey="assertProductPricePresent"/>
61+
62+
<!-- assert storefront product details page -->
63+
<click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/>
64+
<waitForPageLoad stepKey="waitForPageLoad5"/>
65+
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/>
66+
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
67+
<see userInput="{{colorProductAttribute1.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
68+
<see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
69+
<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/>
70+
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>
71+
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/>
72+
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/>
73+
</test>
74+
75+
76+
</tests>

0 commit comments

Comments
 (0)