Skip to content

Commit fbabf2c

Browse files
MAGETWO-91524: "element.disabled is not a function"error is thrown when configurable products are generated with an attribute named "design"
- Update automated test according to review
1 parent 641caa3 commit fbabf2c

File tree

4 files changed

+104
-81
lines changed

4 files changed

+104
-81
lines changed

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

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313

1414
<!--Click on Catalog item-->
1515
<click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/>
16-
17-
<waitForPageLoad stepKey="waitForCatalogLoad" time="3"/>
16+
<waitForPageLoad stepKey="waitForCatalogLoad"/>
1817

1918
<!--Click on Products item-->
2019
<click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/>
21-
22-
<waitForPageLoad stepKey="waitForCatalogProductPageLoad" time="3"/>
20+
<waitForPageLoad stepKey="waitForCatalogProductPageLoad"/>
2321

2422
<!--Assert we have gone desired page successfully-->
2523
<seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/>
@@ -33,8 +31,7 @@
3331

3432
<!--Click on Configuration Product item-->
3533
<click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/>
36-
37-
<waitForPageLoad stepKey="waitForConfigurableProductPageLoad" time="3"/>
34+
<waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/>
3835

3936
<!--Assert we have gone desired page successfully-->
4037
<seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/>
@@ -54,17 +51,16 @@
5451

5552
<!--Click "Create Configurations" button in configurations field-->
5653
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
57-
58-
<wait stepKey="waitForCreateProductConfigurationsPageLoad" time="3"/>
54+
<waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/>
5955

6056
<!--Click "Create New Attribute" button-->
6157
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
62-
63-
<wait stepKey="waitForNewAttributePageLoad" time="3"/>
58+
<waitForPageLoad stepKey="waitForNewAttributePageLoad"/>
6459

6560
</actionGroup>
6661

67-
<actionGroup name="FillNewAttributeFields">
62+
63+
<actionGroup name="CreateNewAttribute">
6864

6965
<switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/>
7066

@@ -73,100 +69,116 @@
7369

7470
<!--Add option 1 to attribute-->
7571
<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}}"/>
72+
<fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/>
73+
<fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/>
7874

7975
<!--Add option 2 to attribute-->
8076
<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}}"/>
77+
<fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/>
78+
<fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/>
8379

8480
<!--Add option 3 to attribute-->
8581
<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}}"/>
82+
<fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/>
83+
<fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/>
8884

8985
<!--Add option 4 to attribute-->
9086
<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}}"/>
87+
<fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/>
88+
<fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/>
9389

9490
<!--Add option 5 to attribute-->
9591
<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}}"/>
92+
<fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/>
93+
<fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/>
9894

9995
<!--Click Save Attribute button-->
10096
<click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/>
101-
102-
<wait stepKey="waitForSavingSettings" time="3"/>
97+
<waitForPageLoad stepKey="waitForSavingSettings"/>
10398

10499
<!--Select created Attribute -->
105100
<click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/>
106101

107102
<!--Click Next button-->
108103
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/>
109-
110-
<wait stepKey="waitForNextPageLoaded" time="3"/>
104+
<waitForPageLoad stepKey="waitForNextPageLoaded"/>
111105

112106
<!--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"/>
107+
<click selector="{{CreateProductConfigurations.checkboxRed}}" stepKey="selectCheckboxRed"/>
108+
<click selector="{{CreateProductConfigurations.checkboxBlue}}" stepKey="selectCheckboxBlue"/>
109+
<click selector="{{CreateProductConfigurations.checkboxYellow}}" stepKey="selectCheckboxYellow"/>
110+
<click selector="{{CreateProductConfigurations.checkboxGreen}}" stepKey="selectCheckboxGreen"/>
111+
<click selector="{{CreateProductConfigurations.checkboxBlack}}" stepKey="selectCheckboxBlack"/>
118112

119113
<!--Click Next button-->
120114
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/>
121-
122-
<wait stepKey="waitForBulkImagesPricePageLoaded" time="3"/>
115+
<waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/>
123116

124117
<!--Click Next button-->
125118
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/>
126-
127-
<wait stepKey="waitForSummaryPageLoaded" time="3"/>
119+
<waitForPageLoad stepKey="waitForSummaryPageLoaded"/>
128120

