Skip to content

Commit ad9b087

Browse files
authored
ENGCOM-8566: [MFTF] Adding AdminSelectAttributeSetOnEditProductPageActionGroup #31287
2 parents 661c15c + 48fc0cd commit ad9b087

6 files changed

+55
-18
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@
4242
<!-- Switch from default attribute set to new attribute set -->
4343
<amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/>
4444
<waitForPageLoad stepKey="wait2"/>
45-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
46-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
47-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
45+
46+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
47+
<argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/>
48+
</actionGroup>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
51+
4852
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
4953
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
5054

@@ -64,9 +68,11 @@
6468
<click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/>
6569
<waitForPageLoad stepKey="waitForPageLoad2"/>
6670

67-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/>
68-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/>
69-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/>
71+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2">
72+
<argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/>
73+
</actionGroup>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/>
75+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/>
7076

7177
<!--save the product/published by default-->
7278
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@
109109
<checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/>
110110

111111
<!--Apply Attribute Set-->
112-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
113-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/>
114-
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/>
112+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
113+
<argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/>
114+
</actionGroup>
115+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
116+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
115117

116118
<!--Product name and SKU-->
117119
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup">
12+
<annotations>
13+
<description>Selects the specified value from the Attribute Set dropdown on the opened product edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeSet" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="clickAttributeSetDropdown"/>
20+
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet}}" stepKey="searchForAttributeSet"/>
21+
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttributeSet"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@
6060
<argument name="product" value="$$createSimpleProduct$$"/>
6161
</actionGroup>
6262

63-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
64-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/>
65-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
63+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
64+
<argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/>
65+
</actionGroup>
66+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
6668

6769
<waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/>
6870
</test>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@
6464
</actionGroup>
6565

6666
<!-- Switch from default attribute set to new attribute set -->
67-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
68-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/>
69-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
67+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
68+
<argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/>
69+
</actionGroup>
70+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
71+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
7072

7173
<!-- See new attribute set -->
7274
<see selector="{{AdminProductFormSection.attributeSet}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="seeAttributeSetName"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@
6262
<!-- Switch from default attribute set to new attribute set -->
6363
<!-- A scrollToTopOfPage is needed to hide the floating header -->
6464
<scrollToTopOfPage stepKey="scrollToTop"/>
65-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
66-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
67-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
65+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
66+
<argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/>
67+
</actionGroup>
68+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
69+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
6870

6971
<!-- See new attibute set -->
7072
<seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="seeTestGroupName"/>

0 commit comments

Comments
 (0)