Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 96b4710

Browse files
Merge pull request #38 from magento-epam/SPRINT-1-MAGETWO-91524
Sprint 1 magetwo 91524
2 parents e5f3a62 + f57f4b8 commit 96b4710

File tree

5 files changed

+312
-2
lines changed

5 files changed

+312
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
<waitForPageLoad stepKey="waitForCatalogLoad"/>
17+
18+
<!--Click on Products item-->
19+
<click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/>
20+
<waitForPageLoad stepKey="waitForCatalogProductPageLoad"/>
21+
22+
<!--Assert we have gone desired page successfully-->
23+
<seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/>
24+
25+
</actionGroup>
26+
27+
<actionGroup name="GotoConfigurableProductPage">
28+
29+
<!--Click on Add product item-->
30+
<click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/>
31+
32+
<!--Click on Configuration Product item-->
33+
<click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/>
34+
<waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/>
35+
36+
<!--Assert we have gone desired page successfully-->
37+
<seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/>
38+
39+
</actionGroup>
40+
41+
<actionGroup name="FillAllRequiredFields">
42+
43+
<!--Fill In Product Name Fields-->
44+
<fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/>
45+
46+
<!--Fill In Price Fields-->
47+
<fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/>
48+
49+
<!--Fill In Weight Fields-->
50+
<fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/>
51+
52+
<!--Click "Create Configurations" button in configurations field-->
53+
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
54+
<waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/>
55+
56+
<!--Click "Create New Attribute" button-->
57+
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
58+
<waitForPageLoad stepKey="waitForNewAttributePageLoad"/>
59+
60+
</actionGroup>
61+
62+
63+
<actionGroup name="CreateNewAttribute">
64+
65+
<switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/>
66+
67+
<!--Fill In Product Name Fields-->
68+
<fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/>
69+
70+
<!--Add option 1 to attribute-->
71+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/>
72+
<fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/>
73+
<fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/>
74+
75+
<!--Add option 2 to attribute-->
76+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/>
77+
<fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/>
78+
<fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/>
79+
80+
<!--Add option 3 to attribute-->
81+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/>
82+
<fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/>
83+
<fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/>
84+
85+
<!--Add option 4 to attribute-->
86+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/>
87+
<fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/>
88+
<fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/>
89+
90+
<!--Add option 5 to attribute-->
91+
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/>
92+
<fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/>
93+
<fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/>
94+
95+
<!--Click Save Attribute button-->
96+
<click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/>
97+
<waitForPageLoad stepKey="waitForSavingSettings"/>
98+
99+
<!--Select created Attribute -->
100+
<click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/>
101+
102+
<!--Click Next button-->
103+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/>
104+
<waitForPageLoad stepKey="waitForNextPageLoaded"/>
105+
106+
<!--Select all the options of all the attributes button-->
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"/>
112+
113+
<!--Click Next button-->
114+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/>
115+
<waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/>
116+
117+
<!--Click Next button-->
118+
<click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/>
119+
<waitForPageLoad stepKey="waitForSummaryPageLoaded"/>
120+
121+
<!--Click Generate Configure button-->
122+
<click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/>
123+
<waitForPageLoad stepKey="waitForGenerateConfigure"/>
124+
125+
<!-- This Error message shouldn't appear: Test will pass when bug will be fixed-->
126+
<dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/>
127+
128+
<!--Close frame-->
129+
<conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/>
130+
<waitForPageLoad stepKey="waitForClosingFrame"/>
131+
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"/>
158+
<see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/>
159+
160+
<!-- Click Reset Filter button-->
161+
<click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/>
162+
<waitForPageLoad stepKey="waitForAllFilterReset"/>
163+
164+
</actionGroup>
165+
166+
</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" unique="prefix">Shoes</data>
13+
<data key="price">60</data>
14+
<data key="weight">100</data>
15+
<data key="defaultLabel">design</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>
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,68 @@
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="searchDefaultLabelField" type="input" selector="//*[@id='attributeGrid_filter_frontend_label']"/>
16+
<element name="searchButton" type="button" selector="//div[@class='admin__filter-actions']//*[contains(text(), 'Search')]"/>
17+
<element name="storesProductItem" type="button" selector="//*[@data-ui-id='menu-magento-catalog-catalog-attributes-attributes']/a"/>
18+
<element name="createdAttributeItem" type="button" selector="//td[contains(@class, 'col-label') and normalize-space()='design']"/>
19+
<element name="deleteAttributeItem" type="button" selector="//*[@id='delete']"/>
20+
<element name="okButton" type="button" selector="//footer[@class='modal-footer']//*[contains(text(),'OK')]"/>
21+
<element name="messageSuccessSavedProduct" type="button" selector="//div[@data-ui-id='messages-message-success']"/>
22+
<element name="resetFilter" type="button" selector="//span[contains(text(), 'Reset Filter')]"/>
23+
</section>
24+
25+
<section name="ConfigurableProductSection">
26+
<element name="addProductItem" type="button" selector="//*[@id='add_new_product']/button[2]"/>
27+
<element name="configProductItem" type="button" selector="//*[@id='add_new_product']//*[contains(text(),'Configurable Product')]"/>
28+
<element name="nextButton" type="button" selector="//div[@class='nav-bar-outer-actions']//*[contains(text(),'Next')]"/>
29+
<element name="generateConfigure" type="button" selector="//div[@class='nav-bar-outer-actions']//*[contains(text(),'Generate Products')]"/>
30+
<element name="selectCreatedAttribute" type="button" selector="//*[@class='admin__data-grid-wrap']//td[normalize-space()='design']/preceding-sibling::td"/>
31+
<element name="closeFrame" type="button" selector="//*[@class='modal-header']//*[contains(text(),'Create Product Configurations')]/following-sibling::button"/>
32+
</section>
33+
34+
<section name="NewProduct">
35+
<element name="productName" type="input" selector="//input[@name='product[name]']"/>
36+
<element name="price" type="input" selector="//input[@name='product[price]']"/>
37+
<element name="weight" type="input" selector="//input[@name='product[weight]']"/>
38+
<element name="createConfigurationButton" type="button" selector="//*[contains(text(),'Create Configurations')]"/>
39+
<element name="createNewAttributeButton" type="button" selector="//*[contains(text(),'Create New Attribute')]"/>
40+
<element name="newAttributeIFrame" type="iframe" selector="create_new_attribute_container"/>
41+
<element name="defaultLabel" type="input" selector="//*[@id='attribute_label']"/>
42+
<element name="addOptionButton" type="button" selector="//*[@id='add_new_option_button']"/>
43+
<element name="adminFieldRed" type="input" selector="//input[@name='option[value][option_0][0]']"/>
44+
<element name="defaultStoreViewFieldRed" type="input" selector="//input[@name='option[value][option_0][1]']"/>
45+
<element name="adminFieldBlue" type="input" selector="//input[@name='option[value][option_1][0]']"/>
46+
<element name="defaultStoreViewFieldBlue" type="input" selector="//input[@name='option[value][option_1][1]']"/>
47+
<element name="adminFieldYellow" type="input" selector="//input[@name='option[value][option_2][0]']"/>
48+
<element name="defaultStoreViewFieldYellow" type="input" selector="//input[@name='option[value][option_2][1]']"/>
49+
<element name="adminFieldGreen" type="input" selector="//input[@name='option[value][option_3][0]']"/>
50+
<element name="defaultStoreViewFieldGreen" type="input" selector="//input[@name='option[value][option_3][1]']"/>
51+
<element name="adminFieldBlack" type="input" selector="//input[@name='option[value][option_4][0]']"/>
52+
<element name="defaultStoreViewFieldBlack" type="input" selector="//input[@name='option[value][option_4][1]']"/>
53+
<element name="saveAttributeButton" type="button" selector="//*[@id='save']"/>
54+
<element name="advancedAttributeProperties" type="button" selector="//*[@id='advanced_fieldset-wrapper']//*[contains(text(),'Advanced Attribute Properties')]"/>
55+
<element name="attributeCodeField" type="input" selector="//*[@id='attribute_code']"/>
56+
57+
</section>
58+
59+
<section name="CreateProductConfigurations">
60+
<element name="checkboxRed" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'red')]/preceding-sibling::input"/>
61+
<element name="checkboxBlue" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'blue')]/preceding-sibling::input"/>
62+
<element name="checkboxYellow" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'yellow')]/preceding-sibling::input"/>
63+
<element name="checkboxGreen" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'green')]/preceding-sibling::input"/>
64+
<element name="checkboxBlack" type="input" selector="//fieldset[@class='admin__fieldset admin__fieldset-options']//*[contains(text(),'black')]/preceding-sibling::input"/>
65+
<element name="errorMessage" type="input" selector="//div[@data-ui-id='messages-message-error']"/>
66+
</section>
67+
68+
</sections>
Lines changed: 41 additions & 0 deletions
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+
<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+
<before>
22+
<!-- Log in to Dashboard page -->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
24+
</before>
25+
26+
27+
<!-- Navigate to Catalog-> Products -->
28+
<actionGroup ref="GotoCatalogProductsPage" stepKey="goToCatalogProductsPage"/>
29+
<!-- Fill the fields on Configurable Product-->
30+
<actionGroup ref="GotoConfigurableProductPage" stepKey="goToConfigurableProductPage"/>
31+
<actionGroup ref="FillAllRequiredFields" stepKey="fillInAllRequiredFields"/>
32+
<!-- Create New Attribute (Default Label= design) -->
33+
<actionGroup ref="CreateNewAttribute" stepKey="createNewAttribute"/>
34+
35+
<after>
36+
<!-- Delete Created Attribute -->
37+
<actionGroup ref="DeleteCreatedAttribute" stepKey="deleteCreatedAttribute"/>
38+
</after>
39+
40+
</test>
41+
</tests>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ define([
357357
var element;
358358

359359
_.each(this.disabledAttributes, function (attribute) {
360-
registry.get('index = ' + attribute).disabled(false);
360+
registry.get('inputName = ' + 'product[' + attribute + ']').disabled(false);
361361
});
362362
this.disabledAttributes = [];
363363

364364
_.each(attributes, function (attribute) {
365-
element = registry.get('index = ' + attribute.code);
365+
element = registry.get('inputName = ' + 'product[' + attribute.code + ']');
366366

367367
if (!_.isUndefined(element)) {
368368
element.disabled(true);

0 commit comments

Comments
 (0)