Skip to content

Commit 2065902

Browse files
Merge branch 'ACQE-8865' into ACQE-functional-deployment-v4-5
2 parents 7f152bc + 190c97b commit 2065902

File tree

5 files changed

+259
-0
lines changed

5 files changed

+259
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminAddAttributeOptionInIFrameActionGroup">
11+
<annotations>
12+
<description>Adds a single option to an attribute in the iframe (during attribute creation)</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="optionLabel" type="string"/>
16+
<argument name="optionIndex" type="string"/>
17+
</arguments>
18+
<click selector="{{AttributePropertiesSection.dropdownAddOptions}}" stepKey="clickAddOption"/>
19+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(optionIndex)}}"
20+
userInput="{{optionLabel}}" stepKey="fillOption"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateAttributeValueInConfigurationWizardActionGroup">
12+
<annotations>
13+
<description>Creates a new attribute value/option in the configurable product configuration wizard
14+
</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="attributeLabel" type="string"/>
18+
<argument name="optionValue" type="string"/>
19+
</arguments>
20+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValueForAttribute(attributeLabel)}}"
21+
stepKey="clickCreateNewValue"/>
22+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attributeName}}"
23+
stepKey="waitForInput"/>
24+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" userInput="{{optionValue}}"
25+
stepKey="fillValue"/>
26+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="saveValue"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,36 @@
4545
<requiredEntity type="ValueIndex">ValueIndex1</requiredEntity>
4646
<requiredEntity type="ValueIndex">ValueIndex1</requiredEntity>
4747
</entity>
48+
<!-- Color Attribute Options -->
49+
<entity name="ColorOptionBlack" type="attribute_option">
50+
<data key="label">black</data>
51+
</entity>
52+
<entity name="ColorOptionRed" type="attribute_option">
53+
<data key="label">red</data>
54+
</entity>
55+
<entity name="ColorOptionBlue" type="attribute_option">
56+
<data key="label">blue</data>
57+
</entity>
58+
<entity name="ColorOptionPink" type="attribute_option">
59+
<data key="label">pink</data>
60+
</entity>
61+
<entity name="ColorOptionWhite" type="attribute_option">
62+
<data key="label">white</data>
63+
</entity>
64+
<!-- Size Attribute Options -->
65+
<entity name="SizeOption8" type="attribute_option">
66+
<data key="label">8</data>
67+
</entity>
68+
<entity name="SizeOption10" type="attribute_option">
69+
<data key="label">10</data>
70+
</entity>
71+
<entity name="SizeOption12" type="attribute_option">
72+
<data key="label">12</data>
73+
</entity>
74+
<entity name="SizeOption14" type="attribute_option">
75+
<data key="label">14</data>
76+
</entity>
77+
<entity name="SizeOption16" type="attribute_option">
78+
<data key="label">16</data>
79+
</entity>
4880
</entities>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
<element name="defaultLabel" type="text" selector="//div[contains(text(), '{{arg}}')]/ancestor::tr//td[3]/div[@class='data-grid-cell-content']" parameterized="true"/>
2424

