Skip to content

Commit 8023476

Browse files
committed
MAGETWO-95752: Unable to create Configurations for Configurable Products
1 parent 63dd220 commit 8023476

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,29 @@
6565
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="clickConfirm"/>
6666
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="assertSuccess"/>
6767
</actionGroup>
68+
69+
<actionGroup name="AdminGenerateConfigurations">
70+
<arguments>
71+
<argument name="attributeCode" type="string"/>
72+
<argument name="qty" type="string"/>
73+
<argument name="price" type="string"/>
74+
</arguments>
75+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/>
76+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/>
77+
<fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilterInput}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/>
78+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
79+
<click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/>
80+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep"/>
81+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanelSection.selectAllByAttribute(attributeCode)}}" stepKey="waitForNextPageOpened"/>
82+
<click selector="{{AdminCreateProductConfigurationsPanelSection.selectAllByAttribute(productAttributeWithDropdownTwoOptions.attribute_code)}}" stepKey="clickSelectAll"/>
83+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/>
84+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="waitForNextPageOpened1"/>
85+
<click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSkus"/>
86+
<fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" stepKey="enterAttributePrice"/>
87+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
88+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="{{qty}}" stepKey="enterAttributeQuantity"/>
89+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/>
90+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextPageOpened2"/>
91+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/>
92+
</actionGroup>
6893
</actionGroups>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<element name="removeProductBtn" type="button" selector="//a[text()='Remove Product']"/>
2323
<element name="disableProductBtn" type="button" selector="//a[text()='Disable Product']"/>
2424
<element name="enableProductBtn" type="button" selector="//a[text()='Enable Product']"/>
25-
<element name="confProductSku" type="input" selector="//*[@name='configurable-matrix[{{arg}}][sku]']" parameterized="true"/>
26-
<element name="confProductSkuMessage" type="text" selector="//*[@name='configurable-matrix[{{arg}}][sku]']/following-sibling::label" parameterized="true"/>
25+
<element name="configurableMatrixSku" type="input" selector="input[name='configurable-matrix[{{index}}][sku]']" parameterized="true"/>
26+
<element name="skuValidationMessage" type="text" selector="input[name='configurable-matrix[{{index}}][sku]'] + label" parameterized="true"/>
2727
</section>
2828
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@
5252

5353
<!-- Find the product that we just created using the product grid -->
5454
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
55-
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilter" />
5655
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
5756
<argument name="product" value="ApiConfigurableProduct"/>
5857
</actionGroup>
59-
<waitForPageLoad stepKey="waitForProductFilterLoad"/>
6058
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/>
6159
<waitForPageLoad stepKey="waitForProductPageLoad"/>
6260

63-
<!-- Create configurations based off the Text Swatch we created earlier -->
61+
<!-- Create configurations for product we created earlier -->
6462
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
6563

6664
<!--Create new attribute-->
@@ -81,24 +79,12 @@
8179
<waitForPageLoad stepKey="waitForSaveAttribute"/>
8280
<switchToIFrame stepKey="switchOutOfIFrame"/>
8381

84-
<!--Find attribute in grid and select-->
85-
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/>
86-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/>
87-
<fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilterInput}}" userInput="{{productAttributeWithDropdownTwoOptions.attribute_code}}" stepKey="fillFilterAttributeCodeField"/>
88-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
89-
<click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/>
90-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep"/>
91-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanelSection.selectAllByAttribute(productAttributeWithDropdownTwoOptions.attribute_code)}}" stepKey="waitForNextPageOpened"/>
92-
<click selector="{{AdminCreateProductConfigurationsPanelSection.selectAllByAttribute(productAttributeWithDropdownTwoOptions.attribute_code)}}" stepKey="clickSelectAll"/>
93-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/>
94-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="waitForNextPageOpened1"/>
95-
<click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSkus"/>
96-
<fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="enterAttributePrice"/>
97-
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
98-
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/>
99-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/>
100-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextPageOpened2"/>
101-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/>
82+
<!-- Generate products -->
83+
<actionGroup ref="AdminGenerateConfigurations" stepKey="generateProducts">
84+
<argument name="attributeCode" value="{{productAttributeWithDropdownTwoOptions.attribute_code}}"/>
85+
<argument name="qty" value="100"/>
86+
<argument name="price" value="10"/>
87+
</actionGroup>
10288
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveButtonVisible"/>
10389
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
10490
<waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitForPopUpVisible"/>
@@ -111,10 +97,10 @@
11197

11298
<!--See that validation message is shown under the fields-->
11399
<scrollTo selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" stepKey="scrollTConfigurationTab"/>
114-
<see userInput="Please enter less or equal than 64 symbols." selector="{{AdminProductFormConfigurationsSection.confProductSkuMessage('0')}}" stepKey="seeValidationMessage"/>
100+
<see userInput="Please enter less or equal than 64 symbols." selector="{{AdminProductFormConfigurationsSection.skuValidationMessage('0')}}" stepKey="seeValidationMessage"/>
115101

116102
<!--Edit "SKU" with valid quantity-->
117-
<fillField selector="{{AdminProductFormConfigurationsSection.confProductSku('0')}}" userInput="{{ApiConfigurableProduct.sku}}-thisIsShortName" stepKey="fillValidValue"/>
103+
<fillField selector="{{AdminProductFormConfigurationsSection.configurableMatrixSku('0')}}" userInput="{{ApiConfigurableProduct.sku}}-thisIsShortName" stepKey="fillValidValue"/>
118104

119105
<!--Click on "Save"-->
120106
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/>
@@ -123,6 +109,6 @@
123109
<!--Click on "Confirm". Product is saved, success message appears -->
124110
<waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/>
125111
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/>
126-
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/>
112+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/>
127113
</test>
128114
</tests>

0 commit comments

Comments
 (0)