|
| 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="AdminCreateProductCustomAttributeSet"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Add/Update attribute set"/> |
| 15 | + <title value="Admin should be able to create a simple product using a custom attribute set"/> |
| 16 | + <description value="Admin should be able to create a simple product using a custom attribute set"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MC-244"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + </before> |
| 25 | + |
| 26 | + <after> |
| 27 | + <!-- Delete the new attribute set --> |
| 28 | + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> |
| 29 | + <waitForPageLoad stepKey="wait1"/> |
| 30 | + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="filterByName"/> |
| 31 | + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> |
| 32 | + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> |
| 33 | + <waitForPageLoad stepKey="wait2"/> |
| 34 | + <click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/> |
| 35 | + <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> |
| 36 | + <waitForPageLoad stepKey="wait3"/> |
| 37 | + |
| 38 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 39 | + </after> |
| 40 | + |
| 41 | + <!-- Create a new attribute set --> |
| 42 | + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> |
| 43 | + <waitForPageLoad stepKey="wait1"/> |
| 44 | + <click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/> |
| 45 | + <fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillName"/> |
| 46 | + <selectOption selector="{{AdminProductAttributeSetSection.basedOn}}" userInput="Default" stepKey="selectDefaultSet"/> |
| 47 | + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/> |
| 48 | + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('meta_keyword')}}" selector2="{{AdminProductAttributeSetSection.attribute('manufacturer')}}" stepKey="unassign1"/> |
| 49 | + <click selector="{{AdminProductAttributeSetSection.addNewGroupBtn}}" stepKey="clickAddNewGroup"/> |
| 50 | + <fillField selector="{{AdminProductAttributeSetSection.newGroupName}}" userInput="TestGroupName" stepKey="fillNewGroupName"/> |
| 51 | + <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="clickOkInModal"/> |
| 52 | + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('manufacturer')}}" selector2="{{AdminProductAttributeSetSection.attribute('TestGroupName')}}" stepKey="assignManufacturer"/> |
| 53 | + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave2"/> |
| 54 | + |
| 55 | + <!-- Go to new product page and see a default attribute --> |
| 56 | + <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToNewProductPage"/> |
| 57 | + <waitForPageLoad stepKey="wait2"/> |
| 58 | + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="expandSEOSection"/> |
| 59 | + <seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="seeMetaKeyword"/> |
| 60 | + <dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="dontSeeTestGroupName"/> |
| 61 | + |
| 62 | + <!-- Switch from default attribute set to new attribute set --> |
| 63 | + <!-- A scrollToTopOfPage is needed to hide the floating header --> |
| 64 | + <scrollToTopOfPage stepKey="scrollToTop"/> |
| 65 | + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> |
| 66 | + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/> |
| 67 | + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> |
| 68 | + |
| 69 | + <!-- See new attibute set --> |
| 70 | + <seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="seeTestGroupName"/> |
| 71 | + <dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="dontSeeMetaKeyword"/> |
| 72 | + |
| 73 | + <!-- Finish filling the new product page --> |
| 74 | + <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> |
| 75 | + <argument name="product" value="_defaultProduct"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> |
| 78 | + |
| 79 | + <!-- Check the storefront --> |
| 80 | + <amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/> |
| 81 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 82 | + <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitlte"/> |
| 83 | + <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> |
| 84 | + <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> |
| 85 | + <see userInput="${{_defaultProduct.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> |
| 86 | + </test> |
| 87 | +</tests> |
0 commit comments