|
| 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="AddNewProductAttributeInProductPageTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Create product Attribute"/> |
| 14 | + <title value="Create Product Attribute from Product Page"/> |
| 15 | + <description value="Login as admin and create new product attribute from product page with Text Field"/> |
| 16 | + <severity value="BLOCKER"/> |
| 17 | + <testCaseId value="MC-26654"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!-- Login as admin --> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 24 | + |
| 25 | + <!--Create Category--> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + |
| 28 | + <!--Create Simple Product--> |
| 29 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <!--Delete created entity --> |
| 35 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 36 | + |
| 37 | + <!--<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>--> |
| 38 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> |
| 39 | + <argument name="ProductAttribute" value="newProductAttribute"/> |
| 40 | + </actionGroup> |
| 41 | + |
| 42 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 43 | + </after> |
| 44 | + |
| 45 | + <!-- Open Product Index Page--> |
| 46 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 47 | + |
| 48 | + <!-- Select Created Product--> |
| 49 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> |
| 50 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 51 | + </actionGroup> |
| 52 | + <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> |
| 53 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 54 | + |
| 55 | + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/> |
| 56 | + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus"> |
| 57 | + <argument name="stockStatus" value="In Stock"/> |
| 58 | + </actionGroup> |
| 59 | + |
| 60 | + <!-- Create New Product Attribute --> |
| 61 | + <actionGroup ref="AddProductAttributeActionGroup" stepKey="createattribute"/> |
| 62 | + |
| 63 | + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveTheProduct"/> |
| 64 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> |
| 65 | + |
| 66 | + <!--Verify product attribute added in product form --> |
| 67 | + <scrollTo selector="{{AdminProductFormSection.contentTab}}" stepKey="scrollToContentTab"/> |
| 68 | + <waitForElementVisible selector="{{AdminProductFormSection.attributeTab}}" stepKey="waitForAttributeToVisible"/> |
| 69 | + <click selector="{{AdminProductFormSection.attributeTab}}" stepKey="clickOnAttribute"/> |
| 70 | + <seeElement selector="{{AdminProductFormSection.attributeLabelByText(ProductAttributeFrontendLabel.label)}}" stepKey="seeAttributeLabelInProductForm"/> |
| 71 | + |
| 72 | + <!--Verify Product Attribute in Attribute Form --> |
| 73 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid"/> |
| 74 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{newProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> |
| 75 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> |
| 76 | + <waitForPageLoad stepKey="waitForPageLoad" /> |
| 77 | + <see selector="{{AdminProductAttributeGridSection.attributeCodeColumn}}" userInput="{{newProductAttribute.attribute_code}}" stepKey="seeAttributeCode"/> |
| 78 | + <see selector="{{AdminProductAttributeGridSection.defaultLabelColumn}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="seeDefaultLabel"/> |
| 79 | + <see selector="{{AdminProductAttributeGridSection.isVisibleColumn}}" userInput="Yes" stepKey="seeIsVisibleColumn"/> |
| 80 | + <see selector="{{AdminProductAttributeGridSection.isSearchableColumn}}" userInput="Yes" stepKey="seeSearchableColumn"/> |
| 81 | + <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> |
| 82 | + |
| 83 | + <!--Verify Product Attribute is present in Category Store Front Page --> |
| 84 | + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> |
| 85 | + <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> |
| 86 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> |
| 87 | + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> |
| 88 | + <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> |
| 89 | + <waitForPageLoad stepKey="waitForProductToLoad1"/> |
| 90 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> |
| 91 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> |
| 92 | + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> |
| 93 | + <argument name="productSku" value="{{SimpleProduct.sku}}"/> |
| 94 | + </actionGroup> |
| 95 | + <scrollTo selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="scrollToMoreInformation"/> |
| 96 | + <see selector="{{StorefrontProductMoreInformationSection.attributeLabel}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="seeAttributeLabel"/> |
| 97 | + <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> |
| 98 | + |
| 99 | + <!--Verify Product Attribute present in search page --> |
| 100 | + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage1"/> |
| 101 | + <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> |
| 102 | + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> |
| 103 | + <argument name="phrase" value="{{ProductAttributeOption8.value}}"/> |
| 104 | + </actionGroup> |
| 105 | + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProductNameInCategoryPage"> |
| 106 | + <argument name="productName" value="{{SimpleProduct.name}}"/> |
| 107 | + </actionGroup> |
| 108 | + </test> |
| 109 | +</tests> |
| 110 | + |
0 commit comments