129121
<!--Click Generate Configure button-->
130122
<click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/>
131-
132-
<wait stepKey="waitForGenerateConfigure" time="3"/>
123+
<waitForPageLoad stepKey="waitForGenerateConfigure"/>
133124

134125
<!-- This Error message shouldn't appear: Test will pass when bug will be fixed-->
135126
<dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/>
136127

137128
<!--Close frame-->
138129
<conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/>
130+
<waitForPageLoad stepKey="waitForClosingFrame"/>
139131

140-
<wait stepKey="waitForClosingFrame" time="3"/>
132+
</actionGroup>
133+
134+
<actionGroup name="DeleteCreatedAttribute">
135+
136+
<!--Click on Stores item-->
137+
<click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/>
138+
139+
<!--Click on Products item-->
140+
<waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/>
141+
<click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/>
142+
<waitForPageLoad stepKey="waitForStoresProductPageLoad"/>
143+
144+
<!--Click on created Attribute -->
145+
<fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/>
146+
<click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/>
147+
<waitForPageLoad stepKey="waitForCreatedAttributeLoad"/>
148+
<click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/>
149+
<waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/>
150+
151+
<!--Click on Delete Attribute item-->
152+
<click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/>
153+
<waitForPageLoad stepKey="waitForDeletedDialogOpened"/>
154+
155+
<!--Click on OK button-->
156+
<click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/>
157+
<waitForPageLoad stepKey="waitFordAttributeDeleted"/>
141158

142159
</actionGroup>
143160

144161
<actionGroup name="DeleteCreatedAttributeIfExist">
145162

146163
<!--Click on Stores item-->
147164
<click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/>
148-
149-
<waitForPageLoad stepKey="waitForCatalogLoad" time="3"/>
165+
<waitForPageLoad stepKey="waitForCatalogLoad"/>
150166

151167
<!--Click on Products item-->
152168
<click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/>
153-
154-
<waitForPageLoad stepKey="waitForStoresProductPageLoad" time="3"/>
169+
<waitForPageLoad stepKey="waitForStoresProductPageLoad"/>
155170

156171
<!--Click on created Attribute item if it exist-->
157172
<conditionalClick selector="{{CatalogProductsSection.createdAttributeItem}}" dependentSelector="{{CatalogProductsSection.createdAttributeItem}}" visible="1" stepKey="clickOnCreatedAttributeItem"/>
158-
159-
<waitForPageLoad stepKey="waitForCreatedAttributeLoad" time="3"/>
173+
<waitForPageLoad stepKey="waitForCreatedAttributeLoad"/>
160174

161175
<!--Click on Delete Attribute item-->
162176
<conditionalClick stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}" dependentSelector="{{CatalogProductsSection.deleteAttributeItem}}" visible="1"/>
163-
164-
<waitForPageLoad stepKey="waitForDeletedDialogOpened" time="3"/>
177+
<waitForPageLoad stepKey="waitForDeletedDialogOpened"/>
165178

166179
<!--Click on OK button-->
167180
<conditionalClick stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}" dependentSelector="{{CatalogProductsSection.okButton}}" visible="1"/>
168-
169-
<waitForPageLoad stepKey="waitFordAttributeDeleted" time="3"/>
181+
<waitForPageLoad stepKey="waitFordAttributeDeleted"/>
170182

171183
</actionGroup>
172184

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductAttributeNameDesignData.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="NewProductsData" type="user">
12-
<data key="productName">Shoes</data>
12+
<data key="productName" unique="prefix">Shoes</data>
1313
<data key="price">60</data>
1414
<data key="weight">100</data>
1515
<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>
16+
<data key="adminFieldRed">red</data>
17+
<data key="defaultStoreViewFieldRed">red123</data>
18+
<data key="adminFieldBlue">blue</data>
19+
<data key="defaultStoreViewFieldBlue">blue123</data>
20+
<data key="adminFieldYellow">yellow</data>
21+
<data key="defaultStoreViewFieldYellow">yellow123</data>
22+
<data key="adminFieldGreen">green</data>
23+
<data key="defaultStoreViewFieldGreen">green123</data>
24+
<data key="adminFieldBlack">black</data>
25+
<data key="defaultStoreViewFieldBlack">black123</data>
2626
<data key="attributeCodeField">bug91524</data>
2727
</entity>
2828

0 commit comments

Comments
 (0)