|
| 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" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminProductMultiselectAttributeUncheckAllOptionsTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Save Product Multiselect attribute without selecting any options"/> |
| 14 | + <title value="Product Attribute of multiselect type can be saved with all options unchecked"/> |
| 15 | + <description |
| 16 | + value="Verify that a product attribute of multiselect type can be saved with all options unchecked in the admin product edit page."/> |
| 17 | + <testCaseId value="AC-4856"/> |
| 18 | + <severity value="MAJOR"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Login as admin --> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <!-- Pre-condition Step-1 Multiselect attribute is created with three options: 1, 2, 3 --> |
| 25 | + <createData entity="multiSelectAttributeWithThreeOptions" stepKey="createMultiSelectProductAttributeWith2Options"/> |
| 26 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 27 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 28 | + <argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/> |
| 29 | + </actionGroup> |
| 30 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> |
| 31 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 32 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 33 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 34 | + </actionGroup> |
| 35 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> |
| 36 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 37 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 38 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3"> |
| 41 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 42 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 43 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 44 | + </actionGroup> |
| 45 | + <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> |
| 46 | + <actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/> |
| 47 | + <!-- Pre-condition Step-2 Multiselect Attribute added to default Attribute set --> |
| 48 | + <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> |
| 49 | + <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> |
| 50 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 51 | + <argument name="group" value="Product Details"/> |
| 52 | + <argument name="attribute" value="$$createMultiSelectProductAttributeWith2Options.attribute_code$$"/> |
| 53 | + </actionGroup> |
| 54 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 55 | + <!-- Pre-condition Step-3 Product is created based on default attribute set. Value of multiselect attribute set to 1 and 2 for this product --> |
| 56 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 57 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 58 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> |
| 59 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> |
| 62 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 63 | + </actionGroup> |
| 64 | + <waitForElementVisible |
| 65 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 66 | + stepKey="waitForMultiSelectAttributeToSelect"/> |
| 67 | + <selectOption |
| 68 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 69 | + parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/> |
| 70 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
| 71 | + </before> |
| 72 | + <after> |
| 73 | + <!-- Delete product --> |
| 74 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 75 | + <!-- Delete attribute --> |
| 76 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 77 | + <argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/> |
| 80 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 81 | + </after> |
| 82 | + <!-- Step 2 & 3 - Navigate: Products > Catalog and Open created product --> |
| 83 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 84 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 85 | + </actionGroup> |
| 86 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 87 | + <!-- Step 4 - Uncheck all options of multiselect attribute --> |
| 88 | + <waitForElement |
| 89 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 90 | + stepKey="waitForMultiSelectAttributeToUnSelect"/> |
| 91 | + <unselectOption |
| 92 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 93 | + parameterArray="['1','2']" stepKey="uncheckAllOptions"/> |
| 94 | + <!-- Step 5 - Save product --> |
| 95 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterUncheck"/> |
| 96 | + <!-- Assert multiselect attribute has all options unchecked --> |
| 97 | + <dontSeeOptionIsSelected |
| 98 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 99 | + userInput="1" stepKey="assertOption1NotChecked"/> |
| 100 | + <dontSeeOptionIsSelected |
| 101 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 102 | + userInput="2" stepKey="assertOption2NotChecked"/> |
| 103 | + <dontSeeOptionIsSelected |
| 104 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" |
| 105 | + userInput="3" stepKey="assertOption3NotChecked"/> |
| 106 | + </test> |
| 107 | +</tests> |
| 108 | + |
0 commit comments