|
| 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="AdminCreateCustomProductAttributeWithDropdownFieldTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Create product Attribute"/> |
| 14 | + <title value="Create Custom Product Attribute Dropdown Field (Not Required) from Product Page"/> |
| 15 | + <description value="login as admin and create configurable product attribute with Dropdown field"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-10905"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Login as admin --> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 23 | + <!--Create Category--> |
| 24 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 25 | + <!--Create Configurable Product--> |
| 26 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!--Delete created entity --> |
| 32 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 33 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 34 | + <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> |
| 35 | + <argument name="ProductAttribute" value="newProductAttribute"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="logout" stepKey="logout"/> |
| 38 | + </after> |
| 39 | + <!-- Open Product Index Page--> |
| 40 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 41 | + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> |
| 42 | + <!-- Select Created Product--> |
| 43 | + <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createConfigProduct.sku$$)}}"/> |
| 44 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 45 | + <!-- Create New Product Attribute --> |
| 46 | + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/> |
| 47 | + <waitForPageLoad stepKey="waitForAttributePageToLoad"/> |
| 48 | + <click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickCreateNewAttributeButton"/> |
| 49 | + <waitForPageLoad stepKey="waitForNewAttributePageToLoad"/> |
| 50 | + <waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.defaultLabel}}" stepKey="waitForDefaultLabelToBeVisible"/> |
| 51 | + <fillField selector="{{AdminCreateNewProductAttributeSection.defaultLabel}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillAttributeLabel"/> |
| 52 | + <selectOption selector="{{AdminCreateNewProductAttributeSection.inputType}}" userInput="Dropdown" stepKey="selectInputType"/> |
| 53 | + <waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.addValue}}" stepKey="waitForAddValueButtonToVisible"/> |
| 54 | + <click selector="{{AdminCreateNewProductAttributeSection.addValue}}" stepKey="clickOnAddValueButton"/> |
| 55 | + <waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.defaultStoreView('0')}}" stepKey="waitForDefaultStoreViewToVisible"/> |
| 56 | + <fillField selector="{{AdminCreateNewProductAttributeSection.defaultStoreView('0')}}" userInput="{{ProductAttributeOption8.label}}" stepKey="fillDefaultStoreView"/> |
| 57 | + <fillField selector="{{AdminCreateNewProductAttributeSection.adminOption('0')}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAdminField"/> |
| 58 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.defaultRadioButton('1')}}" stepKey="selectRadioButton"/> |
| 59 | + <click selector="{{AdminCreateNewProductAttributeSection.advancedAttributeProperties}}" stepKey="clickOnAdvancedAttributeProperties"/> |
| 60 | + <waitForElementVisible selector="{{AdminCreateNewProductAttributeSection.attributeCode}}" stepKey="waitForAttributeCodeToVisible"/> |
| 61 | + <scrollTo selector="{{AdminCreateNewProductAttributeSection.attributeCode}}" stepKey="scrollToAttributeCode"/> |
| 62 | + <fillField selector="{{AdminCreateNewProductAttributeSection.attributeCode}}" userInput="{{newProductAttribute.attribute_code}}" stepKey="fillAttributeCode"/> |
| 63 | + <selectOption selector="{{AdminCreateNewProductAttributeSection.scope}}" userInput="Global" stepKey="selectScope"/> |
| 64 | + <scrollTo selector="{{AdminCreateNewProductAttributeSection.isUnique}}" stepKey="scrollToIsUniqueOption"/> |
| 65 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.isUnique}}" stepKey="enableIsUniqueOption"/> |
| 66 | + <scrollTo selector="{{AdminCreateNewProductAttributeSection.advancedAttributeProperties}}" stepKey="scrollToAdvancedAttributeProperties"/> |
| 67 | + <click selector="{{AdminCreateNewProductAttributeSection.advancedAttributeProperties}}" stepKey="clickOnAdvancedAttributeProperties1"/> |
| 68 | + <scrollTo selector="{{AdminCreateNewProductAttributeSection.storefrontProperties}}" stepKey="scrollToStorefrontProperties"/> |
| 69 | + <click selector="{{AdminCreateNewProductAttributeSection.storefrontProperties}}" stepKey="clickOnStorefrontProperties"/> |
| 70 | + <waitForPageLoad stepKey="waitForStoreFrontPropertiesTodiaplay"/> |
| 71 | + <scrollTo selector="{{AdminCreateNewProductAttributeSection.sortProductListing}}" x="0" y="-80" stepKey="scroll1ToSortProductListing"/> |
| 72 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.inSearch}}" stepKey="enableInSearchOption"/> |
| 73 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.advancedSearch}}" stepKey="enableAdvancedSearch"/> |
| 74 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.isComparable}}" stepKey="enableComparableOption"/> |
| 75 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.allowHtmlTags}}" stepKey="enableAllowHtmlTags"/> |
| 76 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.visibleOnStorefront}}" stepKey="enableVisibleOnStorefront"/> |
| 77 | + <checkOption selector="{{AdminCreateNewProductAttributeSection.sortProductListing}}" stepKey="enableSortProductListing"/> |
| 78 | + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> |
| 79 | + <click selector="{{AdminCreateNewProductAttributeSection.saveAttribute}}" stepKey="clickOnSaveAttribute"/> |
| 80 | + <waitForPageLoad stepKey="waitForAttributeToSave"/> |
| 81 | + <click selector="{{AdminProductFormSection.save}}" stepKey="saveTheProduct"/> |
| 82 | + <waitForPageLoad stepKey="waitForProductToSave"/> |
| 83 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> |
| 84 | + <!--Verify product attribute added in product form --> |
| 85 | + <scrollTo selector="{{AdminProductFormSection.contentTab}}" stepKey="scrollToContentTab"/> |
| 86 | + <waitForElementVisible selector="{{AdminProductFormSection.attributeTab}}" stepKey="waitForAttributeToVisible"/> |
| 87 | + <click selector="{{AdminProductFormSection.attributeTab}}" stepKey="clickOnAttribute"/> |
| 88 | + <seeElement selector="{{AdminProductFormSection.attributeLabelByText(ProductAttributeFrontendLabel.label)}}" stepKey="seeAttributeLabelInProductForm"/> |
| 89 | + <!--Verify Product Attribute in Attribute Form --> |
| 90 | + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> |
| 91 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{newProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> |
| 92 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> |
| 93 | + <waitForPageLoad stepKey="waitForPageLoad" /> |
| 94 | + <see selector="{{AdminProductAttributeGridSection.attributeCodeColumn}}" userInput="{{newProductAttribute.attribute_code}}" stepKey="seeAttributeCode"/> |
| 95 | + <see selector="{{AdminProductAttributeGridSection.defaultLabelColumn}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="seeDefaultLabel"/> |
| 96 | + <see selector="{{AdminProductAttributeGridSection.isVisibleColumn}}" userInput="Yes" stepKey="seeIsVisibleColumn"/> |
| 97 | + <see selector="{{AdminProductAttributeGridSection.scopeColumn}}" userInput="Global" stepKey="seeScopeColumn"/> |
| 98 | + <see selector="{{AdminProductAttributeGridSection.isSearchableColumn}}" userInput="Yes" stepKey="seeSearchableColumn"/> |
| 99 | + <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> |
| 100 | + <!--Verify Product Attribute is present in Category Store Front Page --> |
| 101 | + <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage"/> |
| 102 | + <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> |
| 103 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> |
| 104 | + <waitForPageLoad stepKey="waitForPageToLoad"/> |
| 105 | + <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> |
| 106 | + <waitForPageLoad stepKey="waitForProductToLoad1"/> |
| 107 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ApiConfigurableProduct.name}}" stepKey="seeProductNameInStoreFront"/> |
| 108 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{ApiConfigurableProduct.price}}" stepKey="seeProductPriceInStoreFront"/> |
| 109 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ApiConfigurableProduct.sku}}" stepKey="seeProductSkuInStoreFront"/> |
| 110 | + <scrollTo selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="scrollToMoreInformation"/> |
| 111 | + <see selector="{{StorefrontProductMoreInformationSection.attributeLabel}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="seeAttributeLabel"/> |
| 112 | + <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> |
| 113 | + <!--Verify Product Attribute present in search page --> |
| 114 | + <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> |
| 115 | + <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> |
| 116 | + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/> |
| 117 | + <waitForPageLoad stepKey="waitForSearchTextBox"/> |
| 118 | + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> |
| 119 | + <waitForPageLoad stepKey="waitForSearchResultToLoad"/> |
| 120 | + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ApiConfigurableProduct.name}}" stepKey="seeProductNameInCategoryPage"/> |
| 121 | + <see selector="{{StorefrontCategoryMainSection.productOptionList}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="seeProductAttributeOptionInCategoryPage"/> |
| 122 | + </test> |
| 123 | +</tests> |
0 commit comments