|
| 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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminUnassignProductAttributeFromAttributeSetTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Add/Update attribute set"/> |
| 15 | + <title value="Admin should be able to unassign attributes from an attribute set"/> |
| 16 | + <description value="Admin should be able to unassign attributes from an attribute set"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-194"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="productDropDownAttribute" stepKey="attribute"/> |
| 23 | + |
| 24 | + <createData entity="productAttributeOption1" stepKey="option1"> |
| 25 | + <requiredEntity createDataKey="attribute"/> |
| 26 | + </createData> |
| 27 | + <createData entity="productAttributeOption2" stepKey="option2"> |
| 28 | + <requiredEntity createDataKey="attribute"/> |
| 29 | + </createData> |
| 30 | + |
| 31 | + <createData entity="AddToDefaultSet" stepKey="addToDefaultSet"> |
| 32 | + <requiredEntity createDataKey="attribute"/> |
| 33 | + </createData> |
| 34 | + |
| 35 | + <createData entity="ApiProductWithDescription" stepKey="product"/> |
| 36 | + |
| 37 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 38 | + </before> |
| 39 | + <after> |
| 40 | + <deleteData createDataKey="attribute" stepKey="deleteAttribute"/> |
| 41 | + <actionGroup ref="logout" stepKey="logout"/> |
| 42 | + </after> |
| 43 | + |
| 44 | + <!-- Assert attribute presence in storefront product additional information --> |
| 45 | + <amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage1"/> |
| 46 | + <waitForPageLoad stepKey="wait1"/> |
| 47 | + <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkAttributeInMoreInformationTab"> |
| 48 | + <argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/> |
| 49 | + <argument name="attributeValue" value="$$option2.option[store_labels][0][label]$$"/> |
| 50 | + </actionGroup> |
| 51 | + <!-- Go to default attribute set edit page --> |
| 52 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> |
| 53 | + <!-- Assert created attribute in a group --> |
| 54 | + <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> |
| 55 | + <!-- Unassign attribute from group --> |
| 56 | + <actionGroup ref="UnassignAttributeFromGroup" stepKey="UnassignAttributeFromGroup"> |
| 57 | + <argument name="group" value="Product Details"/> |
| 58 | + <argument name="attribute" value="$$attribute.attribute_code$$"/> |
| 59 | + </actionGroup> |
| 60 | + <!-- Assert attribute in unassigned section --> |
| 61 | + <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> |
| 62 | + <!-- Save attribute set --> |
| 63 | + <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> |
| 64 | + <!-- Go to create new product page --> |
| 65 | + <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> |
| 66 | + <!-- Assert attribute not present in product creation --> |
| 67 | + <dontSeeElement selector="{{AdminProductFormSection.attributeLabel($$attribute.attribute[frontend_labels][0][label]$$)}}" stepKey="seeLabel"/> |
| 68 | + <!-- Assert removed attribute not presence in storefront product additional information --> |
| 69 | + <amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage2"/> |
| 70 | + <waitForPageLoad stepKey="wait2"/> |
| 71 | + <!-- Skip because of MAGETWO-92780 --> |
| 72 | + <!--actionGroup ref="checkAttributeNotInMoreInformationTab" stepKey="checkAttributeNotInMoreInformationTab"> |
| 73 | + <argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/> |
| 74 | + </actionGroup--> |
| 75 | + </test> |
| 76 | +</tests> |
0 commit comments