2525
<element name="selectAll" type="button" selector=".action-select-all"/>
26+
<element name="deSelectAllByAttribute" type="button" selector="//div[@data-attribute-title='{{attr}}']//button[contains(@class, 'action-deselect-all')]" parameterized="true"/>
2627
<element name="selectAllByAttribute" type="button" selector="//div[@data-attribute-title='{{attr}}']//button[contains(@class, 'action-select-all')]" parameterized="true"/>
2728
<element name="createNewValue" type="input" selector=".action-create-new" timeout="30"/>
29+
<element name="createNewValueForAttribute" type="button"
30+
selector="//div[contains(@class,'attribute-entity') and @data-attribute-title='{{attrLabel}}']//button[contains(@class,'action-create-new')]"
31+
parameterized="true"
32+
timeout="30"/>
2833
<element name="attributeNameInTitle" type="input" selector="//div[contains(@class,'attribute-entity-title-block')]/div[contains(@class,'attribute-entity-title')]"/>
2934
<element name="attributeName" type="input" selector="li[data-attribute-option-title=''] .admin__field-create-new .admin__control-text"/>
3035
<element name="attributeNameWithError" type="text" selector="//li[@data-attribute-option-title='']/div[contains(@class,'admin__field admin__field-create-new _error')]"/>
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="AdminRemoveAttributeFromConfigurableProductTest">
10+
<annotations>
11+
<features value="ConfigurableProduct"/>
12+
<stories value="Edit configurable product"/>
13+
<title value="Admin should be able to remove an entire attribute from configurable product"/>
14+
<description value="Admin removes Color attribute from configurable product leaving only Size attribute with 2 options"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-3984"/>
17+
<group value="ConfigurableProduct"/>
18+
</annotations>
19+
<before>
20+
<!-- Step 1: Login as admin to backend -->
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
25+
<argument name="sku" value="{{BaseConfigurableProduct.sku}}"/>
26+
</actionGroup>
27+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearProductFilters"/>
28+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteSizeAttribute">
29+
<argument name="productAttributeLabel" value="{{ProductSizeAttribute.frontend_label}}"/>
30+
</actionGroup>
31+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToAttributeEditPage">
32+
<argument name="ProductAttribute" value="color"/>
33+
</actionGroup>
34+
<click selector="{{AdminNewAttributePanel.deleteOptionByName(ColorOptionBlack.label)}}" stepKey="removeBlackFromColor"/>
35+
<click selector="{{AdminNewAttributePanel.deleteOptionByName(ColorOptionRed.label)}}" stepKey="removeRedFromColor"/>
36+
<click selector="{{AdminNewAttributePanel.deleteOptionByName(ColorOptionBlue.label)}}" stepKey="removeBlueFromColor"/>
37+
<click selector="{{AdminNewAttributePanel.deleteOptionByName(ColorOptionPink.label)}}" stepKey="removePinkFromColor"/>
38+
<click selector="{{AdminNewAttributePanel.deleteOptionByName(ColorOptionWhite.label)}}" stepKey="removeWhiteFromColor"/>
39+
<actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttribute"/>
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
41+
</after>
42+
<!-- Step 2: Navigate to Products - Catalog -->
43+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
44+
<!-- Step 3: Start to create configurable product -->
45+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct">
46+
<argument name="product" value="BaseConfigurableProduct"/>
47+
</actionGroup>
48+
<!-- Step 4: Fill out required fields | Test Data: Product name: conf1, sku: conf1, price: 10 -->
49+
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues">
50+
<argument name="product" value="BaseConfigurableProduct"/>
51+
</actionGroup>
52+
<!-- Step 5: Click 'Create Configurations' button -->
53+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
54+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForConfigPanel"/>
55+
<!-- Step 6: Click 'Create New Attribute' on 1st step in 'Create Product Configurations' wizard -->
56+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute"/>
57+
<waitForPageLoad stepKey="waitForIFrame"/>
58+
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
59+
<!-- Step 7: Fill out label and options | Test Data: label: size, options: 8, 10, 12, 14, 16 -->
60+
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{ProductSizeAttribute.frontend_label}}" stepKey="fillAttributeLabel"/>
61+
<actionGroup ref="AdminNavigateToProductAttributeAdvancedSectionActionGroup" stepKey="goToAdvancedSection"/>
62+
<fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{ProductSizeAttribute.attribute_code}}" stepKey="fillAttributeCode"/>
63+
<actionGroup ref="AdminAddAttributeOptionInIFrameActionGroup" stepKey="addOption8">
64+
<argument name="optionLabel" value="{{SizeOption8.label}}"/>
65+
<argument name="optionIndex" value="1"/>
66+
</actionGroup>
67+
<actionGroup ref="AdminAddAttributeOptionInIFrameActionGroup" stepKey="addOption10">
68+
<argument name="optionLabel" value="{{SizeOption10.label}}"/>
69+
<argument name="optionIndex" value="2"/>
70+
</actionGroup>
71+
<actionGroup ref="AdminAddAttributeOptionInIFrameActionGroup" stepKey="addOption12">
72+
<argument name="optionLabel" value="{{SizeOption12.label}}"/>
73+
<argument name="optionIndex" value="3"/>
74+
</actionGroup>
75+
<actionGroup ref="AdminAddAttributeOptionInIFrameActionGroup" stepKey="addOption14">
76+
<argument name="optionLabel" value="{{SizeOption14.label}}"/>
77+
<argument name="optionIndex" value="4"/>
78+
</actionGroup>
79+
<actionGroup ref="AdminAddAttributeOptionInIFrameActionGroup" stepKey="addOption16">
80+
<argument name="optionLabel" value="{{SizeOption16.label}}"/>
81+
<argument name="optionIndex" value="5"/>
82+
</actionGroup>
83+
<!-- Step 8: Click 'Save Attribute' -->
84+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
85+
<waitForPageLoad stepKey="waitForAttributeSave"/>
86+
<switchToIFrame stepKey="switchOutOfIFrame"/>
87+
<!-- Step 9: Select both attributes in grid (default color and new created size attributes) -->
88+
<actionGroup ref="AdminFilterAttributeInConfigurableAttributesGrid" stepKey="filterSizeAttribute">
89+
<argument name="attributeCode" value="{{ProductSizeAttribute.attribute_code}}"/>
90+
</actionGroup>
91+
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnSizeCheckbox"/>
92+
<actionGroup ref="AdminFilterAttributeInConfigurableAttributesGrid" stepKey="filterColorAttribute">
93+
<argument name="attributeCode" value="color"/>
94+
</actionGroup>
95+
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnColorCheckbox"/>
96+
<!-- Step 10: Click 'Next' button -->
97+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/>
98+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute('Color')}}" stepKey="waitForAttributeValuesPage"/>
99+
<!-- Step 11: Add 5 options to default color attribute | Test Data: label: Color, Options: black, red, blue, pink, white -->
100+
<actionGroup ref="AdminCreateAttributeValueInConfigurationWizardActionGroup" stepKey="addBlackOption">
101+
<argument name="attributeLabel" value="Color"/>
102+
<argument name="optionValue" value="{{ColorOptionBlack.label}}"/>
103+
</actionGroup>
104+
<actionGroup ref="AdminCreateAttributeValueInConfigurationWizardActionGroup" stepKey="addRedOption">
105+
<argument name="attributeLabel" value="Color"/>
106+
<argument name="optionValue" value="{{ColorOptionRed.label}}"/>
107+
</actionGroup>
108+
<actionGroup ref="AdminCreateAttributeValueInConfigurationWizardActionGroup" stepKey="addBlueOption">
109+
<argument name="attributeLabel" value="Color"/>
110+
<argument name="optionValue" value="{{ColorOptionBlue.label}}"/>
111+
</actionGroup>
112+
<actionGroup ref="AdminCreateAttributeValueInConfigurationWizardActionGroup" stepKey="addPinkOption">
113+
<argument name="attributeLabel" value="Color"/>
114+
<argument name="optionValue" value="{{ColorOptionPink.label}}"/>
115+
</actionGroup>
116+
<actionGroup ref="AdminCreateAttributeValueInConfigurationWizardActionGroup" stepKey="addWhiteOption">
117+
<argument name="attributeLabel" value="Color"/>
118+
<argument name="optionValue" value="{{ColorOptionWhite.label}}"/>
119+
</actionGroup>
120+
<!-- Step 12: Select all options for 'size' attributes -->
121+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute('Color')}}" stepKey="selectAllColorOptions"/>
122+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(ProductSizeAttribute.frontend_label)}}" stepKey="selectAllSizeOptions"/>
123+
<!-- Step 13: Click 'Next' button -->
124+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/>
125+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitForBulkStep"/>
126+
<!-- Step 14: On step 3: Images: Skip, Price: Skip, Quantity: Apply single quantity to each SKUs | Test Data: Quantity: 10000 -->
127+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickSingleQuantity"/>
128+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="10000" stepKey="fillQuantity"/>
129+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep3"/>
130+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForSummary"/>
131+
<!-- Step 15: Click 'Generate Products' On Step 4: Summary | Expected Result: 25 products generated (conf1-black-8 through conf1-blue-16) -->
132+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/>
133+
<waitForPageLoad stepKey="waitForProductsGeneration"/>
134+
<!-- Step 16: Upload an image for each variation in Image column of Current Variations grid (Skipped in automation) -->
135+
<!-- Step 17: Click 'Save' button | Expected Result: 'Choose Affected Product Template' Pop-up appears -->
136+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveConfigurableProduct"/>
137+
<!-- Step 18: Select 'Add configurable attributes to the current set' and press 'Confirm' | Expected Result: 'You saved the product.' message appears -->
138+
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmAttributeSetForConfigurableProduct"/>
139+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
140+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="seeFirstVariation"/>
141+
<!-- Step 19: Click 'Edit Configurations' -->
142+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickEditConfigurations"/>
143+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForEditConfigPanel"/>
144+
<!-- Step 20: Uncheck Color attribute on 1st step in wizard -->
145+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox('color')}}" stepKey="uncheckColorAttribute"/>
146+
<!-- Step 21: Click 'Next' button | Expected Result: Only size attribute is displayed on Step 2: Attribute Values -->
147+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextAfterUncheckingColor"/>
148+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(ProductSizeAttribute.frontend_label)}}" stepKey="waitForSizeOptionsPage"/>
149+
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute('Color')}}" stepKey="verifyColorNotDisplayed"/>
150+
<!-- Step 22: Left two options checked | Test Data: Options: 8, 10 -->
151+
<click selector="{{AdminCreateProductConfigurationsPanel.deSelectAllByAttribute(ProductSizeAttribute.frontend_label)}}" stepKey="deselectAllSizeOptions"/>
152+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeOption(SizeOption8.label)}}" stepKey="selectSize8"/>
153+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeOption(SizeOption10.label)}}" stepKey="selectSize10"/>
154+
<!-- Step 23: Click 'Next' button | Expected Result: 'Step 3: Bulk Images, Price, and Quantity' is displayed -->
155+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2AfterEdit"/>
156+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitForBulkStepAfterEdit"/>
157+
<!-- Step 24: Check: Skip image uploading, Skip price, Skip quantity at this time -->
158+
<!-- Step 25: Click 'Next' button | Expected Result: Step 4: Summary - New Product Review grid: conf1-8, conf1-10; Disassociated Products grid: all other variations -->
159+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep3AfterEdit"/>
160+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForSummaryAfterEdit"/>
161+
<waitForText userInput="{{BaseConfigurableProduct.sku}}-{{SizeOption8.label}}" stepKey="seeNewVariation1InSummary"/>
162+
<waitForText userInput="{{BaseConfigurableProduct.sku}}-{{SizeOption10.label}}" stepKey="seeNewVariation2InSummary"/>
163+
<!-- Step 26: Click 'Next' button | Expected Result: 'Current Variations' grid contains: conf1-8, conf1-10 -->
164+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProductsAfterEdit"/>
165+
<waitForPageLoad stepKey="waitForProductsRegeneration"/>
166+
<!-- Step 27: Click 'Save' button | Expected Result: You saved the product. -->
167+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveConfigurableProductAfterEdit"/>
168+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageAfterEdit"/>
169+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.variationProductLinkByName(SizeOption8.label)}}" stepKey="verifyFinalVariation1"/>
170+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.variationProductLinkByName(SizeOption10.label)}}" stepKey="verifyFinalVariation2"/>
171+
</test>
172+
</tests>

0 commit comments

Comments
 (0)