Skip to content

Commit c32a7ad

Browse files
ACQE-8576: Clone configurable product and verify the admin is able to save the product
- Removed actions and created custom action group for creating variations
1 parent 73a487b commit c32a7ad

File tree

2 files changed

+50
-73
lines changed

2 files changed

+50
-73
lines changed
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 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="AdminSelectAllValueOfTwoAttributesAndSelectSingleImageAndPricePageActionGroup" extends="AdminSelectAllValueOfTwoAttributesPageActionGroup">
11+
<annotations>
12+
<description>Select values of each attribute to include in the product and assigns a image to the product.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="price" type="string" defaultValue="100"/>
16+
<argument name="image" type="string" defaultValue="MagentoLogo"/>
17+
</arguments>
18+
<waitForPageLoad stepKey="waitForImagesPage" after="clickNextToApplyQuantity"/>
19+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}"
20+
stepKey="clickApplySingleSetOfImages" after="waitForImagesPage"/>
21+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}"
22+
stepKey="waitForImageUploadSection" after="clickApplySingleSetOfImages"/>
23+
<attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image}}"
24+
stepKey="uploadImageForAllConfigurations" after="waitForImageUploadSection"/>
25+
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}"
26+
stepKey="waitForImageUpload" after="uploadImageForAllConfigurations"/>
27+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}"
28+
stepKey="waitForPriceRadio" after="waitForImageUpload"/>
29+
<click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}"
30+
stepKey="selectSinglePrice" after="waitForPriceRadio"/>
31+
<fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}"
32+
stepKey="enterPrice" after="selectSinglePrice"/>
33+
</actionGroup>
34+
</actionGroups>

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

