|
| 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="AdminDeleteConfigurableChildProductsTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Configurable Product"/> |
| 14 | + <title value="Configurable Product should not be visible on storefront after child products are deleted"/> |
| 15 | + <description value="Login as admin, delete configurable child product and verify product displays out of stock in store front"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-13684"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Set Display Out Of Stock Product --> |
| 22 | + <magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0 "/> |
| 23 | + <!--Login as Admin --> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> |
| 25 | + <!--Create Default Category --> |
| 26 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 27 | + <!-- Create an attribute with two options to be used in the first child product --> |
| 28 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> |
| 29 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 30 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 31 | + </createData> |
| 32 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 33 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 34 | + </createData> |
| 35 | + <!-- Add the attribute just created to default attribute set --> |
| 36 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 37 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 38 | + </createData> |
| 39 | + <!-- Get the first option of the attribute created --> |
| 40 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 41 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 42 | + </getData> |
| 43 | + <!-- Get the second option of the attribute created --> |
| 44 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 45 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 46 | + </getData> |
| 47 | + <!-- Create Configurable product --> |
| 48 | + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> |
| 49 | + <requiredEntity createDataKey="createCategory"/> |
| 50 | + </createData> |
| 51 | + <!-- Create a simple product and give it the attribute with the first option --> |
| 52 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 53 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 54 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 55 | + </createData> |
| 56 | + <!--Create a simple product and give it the attribute with the second option --> |
| 57 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 58 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 59 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 60 | + </createData> |
| 61 | + <!-- Create the configurable product --> |
| 62 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 63 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 64 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 65 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 66 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 67 | + </createData> |
| 68 | + <!-- Add the first simple product to the configurable product --> |
| 69 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 70 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 71 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 72 | + </createData> |
| 73 | + <!-- Add the second simple product to the configurable product --> |
| 74 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 75 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 76 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 77 | + </createData> |
| 78 | + </before> |
| 79 | + <after> |
| 80 | + <!--Delete Created Data--> |
| 81 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 82 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 83 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> |
| 84 | + <actionGroup ref="logout" stepKey="logout"/> |
| 85 | + </after> |
| 86 | + <!--Open Product in Store Front Page --> |
| 87 | + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> |
| 88 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 89 | + <!--Verify Product is visible and In Stock --> |
| 90 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> |
| 91 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/> |
| 92 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/> |
| 93 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront"/> |
| 94 | + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/> |
| 95 | + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/> |
| 96 | + <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/> |
| 97 | + <!-- Delete Child products --> |
| 98 | + <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> |
| 99 | + <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> |
| 100 | + </actionGroup> |
| 101 | + <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> |
| 102 | + <argument name="sku" value="$$createConfigChildProduct2.sku$$"/> |
| 103 | + </actionGroup> |
| 104 | + <!--Verify product is not visible in category store front page --> |
| 105 | + <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> |
| 106 | + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> |
| 107 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInStoreFrontPage"/> |
| 108 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickOnCategory"/> |
| 109 | + <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProductInCategoryPage"/> |
| 110 | + <!--Open Product Store Front Page and Verify Product is Out Of Stock --> |
| 111 | + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/> |
| 112 | + <waitForPageLoad stepKey="waitForProductToLoad1"/> |
| 113 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> |
| 114 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/> |
| 115 | + <dontSee selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="dontSeeProductPriceInStoreFront"/> |
| 116 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront1"/> |
| 117 | + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="OUT OF STOCK" stepKey="seeProductStatusInStoreFront1"/> |
| 118 | + <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="dontSeeProductAttributeLabel"/> |
| 119 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="dontSeeProductAttributeOptions"/> |
| 120 | + </test> |
| 121 | +</tests> |
0 commit comments