|
| 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="AdminCheckConfigurableProductPriceWithDisabledChildProductTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Configurable Product"/> |
| 14 | + <title value="Check Price for Configurable Product when One Child is Disabled, Others are Enabled"/> |
| 15 | + <description value="Login as admin and check the configurable product price when one child product is disabled "/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-13749"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Login as Admin --> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> |
| 23 | + <!-- Create Default Category --> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <!-- Create an attribute with three options to be used in the first child product --> |
| 26 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 27 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 28 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 29 | + </createData> |
| 30 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 31 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 32 | + </createData> |
| 33 | + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> |
| 34 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 35 | + </createData> |
| 36 | + <!-- Add the attribute just created to default attribute set --> |
| 37 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </createData> |
| 40 | + <!-- Get the first option of the attribute created --> |
| 41 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + </getData> |
| 44 | + <!-- Get the second option of the attribute created --> |
| 45 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 46 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 47 | + </getData> |
| 48 | + <!-- Get the third option of the attribute created --> |
| 49 | + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> |
| 50 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 51 | + </getData> |
| 52 | + <!-- Create Configurable product --> |
| 53 | + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> |
| 54 | + <requiredEntity createDataKey="createCategory"/> |
| 55 | + </createData> |
| 56 | + <!-- Create a simple product and give it the attribute with the first option --> |
| 57 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 58 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 59 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 60 | + <field key="price">10.00</field> |
| 61 | + </createData> |
| 62 | + <!--Create a simple product and give it the attribute with the second option --> |
| 63 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 64 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 65 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 66 | + <field key="price">20.00</field> |
| 67 | + </createData> |
| 68 | + <!--Create a simple product and give it the attribute with the Third option --> |
| 69 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> |
| 70 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 71 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 72 | + <field key="price">30.00</field> |
| 73 | + </createData> |
| 74 | + <!-- Create the configurable product --> |
| 75 | + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> |
| 76 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 77 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 78 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 79 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 80 | + <requiredEntity createDataKey="getConfigAttributeOption3"/> |
| 81 | + </createData> |
| 82 | + <!-- Add the first simple product to the configurable product --> |
| 83 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 84 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 85 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 86 | + </createData> |
| 87 | + <!-- Add the second simple product to the configurable product --> |
| 88 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 89 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 90 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 91 | + </createData> |
| 92 | + <!-- Add the third simple product to the configurable product --> |
| 93 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> |
| 94 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 95 | + <requiredEntity createDataKey="createConfigChildProduct3"/> |
| 96 | + </createData> |
| 97 | + </before> |
| 98 | + <after> |
| 99 | + <!-- Delete Created Data --> |
| 100 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 101 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 102 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> |
| 103 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> |
| 104 | + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> |
| 105 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> |
| 106 | + <actionGroup ref="logout" stepKey="logout"/> |
| 107 | + </after> |
| 108 | + <!-- Open Product in Store Front Page --> |
| 109 | + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> |
| 110 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 111 | + <!-- Verify category,Configurable product and initial price --> |
| 112 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> |
| 113 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/> |
| 114 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeInitialPriceInStoreFront"/> |
| 115 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront"/> |
| 116 | + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/> |
| 117 | + <!-- Verify First Child Product attribute option is displayed --> |
| 118 | + <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1"/> |
| 119 | + <!-- Select product Attribute option1, option2 and option3 and verify changes in the price --> |
| 120 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectOption1"/> |
| 121 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeChildProduct1PriceInStoreFront"/> |
| 122 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption2"/> |
| 123 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeChildProduct2PriceInStoreFront"/> |
| 124 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption3.label$$" stepKey="selectOption3"/> |
| 125 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct3.price$$" stepKey="seeChildProduct3PriceInStoreFront"/> |
| 126 | + <!-- Open Product Index Page and Filter First Child product --> |
| 127 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 128 | + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> |
| 129 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> |
| 130 | + <argument name="product" value="ApiSimpleOne"/> |
| 131 | + </actionGroup> |
| 132 | + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/> |
| 133 | + <waitForPageLoad stepKey="waitForProductPageToLoad"/> |
| 134 | + <!-- Disable the product --> |
| 135 | + <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> |
| 136 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> |
| 137 | + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> |
| 138 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> |
| 139 | + <!-- Open Product Store Front Page --> |
| 140 | + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/> |
| 141 | + <waitForPageLoad stepKey="waitForProductToLoad1"/> |
| 142 | + <!-- Verify category,configurable product and updated price --> |
| 143 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> |
| 144 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/> |
| 145 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeUpdatedProductPriceInStoreFront"/> |
| 146 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront1"/> |
| 147 | + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront1"/> |
| 148 | + <!-- Verify product Attribute Option1 is not displayed --> |
| 149 | + <dontSee selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="dontSeeOption1"/> |
| 150 | + <!--Select product Attribute option2 and option3 and verify changes in the price --> |
| 151 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectTheOption2"/> |
| 152 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeSecondChildProductPriceInStoreFront"/> |
| 153 | + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption3.label$$" stepKey="selectTheOption3"/> |
| 154 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct3.price$$" stepKey="seeThirdProductPriceInStoreFront"/> |
| 155 | + </test> |
| 156 | +</tests> |
0 commit comments