|
| 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="AdminAddAndUpdateCustomGroupInAttributeSetTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Edit attribute set"/> |
| 14 | + <title value="Add and Update a custom group in an Attribute Set"/> |
| 15 | + <description value="Create a new group. Assign/unassign attributes to/from it"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MC-26919"/> |
| 18 | + <group value="Catalog"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 22 | + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> |
| 23 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + |
| 27 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 28 | + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> |
| 29 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 30 | + </after> |
| 31 | + |
| 32 | + |
| 33 | + <!-- Navigate to Stores > Attributes > Attribute Set --> |
| 34 | + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/> |
| 35 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 36 | + |
| 37 | + <!-- Search and open Attribute Set from preconditions --> |
| 38 | + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute"> |
| 39 | + <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> |
| 40 | + </actionGroup> |
| 41 | + |
| 42 | + <!-- Click 'Add New': Show 'New Group' Modal --> |
| 43 | + <click selector="{{AdminProductAttributeSetEditSection.AddNewGroup}}" stepKey="clickAddNew"/> |
| 44 | + <waitForAjaxLoad stepKey="waitForAjax"/> |
| 45 | + |
| 46 | + <!-- Fill 'name' for new group and click 'Ok': Name = <empty> --> |
| 47 | + <fillField userInput="" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillName"/> |
| 48 | + <click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/> |
| 49 | + |
| 50 | + <!-- Error message 'This is a required field.' is displayed --> |
| 51 | + <see userInput="This is a required field." selector="{{AdminProductAttributeSetEditSection.errorLabel}}" stepKey="seeErrorMessage"/> |
| 52 | + |
| 53 | + <!-- Fill 'name' for new group and click 'Ok': Name = Custom group --> |
| 54 | + <fillField userInput="{{customGroup.name}}" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillCustomGroupName"/> |
| 55 | + <click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickButtonOk"/> |
| 56 | + |
| 57 | + <!-- Group is created and displayed in 'Groups' block --> |
| 58 | + <seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(customGroup.name)}}" stepKey="assertCustomGroup"/> |
| 59 | + |
| 60 | + <!-- Move custom Product Attribute to new 'Custom group' Group --> |
| 61 | + |
| 62 | + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> |
| 63 | + <click selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="clickButtonOk"/> |
| 64 | + <waitForPageLoad stepKey="waitForPageLoadAfterClick"/> |
| 65 | + <dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute($$createConfigProductAttribute.attribute_code$$)}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="moveAttribute"/> |
| 66 | + <waitForPageLoad stepKey="waitForDragAndDrop"/> |
| 67 | + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('custom_layout')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="dragAndDrop"/> |
| 68 | + <waitForPageLoad stepKey="waitForDragAndDrop1"/> |
| 69 | + <!-- Click 'Save' --> |
| 70 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/> |
| 71 | + <!-- Navigate to Catalog > Products --> |
| 72 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/> |
| 73 | + <!-- Start to create a new simple product with the custom attribute set from the preconditions --> |
| 74 | + <click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/> |
| 75 | + <waitForPageLoad stepKey="waitForNewProductPage"/> |
| 76 | + |
| 77 | + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute"> |
| 78 | + <argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!-- New Section 'Custom group' is present in form. The section contains the attribute from preconditions --> |
| 82 | + <seeElement selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="seeSectionCustomGroup"/> |
| 83 | + <click selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="openCustomGroupSection"/> |
| 84 | + <waitForAjaxLoad stepKey="waitForOpenSection"/> |
| 85 | + <scrollTo selector="{{AdminProductFormSection.footerBlock}}" stepKey="scrollToFooter"/> |
| 86 | + <seeElement selector="{{AdminProductAttributeSection.attributeByGroupAndName(customGroup.name)}}" stepKey="seeAttributePresent"/> |
| 87 | + |
| 88 | + </test> |
| 89 | +</tests> |
| 90 | + |
0 commit comments