|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateConfigurableProductWithOutOfStockChildOnAdditionalStockTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Configurable Product"/> |
| 13 | + <title value="Configurable Product with 'Out of Stock' Child on Additional Stock."/> |
| 14 | + <description value="Admin create configurable product with size attribute and set out of stock of one of the simple products and assert it in storefront."/> |
| 15 | + <severity value="MAJOR"/> |
| 16 | + <testCaseId value="AC-4359"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 20 | + </before> |
| 21 | + <after> |
| 22 | + <actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock"> |
| 23 | + <argument name="stockName" value="{{_defaultStock.name}}"/> |
| 24 | + <argument name="websiteName" value="{{_defaultWebsite.name}}"/> |
| 25 | + </actionGroup> |
| 26 | + <deleteData createDataKey="stock" stepKey="deleteCustomStock"/> |
| 27 | + <!--Disable all sources.--> |
| 28 | + <actionGroup ref="DisableAllSourcesActionGroup" stepKey="deleteSource"/> |
| 29 | + <!--Delete all created product--> |
| 30 | + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts"> |
| 31 | + <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> |
| 32 | + </actionGroup> |
| 33 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/> |
| 34 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 35 | + </after> |
| 36 | + <createData entity="FullSource1" stepKey="source"/> |
| 37 | + <createData entity="BasicMsiStockWithMainWebsite1" stepKey="stock"/> |
| 38 | + <createData entity="SourceStockLinked1" stepKey="sourceStockLink"> |
| 39 | + <requiredEntity createDataKey="stock"/> |
| 40 | + <requiredEntity createDataKey="source"/> |
| 41 | + </createData> |
| 42 | + <!--Open product page and start creating configurable product--> |
| 43 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" after="saveAttribute" stepKey="openProductIndexPage"/> |
| 44 | + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> |
| 45 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 46 | + </actionGroup> |
| 47 | + <!-- Fill all the necessary information such as weight, name, SKU etc --> |
| 48 | + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> |
| 49 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="AdminCreateOptionsForAttributeMultiStockActionGroup" stepKey="generateVariations"> |
| 52 | + <argument name="attributeCode" value="{{sizeAttribute.attribute_code}}"/> |
| 53 | + <argument name="sourceCode" value="$source.source[source_code]$"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveConfigurable"> |
| 56 | + <argument name="product" value="ApiConfigurableProduct"/> |
| 57 | + </actionGroup> |
| 58 | + <!-- Go to child product S and update status as out of stock--> |
| 59 | + <actionGroup ref="AdminOpenChildVariationOfConfigurableProductActionGroup" stepKey="OpenChildVariation"/> |
| 60 | + <switchToNextTab stepKey="switchToConfigChildProductPage"/> |
| 61 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 62 | + <actionGroup ref="AdminUpdateStatusOfChildVariationOfConfigurableProductActionGroup" stepKey="updateStatusAndSave"/> |
| 63 | + <closeTab stepKey="closeConfigChildProductPage"/> |
| 64 | + <!--Reindex and clear cache--> |
| 65 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 66 | + <argument name="indices" value=""/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 69 | + <argument name="tags" value="full_page"/> |
| 70 | + </actionGroup> |
| 71 | + <!-- Go to storefront and assert the configurable product--> |
| 72 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront2"/> |
| 73 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage"> |
| 74 | + <argument name="productUrl" value="{{ApiConfigurableProduct.urlKey}}"/> |
| 75 | + </actionGroup> |
| 76 | + <waitForPageLoad stepKey="waitingForPageLoad"/> |
| 77 | + <waitForElementClickable selector="{{StorefrontConfigurableProductPage.productAttributeDropDown}}" stepKey="waitForDropDownOptionToBeSelected"/> |
| 78 | + <click selector="{{StorefrontConfigurableProductPage.productAttributeDropDown}}" stepKey="clickOnDropDown"/> |
| 79 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.dropDownOption('S')}}" stepKey="seeSSizeIsAvailable"/> |
| 80 | + </test> |
| 81 | +</tests> |
0 commit comments