|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="SavingCustomAttributeValuesUsingUITest"> |
| 12 | + <annotations> |
| 13 | + <group value="Custom Attribute"/> |
| 14 | + <stories value="Create Customer Attribute with Multi Select Input Type"/> |
| 15 | + <title value="Saving custom attribute values using UI"/> |
| 16 | + <description value="Saving custom attribute values using UI"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-7325"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!--Login as admin--> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 24 | + <!-- Create Simple Product --> |
| 25 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 26 | + <!--Navigate to Stores > Attributes > Product.--> |
| 27 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 28 | + |
| 29 | + <!--Create new Product Attribute as TextField, with code and default value.--> |
| 30 | + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> |
| 31 | + <argument name="attribute" value="multiselectProductAttribute"/> |
| 32 | + </actionGroup> |
| 33 | + |
| 34 | + <!--Navigate to Product Attribute, add Product Options and Save - 1--> |
| 35 | + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> |
| 36 | + <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> |
| 37 | + </actionGroup> |
| 38 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> |
| 39 | + <argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/> |
| 40 | + <argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/> |
| 41 | + <argument name="row" value="1"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> |
| 44 | + <argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/> |
| 45 | + <argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/> |
| 46 | + <argument name="row" value="2"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3"> |
| 49 | + <argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/> |
| 50 | + <argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/> |
| 51 | + <argument name="row" value="3"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults"> |
| 55 | + <argument name="useInLayeredNavigationValue" value="Filterable (with results)"/> |
| 56 | + </actionGroup> |
| 57 | + <selectOption selector="{{AttributePropertiesSection.useInSearchResultsLayeredNavigation}}" userInput="Yes" stepKey="selectUseInLayeredNavigationOption"/> |
| 58 | + <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> |
| 59 | + |
| 60 | + <magentoCron groups="index" stepKey="reindex"/> |
| 61 | + </before> |
| 62 | + <after> |
| 63 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/> |
| 64 | + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> |
| 65 | + <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> |
| 66 | + </actionGroup> |
| 67 | + <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> |
| 68 | + <click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/> |
| 69 | + <waitForPageLoad stepKey="waitForDeletion"/> |
| 70 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 71 | + <argument name="indices" value=""/> |
| 72 | + </actionGroup> |
| 73 | + <!--Log out--> |
| 74 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> |
| 75 | + </after> |
| 76 | + |
| 77 | + <!-- Open created product for edit --> |
| 78 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 79 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 80 | + </actionGroup> |
| 81 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 82 | + |
| 83 | + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> |
| 84 | + <waitForPageLoad stepKey="waitForAttributeAdded"/> |
| 85 | + <!-- Filter By Attribute Label on Add Attribute Page --> |
| 86 | + <click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/> |
| 87 | + <fillField selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{multiselectProductAttribute.attribute_code}}" stepKey="fillAttrCodeField" /> |
| 88 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" /> |
| 89 | + <click stepKey="clickonFirstRow" selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}"/> |
| 90 | + <click stepKey="clickOnAddSelected" selector="{{AdminProductAttributeGridSection.addSelected}}"/> |
| 91 | + <waitForPageLoad stepKey="waitForAttributeAdded2"/> |
| 92 | + <!-- Expand 'Attributes' tab --> |
| 93 | + <actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTab"/> |
| 94 | + <!-- Check created attribute presents in the 'Attributes' tab --> |
| 95 | + <seeElement selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" stepKey="assertAttributeIsPresentInTab"/> |
| 96 | + <!-- Select attribute options --> |
| 97 | + <selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" userInput="{{multiselectProductAttribute.option1_admin}}" stepKey="selectProduct1AttributeOption"/> |
| 98 | + <!-- Save product --> |
| 99 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
| 100 | + <!-- Go to Storefront and search for product--> |
| 101 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/> |
| 102 | + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> |
| 103 | + <argument name="phrase" value="$createSimpleProduct.name$"/> |
| 104 | + </actionGroup> |
| 105 | + <!-- Assert custom Attribute in Layered Navigation--> |
| 106 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" stepKey="waitForAttributeVisible"/> |
| 107 | + <conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/> |
| 108 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForAttributeOptionsVisible"/> |
| 109 | + <wait time="10" stepKey="Wait"/> |
| 110 | + <see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="{{multiselectProductAttribute.option1_frontend}}" stepKey="seeOption2"/> |
| 111 | + </test> |
| 112 | +</tests> |
0 commit comments