|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Create Multiple Select product attribute and check its visibility in Advanced Search form"/> |
| 14 | + <title value="Create product attribute of type Multiple Select and check its visibility on frontend in Advanced Search form"/> |
| 15 | + <description value="Admin should be able to create product attribute of type Multiple Select and check its visibility on frontend in Advanced Search form"/> |
| 16 | + <testCaseId value="MC-10828"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Create a multiple select product attribute with two options --> |
| 22 | + <createData entity="productAttributeMultiSelectTwoOptionsNotSearchable" stepKey="attribute"/> |
| 23 | + <createData entity="productAttributeOption1" stepKey="option1"> |
| 24 | + <requiredEntity createDataKey="attribute"/> |
| 25 | + </createData> |
| 26 | + <createData entity="productAttributeOption2" stepKey="option2"> |
| 27 | + <requiredEntity createDataKey="attribute"/> |
| 28 | + </createData> |
| 29 | + <!-- Create product attribute set --> |
| 30 | + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> |
| 31 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 32 | + </before> |
| 33 | + <!-- Filter product attribute set by attribute set name --> |
| 34 | + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> |
| 35 | + <actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName"> |
| 36 | + <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Assert created attribute in an unassigned attributes --> |
| 39 | + <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> |
| 40 | + <!-- Assign attribute in the group --> |
| 41 | + <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> |
| 42 | + <argument name="group" value="Product Details"/> |
| 43 | + <argument name="attribute" value="$$attribute.attribute_code$$"/> |
| 44 | + </actionGroup> |
| 45 | + <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> |
| 46 | + <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> |
| 47 | + <!-- Go to Product Attribute Grid page --> |
| 48 | + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> |
| 49 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$$attribute.attribute_code$$" stepKey="fillAttrCodeField" /> |
| 50 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" /> |
| 51 | + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" /> |
| 52 | + <!-- Change attribute property: Frontend Label --> |
| 53 | + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel"/> |
| 54 | + <!-- Change attribute property: Use in Search >Yes --> |
| 55 | + <scrollToTopOfPage stepKey="scrollToTabs"/> |
| 56 | + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> |
| 57 | + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" stepKey="waitTabLoad"/> |
| 58 | + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="seeInSearch"/> |
| 59 | + <!-- Change attribute property: Visible In Advanced Search >No --> |
| 60 | + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" stepKey="waitTabLoad2"/> |
| 61 | + <selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="No" stepKey="dontSeeInAdvancedSearch"/> |
| 62 | + <!-- Save the new product attributes --> |
| 63 | + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/> |
| 64 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> |
| 65 | + <!-- Flash cache --> |
| 66 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 67 | + <!-- Go to store's advanced catalog search page --> |
| 68 | + <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> |
| 69 | + <dontSeeElement selector="{{StorefrontCatalogSearchAdvancedFormSection.AttributeByCode('$$attribute.attribute_code$$')}}" stepKey="dontSeeAttribute"/> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments