Skip to content

Commit 1e97e30

Browse files
ACQE-8248: Product Attribute of multiselect type can be saved with all options unchecked
- Used action group for saving product and replacing seeelement with waitforelementvisible
1 parent 495df39 commit 1e97e30

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

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

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
2121
<test name="AdminProductMultiselectAttributeUncheckAllOptionsTest">
2222
<annotations>
23-
<group value="Catalog"/>
24-
<title value="Product Attribute of multiselect type can be saved with all options unchecked"/>
2523
<features value="Uncheck multiselect attribute options and save the product"/>
2624
<stories value="Save Product Multiselect attribute without selecting any options"/>
27-
<description value="Verify that a product attribute of multiselect type can be saved with all options unchecked in the admin product edit page."/>
25+
<title value="Product Attribute of multiselect type can be saved with all options unchecked"/>
26+
<description
27+
value="Verify that a product attribute of multiselect type can be saved with all options unchecked in the admin product edit page."/>
2828
<testCaseId value="AC-4856"/>
2929
<severity value="MAJOR"/>
30+
<group value="Catalog"/>
3031
</annotations>
3132
<before>
3233
<!-- Login as admin -->
@@ -52,8 +53,8 @@
5253
<argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/>
5354
<argument name="row" value="{{multiSelectAttributeWithThreeOptions.option3}}"/>
5455
</actionGroup>
55-
<waitForElement selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton" />
56-
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
56+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
57+
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/>
5758
<!-- Pre-condition Step-2 Multiselect Attribute added to default Attribute set -->
5859
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
5960
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
@@ -71,8 +72,12 @@
7172
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
7273
<argument name="product" value="$$createSimpleProduct$$"/>
7374
</actionGroup>
74-
<waitForElement selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" stepKey="waitForMultiSelectAttributeToSelect" />
75-
<selectOption selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/>
75+
<waitForElementVisible
76+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
77+
stepKey="waitForMultiSelectAttributeToSelect"/>
78+
<selectOption
79+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
80+
parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/>
7681
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
7782
</before>
7883
<after>
@@ -91,16 +96,24 @@
9196
</actionGroup>
9297
<waitForPageLoad stepKey="waitForProductPageLoad"/>
9398
<!-- Step 4 - Uncheck all options of multiselect attribute -->
94-
<waitForElement selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" stepKey="waitForMultiSelectAttributeToUnSelect" />
95-
<unselectOption selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" parameterArray="['1','2']" stepKey="uncheckAllOptions"/>
99+
<waitForElement
100+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
101+
stepKey="waitForMultiSelectAttributeToUnSelect"/>
102+
<unselectOption
103+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
104+
parameterArray="['1','2']" stepKey="uncheckAllOptions"/>
96105
<!-- Step 5 - Save product -->
97106
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterUncheck"/>
98-
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
99-
<seeElement selector="{{AdminMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
100107
<!-- Assert multiselect attribute has all options unchecked -->
101-
<dontSeeOptionIsSelected selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" userInput="1" stepKey="assertOption1NotChecked"/>
102-
<dontSeeOptionIsSelected selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" userInput="2" stepKey="assertOption2NotChecked"/>
103-
<dontSeeOptionIsSelected selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" userInput="3" stepKey="assertOption3NotChecked"/>
108+
<dontSeeOptionIsSelected
109+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
110+
userInput="1" stepKey="assertOption1NotChecked"/>
111+
<dontSeeOptionIsSelected
112+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
113+
userInput="2" stepKey="assertOption2NotChecked"/>
114+
<dontSeeOptionIsSelected
115+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
116+
userInput="3" stepKey="assertOption3NotChecked"/>
104117
</test>
105118
</tests>
106119

0 commit comments

Comments
 (0)