|
| 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="AdminAddInStockProductToTheCartTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Manage products"/> |
| 14 | + <title value="Add In Stock Product to Cart"/> |
| 15 | + <description value="Login as admin and add In Stock product to the cart"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-11065"/> |
| 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 Simple Product--> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!--Delete created entity --> |
| 32 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 33 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 34 | + <actionGroup ref="logout" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + <!--Open Product Index Page and filter the product--> |
| 37 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 38 | + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> |
| 39 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> |
| 40 | + <argument name="product" value="SimpleProduct"/> |
| 41 | + </actionGroup> |
| 42 | + <!-- Update product Advanced Inventory setting --> |
| 43 | + <click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> |
| 44 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 45 | + <click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/> |
| 46 | + <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> |
| 47 | + <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckConfigSetting"/> |
| 48 | + <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="Yes" stepKey="clickOnManageStock"/> |
| 49 | + <fillField selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryQty}}" userInput="5" stepKey="fillProductQty"/> |
| 50 | + <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.miniQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/> |
| 51 | + <fillField selector="{{AdminProductFormAdvancedInventorySection.miniQtyAllowedInCart}}" userInput="1" stepKey="fillMiniAllowedQty"/> |
| 52 | + <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/> |
| 53 | + <fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="10000" stepKey="fillMaxAllowedQty"/> |
| 54 | + <selectOption selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" userInput="Yes" stepKey="selectQuatityUsesDecimal"/> |
| 55 | + <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQtyConfigSetting}}" stepKey="uncheckNotifyBelowQtyheckBox"/> |
| 56 | + <fillField selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQty}}" userInput="1" stepKey="fillNotifyBelowQty"/> |
| 57 | + <selectOption selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryStockStatus}}" userInput="In Stock" stepKey="selectOutOfStock"/> |
| 58 | + <click stepKey="clickOnDoneButton" selector="{{AdminProductFormAdvancedInventorySection.doneButton}}"/> |
| 59 | + <waitForPageLoad stepKey="waitForProductPageToLoad"/> |
| 60 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> |
| 61 | + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> |
| 62 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> |
| 63 | + <!--Verify product is visible in category front page --> |
| 64 | + <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> |
| 65 | + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> |
| 66 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryInFrontPage"/> |
| 67 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> |
| 68 | + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/> |
| 69 | + <!--Verify Product In Store Front--> |
| 70 | + <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/> |
| 71 | + <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> |
| 72 | + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> |
| 73 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> |
| 74 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{SimpleProduct.sku}}" stepKey="seeProductSkuInStoreFront"/> |
| 75 | + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/> |
| 76 | + <!--Add Product to the cart--> |
| 77 | + <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1" stepKey="fillProductQuantity"/> |
| 78 | + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="clickOnAddToCartButton"/> |
| 79 | + <waitForPageLoad stepKey="waitForProductToAddInCart"/> |
| 80 | + <seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeSuccessSaveMessage"/> |
| 81 | + <seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/> |
| 82 | + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> |
| 83 | + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInMiniCart"/> |
| 84 | + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInMiniCart"/> |
| 85 | + <seeElement selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="seeCheckOutButtonInMiniCart"/> |
| 86 | + </test> |
| 87 | +</tests> |
0 commit comments