Skip to content

Commit 641caa3

Browse files
MAGETWO-91524: 'element.disabled is not a function'error is thrown when configurable products are generated with an attribute named 'design'
- Add automated test for the bug MAGETWO-93307
1 parent 58394be commit 641caa3

File tree

4 files changed

+308
-0
lines changed

4 files changed

+308
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
12+
<actionGroup name="GotoCatalogProductsPage">
13+
14+
<!--Click on Catalog item-->
15+
<click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/>
16+
17+
<waitForPageLoad stepKey="waitForCatalogLoad" time="3"/>
18+
19+
<!--Click on Products item-->
20+
<click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/>
21+
22+
<waitForPageLoad stepKey="waitForCatalogProductPageLoad" time="3"/>
23+
24+
<!--Assert we have gone desired page successfully-->
25+
<seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/>
26+
27+
</actionGroup>
28+
29+
<actionGroup name="GotoConfigurableProductPage">
30+
31+
<!--Click on Add product item-->
32+
<click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/>
33+
34+
<!--Click on Configuration Product item-->
35+
<click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/>
36+
37+
<waitForPageLoad stepKey="waitForConfigurableProductPageLoad" time="3"/>
38+
39+
<!--Assert we have gone desired page successfully-->
40+
<seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/>
41+
42+
</actionGroup>
43+
44+
<actionGroup name="FillAllRequiredFields">
45+
46+
<!--Fill In Product Name Fields-->
47+
<fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/>
48+
49+
<!--Fill In Price Fields-->
50+
<fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/>
51+
52+
<!--Fill In Weight Fields-->
53+
<fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/>
54+
55+
<!--Click "Create Configurations" button in configurations field-->
56+
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
57+
58+
<wait stepKey="waitForCreateProductConfigurationsPageLoad" time="3"/>
59+
60+
<!--Click "Create New Attribute" button-->
61+
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
62+
63+
<wait stepKey="waitForNewAttributePageLoad" time="3"/>
64+
65+
</actionGroup>
66+
67+
<actionGroup name="FillNewAttributeFields">
68+
69+
<switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/>
70+
71+
<!--Fill In Product Name Fields-->
72+
<fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/>
73+
74+
<!--Add option 1 to attribute-->
75+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/>
76+
<fillField stepKey="fillInAdminField1" selector="{{NewProduct.adminField1}}" userInput="{{NewProductsData.adminField1}}"/>
77+
<fillField stepKey="fillInDefaultStoreViewField1" selector="{{NewProduct.defaultStoreViewField1}}" userInput="{{NewProductsData.defaultStoreViewField1}}"/>
78+
79+
<!--Add option 2 to attribute-->
80+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/>
81+
<fillField stepKey="fillInAdminField2" selector="{{NewProduct.adminField2}}" userInput="{{NewProductsData.adminField2}}"/>
82+
<fillField stepKey="fillInDefaultStoreViewField2" selector="{{NewProduct.defaultStoreViewField2}}" userInput="{{NewProductsData.defaultStoreViewField2}}"/>
83+
84+
<!--Add option 3 to attribute-->
85+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/>
86+
<fillField stepKey="fillInAdminField3" selector="{{NewProduct.adminField3}}" userInput="{{NewProductsData.adminField3}}"/>
87+
<fillField stepKey="fillInDefaultStoreViewField3" selector="{{NewProduct.defaultStoreViewField3}}" userInput="{{NewProductsData.defaultStoreViewField3}}"/>
88+
89+
<!--Add option 4 to attribute-->
90+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/>
91+
<fillField stepKey="fillInAdminField4" selector="{{NewProduct.adminField4}}" userInput="{{NewProductsData.adminField4}}"/>
92+
<fillField stepKey="fillInDefaultStoreViewField4" selector="{{NewProduct.defaultStoreViewField4}}" userInput="{{NewProductsData.defaultStoreViewField4}}"/>
93+
94+
<!--Add option 5 to attribute-->
95+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/>
96+
<fillField stepKey="fillInAdminField5" selector="{{NewProduct.adminField5}}" userInput="{{NewProductsData.adminField5}}"/>
97+
<fillField stepKey="fillInDefaultStoreViewField5" selector="{{NewProduct.defaultStoreViewField5}}" userInput="{{NewProductsData.defaultStoreViewField5}}"/>
98+
99+
<!--Click Save Attribute button-->
100+
<click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/>
101+
102+
<wait stepKey="waitForSavingSettings" time="3"/>
103+
104+
<!--Select created Attribute -->
105+
<click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/>
106+
107+
<!--Click Next button-->
108+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/>
109+
110+
<wait stepKey="waitForNextPageLoaded" time="3"/>
111+
112+
<!--Select all the options of all the attributes button-->
113+
<click selector="{{CreateProductConfigurations.item1}}" stepKey="selectItem1"/>
114+
<click selector="{{CreateProductConfigurations.item2}}" stepKey="selectItem2"/>
115+
<click selector="{{CreateProductConfigurations.item3}}" stepKey="selectItem3"/>
116+
<click selector="{{CreateProductConfigurations.item4}}" stepKey="selectItem4"/>
117+
<click selector="{{CreateProductConfigurations.item5}}" stepKey="selectItem5"/>
118+
119+
<!--Click Next button-->
120+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/>
121+
122+
<wait stepKey="waitForBulkImagesPricePageLoaded" time="3"/>
123+
124+
<!--Click Next button-->
125+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/>
126+
127+
<wait stepKey="waitForSummaryPageLoaded" time="3"/>
128+
129+
<!--Click Generate Configure button-->
130+
<click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/>
131+
132+
<wait stepKey="waitForGenerateConfigure" time="3"/>
133+
134+
<!-- This Error message shouldn't appear: Test will pass when bug will be fixed-->
135+
<dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/>
136+
137+
<!--Close frame-->
138+
<conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/>
139+
140+
<wait stepKey="waitForClosingFrame" time="3"/>
141+
142+
</actionGroup>
143+
144+
<actionGroup name="DeleteCreatedAttributeIfExist">
145+
146+
<!--Click on Stores item-->
147+
<click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/>
148+
149+
<waitForPageLoad stepKey="waitForCatalogLoad" time="3"/>
150+
151+
<!--Click on Products item-->
152+
<click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/>
153+
154+
<waitForPageLoad stepKey="waitForStoresProductPageLoad" time="3"/>
155+
156+
<!--Click on created Attribute item if it exist-->
157+
<conditionalClick selector="{{CatalogProductsSection.createdAttributeItem}}" dependentSelector="{{CatalogProductsSection.createdAttributeItem}}" visible="1" stepKey="clickOnCreatedAttributeItem"/>
158+
159+
<waitForPageLoad stepKey="waitForCreatedAttributeLoad" time="3"/>
160+
161+
<!--Click on Delete Attribute item-->
162+
<conditionalClick stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}" dependentSelector="{{CatalogProductsSection.deleteAttributeItem}}" visible="1"/>
163+
164+
<waitForPageLoad stepKey="waitForDeletedDialogOpened" time="3"/>
165+
166+
<!--Click on OK button-->
167+
<conditionalClick stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}" dependentSelector="{{CatalogProductsSection.okButton}}" visible="1"/>
168+
169+
<waitForPageLoad stepKey="waitFordAttributeDeleted" time="3"/>
170+
171+
</actionGroup>
172+
173+
</actionGroups>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="NewProductsData" type="user">
12+
<data key="productName">Shoes</data>
13+
<data key="price">60</data>
14+
<data key="weight">100</data>
15+
<data key="defaultLabel">design</data>
16+
<data key="adminField1">red</data>
17+
<data key="defaultStoreViewField1">red123</data>
18+
<data key="adminField2">blue</data>
19+
<data key="defaultStoreViewField2">blue123</data>
20+
<data key="adminField3">yellow</data>
21+
<data key="defaultStoreViewField3">yellow123</data>
22+
<data key="adminField4">green</data>
23+
<data key="defaultStoreViewField4">green123</data>
24+
<data key="adminField5">black</data>
25+
<data key="defaultStoreViewField5">black123</data>
26+
<data key="attributeCodeField">bug91524</data>
27+
</entity>
28+
29+
<entity name="assertionData" type="assertion">
30+
<data key="catalogProduct">product</data>
31+
<data key="configurableProduct">configurable</data>
32+
<data key="errorMessage">element.disabled is not a function</data>
33+
</entity>
34+
35+
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="CatalogProductsSection">
12+
<element name="catalogItem" type="button" selector="//*[@id='menu-magento-catalog-catalog']/a/span"/>
13+
<element name="productItem" type="button" selector="//*[@data-ui-id='menu-magento-catalog-catalog-products']/a"/>
14+
<element name="storesItem" type="button" selector="//*[@id='menu-magento-backend-stores']/a/span"/>
15+
<element name="storesProductItem" type="button" selector="//*[@data-ui-id='menu-magento-catalog-catalog-attributes-attributes']/a"/>
16+
<element name="createdAttributeItem" type="button" selector="//td[contains(@class, 'col-attr-code') and normalize-space()='design']"/>
17+
<element name="deleteAttributeItem" type="button" selector="//*[@id='delete']"/>
18+
<element name="okButton" type="button" selector=" //footer[@class='modal-footer']//*[contains(text(),'OK')]"/>
19+
20+
<element name="messageSuccessSavedProduct" type="button" selector=" //div[@data-ui-id='messages-message-success']"/>
21+
</section>
22+
23+
<section name="ConfigurableProductSection">
24+
<element name="addProductItem" type="button" selector="//*[@id='add_new_product']/button[2]"/>
25+
<element name="configProductItem" type="button" selector="//*[@id='add_new_product']//*[contains(text(),'Configurable Product')]"/>
26+
<element name="nextButton" type="button" selector="//div[@class='nav-bar-outer-actions']//*[contains(text(),'Next')]"/>
27+
<element name="generateConfigure" type="button" selector="//div[@class='nav-bar-outer-actions']//*[contains(text(),'Generate Products')]"/>
28+
<element name="selectCreatedAttribute" type="button" selector="//*[@class='admin__data-grid-wrap']//td[normalize-space()='design']/preceding-sibling::td"/>
29+
<element name="closeFrame" type="button" selector="//*[@class='modal-header']//*[contains(text(),'Create Product Configurations')]/following-sibling::button"/>
30+
</section>
31+
32+
<section name="NewProduct">
33+
<element name="productName" type="input" selector="//input[@name='product[name]']"/>
34+
<element name="price" type="input" selector="//input[@name='product[price]']"/>
35+
<element name="weight" type="input" selector="//input[@name='product[weight]']"/>
36+
<element name="createConfigurationButton" type="button" selector="//*[contains(text(),'Create Configurations')]"/>
37+
<element name="createNewAttributeButton" type="button" selector="//*[contains(text(),'Create New Attribute')]"/>
38+
<element name="newAttributeIFrame" type="iframe" selector="create_new_attribute_container"/>
39+
<element name="defaultLabel" type="input" selector="//*[@id='attribute_label']"/>
40+
<element name="addOptionButton" type="button" selector="//*[@id='add_new_option_button']"/>
41+
<element name="adminField1" type="input" selector="//input[@name='option[value][option_0][0]']"/>
42+
<element name="defaultStoreViewField1" type="input" selector="//input[@name='option[value][option_0][1]']"/>
43+
<element name="adminField2" type="input" selector="//input[@name='option[value][option_1][0]']"/>
44+
<element name="defaultStoreViewField2" type="input" selector="//input[@name='option[value][option_1][1]']"/>
45+
<element name="adminField3" type="input" selector="//input[@name='option[value][option_2][0]']"/>
46+
<element name="defaultStoreViewField3" type="input" selector="//input[@name='option[value][option_2][1]']"/>
47+
<element name="adminField4" type="input" selector="//input[@name='option[value][option_3][0]']"/>
48+
<element name="defaultStoreViewField4" type="input" selector="//input[@name='option[value][option_3][1]']"/>
49+
<element name="adminField5" type="input" selector="//input[@name='option[value][option_4][0]']"/>
50+
<element name="defaultStoreViewField5" type="input" selector="//input[@name='option[value][option_4][1]']"/>
51+
<element name="saveAttributeButton" type="button" selector="//*[@id='save']"/>
52+
<element name="advancedAttributeProperties" type="button" selector="//*[@id='advanced_fieldset-wrapper']//*[contains(text(),'Advanced Attribute Properties')]"/>
53+
<element name="attributeCodeField" type="input" selector="//*[@id='attribute_code']"/>
54+
55+
</section>
56+
57+
<section name="CreateProductConfigurations">
58+
<element name="item1" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'red')]/preceding-sibling::input"/>
59+
<element name="item2" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'blue')]/preceding-sibling::input"/>
60+
<element name="item3" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'yellow')]/preceding-sibling::input"/>
61+
<element name="item4" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'green')]/preceding-sibling::input"/>
62+
<element name="item5" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'black')]/preceding-sibling::input"/>
63+
<element name="errorMessage" type="input" selector="//div[@data-ui-id='messages-message-error']"/>
64+
</section>
65+
66+
</sections>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="ConfigurableProductAttributeNameDesignTest">
12+
<annotations>
13+
<title value="Generation of configurable products with an attribute named 'design'"/>
14+
<features value="Product Customizable Option"/>
15+
<severity value="AVERAGE"/>
16+
<testCaseId value="MAGETWO-93307"/>
17+
<stories value="MAGETWO-91524 : 'element.disabled is not a function' error is thrown when configurable products are generated with an attribute named 'design'"/>
18+
<group value="product"/>
19+
</annotations>
20+
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
22+
23+
<actionGroup ref="DeleteCreatedAttributeIfExist" stepKey="deleteCreatedAttributeIfExist"/>
24+
25+
<actionGroup ref="GotoCatalogProductsPage" stepKey="goToCatalogProductsPage"/>
26+
27+
<actionGroup ref="GotoConfigurableProductPage" stepKey="goToConfigurableProductPage"/>
28+
29+
<actionGroup ref="FillAllRequiredFields" stepKey="fillInAllRequiredFields"/>
30+
31+
<actionGroup ref="FillNewAttributeFields" stepKey="fillInNewAttributeFields"/>
32+
33+
</test>
34+
</tests>

0 commit comments

Comments
 (0)