|
| 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="StorefrontQuickSearchConfigurableChildrenTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Search Product on Storefront"/> |
| 14 | + <title value="User should be able to use Quick Search to a configurable product's child products"/> |
| 15 | + <description value="Use Quick Search to find a configurable product with enabled/disable children"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MC-28374"/> |
| 18 | + <useCaseId value="MAGETWO-69181"/> |
| 19 | + <group value="catalogSearch"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create the category --> |
| 24 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 25 | + <!-- Create blank AttributeSet--> |
| 26 | + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> |
| 27 | + <!-- Create an attribute with two options to be used in the first child product --> |
| 28 | + <createData entity="hiddenDropdownAttributeWithOptions" stepKey="createProductAttribute"/> |
| 29 | + <createData entity="productAttributeOption1" stepKey="createProductAttributeOption"> |
| 30 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <!-- Assign attribute to set --> |
| 34 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 35 | + <actionGroup ref="GoToAttributeGridPageActionGroup" stepKey="goToAttributeSetPage"/> |
| 36 | + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="openAttributeSetByName"> |
| 37 | + <argument name="name" value="$createAttributeSet.attribute_set_name$"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 40 | + <argument name="group" value="Product Details"/> |
| 41 | + <argument name="attribute" value="$createProductAttribute.attribute_code$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="savePage"/> |
| 44 | + |
| 45 | + <!-- Get the first option of the attribute we created --> |
| 46 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getAttributeOption"> |
| 47 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 48 | + </getData> |
| 49 | + |
| 50 | + <!-- Create a simple product --> |
| 51 | + <createData entity="ApiSimpleOneHidden" storeCode="all" stepKey="createSimpleProduct"> |
| 52 | + <field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field> |
| 53 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 54 | + <requiredEntity createDataKey="getAttributeOption"/> |
| 55 | + </createData> |
| 56 | + <updateData entity="ApiSimpleProductUpdateDescription" createDataKey="createSimpleProduct" stepKey="updateSimpleProduct"/> |
| 57 | + |
| 58 | + <!-- Create the configurable product --> |
| 59 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> |
| 60 | + <field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field> |
| 61 | + <requiredEntity createDataKey="createCategory"/> |
| 62 | + </createData> |
| 63 | + <!-- Create the configurable product option --> |
| 64 | + <createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption"> |
| 65 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 66 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 67 | + <requiredEntity createDataKey="getAttributeOption"/> |
| 68 | + </createData> |
| 69 | + <!-- Add the first simple product to the configurable product --> |
| 70 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 71 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 72 | + <requiredEntity createDataKey="createSimpleProduct"/> |
| 73 | + </createData> |
| 74 | + |
| 75 | + <!-- Perform reindex --> |
| 76 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 77 | + </before> |
| 78 | + <after> |
| 79 | + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> |
| 80 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 81 | + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> |
| 82 | + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> |
| 83 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 84 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 85 | + </after> |
| 86 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> |
| 87 | + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> |
| 88 | + <argument name="phrase" value="$createConfigurableProduct.name$"/> |
| 89 | + </actionGroup> |
| 90 | + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeProductInGrid"> |
| 91 | + <argument name="productName" value="$createConfigurableProduct.name$"/> |
| 92 | + </actionGroup> |
| 93 | + |
| 94 | + <!-- Disable Child Product --> |
| 95 | + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openSimpleProduct"> |
| 96 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 97 | + </actionGroup> |
| 98 | + <actionGroup ref="ToggleProductEnabledActionGroup" stepKey="disableProduct"/> |
| 99 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 100 | + |
| 101 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePageAgain"/> |
| 102 | + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain"> |
| 103 | + <argument name="phrase" value="$createConfigurableProduct.name$"/> |
| 104 | + </actionGroup> |
| 105 | + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeProductAnymore"> |
| 106 | + <argument name="productName" value="$createConfigurableProduct.name$"/> |
| 107 | + </actionGroup> |
| 108 | + </test> |
| 109 | +</tests> |
0 commit comments