Lines changed: 16 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@
4949
<actionGroup ref="AdminAddSwatchOptionAndFillFieldsActionGroup" stepKey="addYellowSwatchOption">
5050
<argument name="swatchOption" value="Yellow"/>
5151
</actionGroup>
52-
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}"
53-
stepKey="waitForColorSaveButton"/>
54-
<click selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}"
55-
stepKey="clickOnColorSaveAttribute"/>
56-
<waitForPageLoad stepKey="waitForColorAttributeToSave"/>
57-
<waitForElement selector="{{AdminProductMessagesSection.successMessage}}"
58-
stepKey="seeColorSaveProductMessage"/>
52+
<actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveColorAttribute"/>
5953
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid1"/>
6054
<actionGroup ref="FillProductAttributeFieldsActionGroup" stepKey="fillSizeAttributeFields">
6155
<argument name="attributeLabel" value="{{sizeProductAttributeWithOptions.default_label}}"/>
@@ -113,13 +107,7 @@
113107
<argument name="swatchName" value="{{sizeProductAttributeWithOptions.option6}}"/>
114108
<argument name="swatchDescription" value="{{sizeProductAttributeWithOptions.option6}}"/>
115109
</actionGroup>
116-
<waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}"
117-
stepKey="waitForSizeSaveButton"/>
118-
<click selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}"
119-
stepKey="clickOnSizeSaveAttribute"/>
120-
<waitForPageLoad stepKey="waitForSizeAttributeToSave"/>
121-
<waitForElement selector="{{AdminProductMessagesSection.successMessage}}"
122-
stepKey="seeSizeSaveProductMessage"/>
110+
<actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveSizeAttribute"/>
123111
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
124112
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openAttributeSetForColor">
125113
<argument name="attributeSetName" value="Default"/>
@@ -183,14 +171,13 @@
183171
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForConfigurableProduct">
184172
<argument name="product" value="ApiConfigurableProduct"/>
185173
</actionGroup>
186-
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickShowFilters"/>
187-
<selectOption selector="{{AdminProductGridFilterSection.typeFilter}}"
188-
userInput="{{ApiConfigurableProduct.type_id}}" stepKey="selectConfigurableType"/>
189-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
174+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="seeConfigurableProductInGrid">
175+
<argument name="product" value="ApiConfigurableProduct"/>
176+
</actionGroup>
190177
<!-- Step 3: Open product and Save & Duplicate -->
191-
<click selector="{{AdminProductGridSection.productGridNameProduct(ApiConfigurableProduct.name)}}"
192-
stepKey="openConfigurableProductForEdit"/>
193-
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
178+
<actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="openConfigurableProductForEdit">
179+
<argument name="product" value="ApiConfigurableProduct"/>
180+
</actionGroup>
194181
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProduct"/>
195182
<!-- Step 4: Enable the product, set stock status to In Stock, and click Edit Configurations -->
196183
<waitForPageLoad stepKey="waitForProductEditPageLoadAfterDuplicateProduct"/>
@@ -201,58 +188,14 @@
201188
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}"
202189
stepKey="clickEditConfigurations"/>
203190
<waitForPageLoad stepKey="waitForConfigurationsPageLoad"/>
204-
<!-- Step 4: Skip Color and Size check box (since its already selected) and click on next -->
205-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNext"/>
206-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/>
207-
<!-- Step 5: Select All options -->
208-
<waitForElementVisible
209-
selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(colorProductVisualAttributeWithOptions.default_label)}}"
210-
stepKey="waitForSelectAllColor"/>
211-
<click
212-
selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(colorProductVisualAttributeWithOptions.default_label)}}"
213-
stepKey="selectAllSwatchAttributeOptionsForColor"/>
214-
<waitForElementVisible
215-
selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeProductAttributeWithOptions.default_label)}}"
216-
stepKey="waitForSelectAllSize"/>
217-
<click
218-
selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeProductAttributeWithOptions.default_label)}}"
219-
stepKey="selectAllSwatchAttributeOptionsForSize"/>
220-
<!-- Step 7: Next -->
221-
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}"
222-
stepKey="waitForNextButton1"/>
223-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextAfterSelectingOptions"/>
224-
<!-- Step 8: Add images , price and quantity and click on next -->
225-
<waitForPageLoad stepKey="waitForImagesPage"/>
226-
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}"
227-
stepKey="clickApplySingleSetOfImages"/>
228-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}"
229-
stepKey="waitForImageUploadSection"/>
230-
<attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="magento-logo.png"
231-
stepKey="uploadImageForAllConfigurations"/>
232-
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}"
233-
stepKey="waitForImageUpload"/>
234-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile('magento-logo')}}"
235-
stepKey="waitForImageThumbnail"/>
236-
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}"
237-
stepKey="waitForPriceRadio"/>
238-
<click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}"
239-
stepKey="selectSinglePrice"/>
240-
<fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="100"
241-
stepKey="enterPrice"/>
242-
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}"
243-
stepKey="waitForQuantityRadio"/>
244-
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}"
245-
stepKey="selectSingleQuantity"/>
246-
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99"
247-
stepKey="enterQuantity"/>
248-
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}"
249-
stepKey="waitForNextButton2"/>
250-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextAfterPriceQuantity"/>
251-
<!-- Step 9: Click on Generate -->
252-
<waitForPageLoad stepKey="waitForSummaryPage"/>
253-
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}"
254-
stepKey="waitForGenerateButton"/>
255-
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickGenerateProducts"/>
191+
<!-- Step 5,6,7,8,9: Select all options -->
192+
<actionGroup ref="AdminSelectAllValueOfTwoAttributesAndSelectSingleImageAndPricePageActionGroup" stepKey="configureProductVariations">
193+
<argument name="attributeLabel1" value="{{colorProductVisualAttributeWithOptions.default_label}}"/>
194+
<argument name="attributeLabel2" value="{{sizeProductAttributeWithOptions.default_label}}"/>
195+
<argument name="quantity" value="{{ImportProductSimple1_Configurable.quantity}}"/>
196+
<argument name="price" value="{{ImportProductSimple1_Configurable.price}}"/>
197+
<argument name="image" value="{{ImportProductSimple1_Configurable.baseImage}}"/>
198+
</actionGroup>
256199
<waitForPageLoad stepKey="waitForProductsGeneration"/>
257200
<!-- Step 10: Click on Save button -->
258201
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/>

0 commit comments

Comments
 (0)