|
| 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="AdminChangeProductAttributeGroupTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Preserving attribute value after attribute group is changed"/> |
| 13 | + <description value="Attribute value should be preserved after changing attribute group"/> |
| 14 | + <severity value="CRITICAL"/> |
| 15 | + <testCaseId value="MC-35612"/> |
| 16 | + <useCaseId value="MC-31892"/> |
| 17 | + <group value="catalog"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 21 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 22 | + <requiredEntity createDataKey="createCategory"/> |
| 23 | + </createData> |
| 24 | + |
| 25 | + <createData entity="productAttributeText" stepKey="createProductAttribute"/> |
| 26 | + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> |
| 27 | + <createData entity="CatalogAttributeSet" stepKey="createSecondAttributeSet"/> |
| 28 | + |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 30 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" |
| 31 | + stepKey="onAttributeSetEdit"/> |
| 32 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 33 | + <argument name="group" value="Product Details"/> |
| 34 | + <argument name="attribute" value="$createProductAttribute.attribute_code$"/> |
| 35 | + </actionGroup> |
| 36 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 37 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createSecondAttributeSet.attribute_set_id$/" |
| 38 | + stepKey="onSecondAttributeSetEdit"/> |
| 39 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToContentGroup"> |
| 40 | + <argument name="group" value="Content"/> |
| 41 | + <argument name="attribute" value="$createProductAttribute.attribute_code$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveSecondAttributeSet"/> |
| 44 | + </before> |
| 45 | + <after> |
| 46 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 47 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 48 | + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> |
| 49 | + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> |
| 50 | + <deleteData createDataKey="createSecondAttributeSet" stepKey="deleteSecondAttributeSet"/> |
| 51 | + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/> |
| 52 | + |
| 53 | + <!-- Reindex invalidated indices after product attribute has been created/deleted --> |
| 54 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 55 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> |
| 59 | + <argument name="product" value="$createSimpleProduct$"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> |
| 63 | + <argument name="product" value="$createSimpleProduct$"/> |
| 64 | + </actionGroup> |
| 65 | + |
| 66 | + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> |
| 67 | + <argument name="attributeSetName" value="$createAttributeSet.attribute_set_name$"/> |
| 68 | + </actionGroup> |
| 69 | + <waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInForm"/> |
| 70 | + <fillField selector="{{AdminProductFormSection.attributeRequiredInput($createProductAttribute.attribute_code$)}}" |
| 71 | + userInput="test" |
| 72 | + stepKey="fillProductAttributeValue"/> |
| 73 | + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectSecondAttributeSet"> |
| 74 | + <argument name="attributeSetName" value="$createSecondAttributeSet.attribute_set_name$"/> |
| 75 | + </actionGroup> |
| 76 | + <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandContentSection"/> |
| 77 | + <waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInSection"/> |
| 78 | + <grabValueFrom selector="{{AdminProductContentSection.attributeInput($createProductAttribute.attribute_code$)}}" |
| 79 | + stepKey="attributeValue"/> |
| 80 | + <assertEquals stepKey="assertAttributeValue"> |
| 81 | + <expectedResult type="string">test</expectedResult> |
| 82 | + <actualResult type="variable">attributeValue</actualResult> |
| 83 | + </assertEquals> |
| 84 | + </test> |
| 85 | +</tests> |
0 commit comments