|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AssertSuccessMessageAppearsAfterAddingProductToCartThatContainsOutOfStockProductTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Checkout"/> |
| 13 | + <stories value="Assert success message appears after adding product to cart that contains out of stock product"/> |
| 14 | + <title value="Assert success message appears after adding product to cart that contains out of stock product"/> |
| 15 | + <description value="Assert success message appears after adding product to cart that contains out of stock product"/> |
| 16 | + <severity value="MINOR"/> |
| 17 | + <testCaseId value="AC-5613"/> |
| 18 | + </annotations> |
| 19 | + |
| 20 | + <before> |
| 21 | + <!-- Create category and simple product --> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct1"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct2"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 30 | + </before> |
| 31 | + <after> |
| 32 | + <!-- Delete category --> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + <!-- Delete bundle product data --> |
| 35 | + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct"/> |
| 36 | + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 37 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 38 | + </after> |
| 39 | + |
| 40 | + <!--Open product in storefront--> |
| 41 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct1.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront"/> |
| 42 | + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> |
| 43 | + |
| 44 | + <!-- Add simple product to the cart--> |
| 45 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> |
| 46 | + <argument name="product" value="$$createSimpleProduct1$$"/> |
| 47 | + <argument name="productCount" value="1"/> |
| 48 | + </actionGroup> |
| 49 | + |
| 50 | + <!-- Open the product in backend and update quantity as 0--> |
| 51 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
| 52 | + <argument name="productId" value="$createSimpleProduct1.id$"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="fillQtyField" /> |
| 56 | + |
| 57 | + <!--Save the product--> |
| 58 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> |
| 59 | + |
| 60 | + <!-- Open cart page and verify error message--> |
| 61 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> |
| 62 | + |
| 63 | + <see selector="{{StorefrontProductPageSection.errorMsg}}" userInput="Some of the products are out of stock." stepKey="verifyErrorMessage"/> |
| 64 | + |
| 65 | + <!--Open product in storefront--> |
| 66 | + <amOnPage url="{{StorefrontProductPage.url(createSimpleProduct2.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront2"/> |
| 67 | + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad2"/> |
| 68 | + |
| 69 | + <!-- Add Simple Product to cart and verify success message--> |
| 70 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 71 | + <argument name="product" value="$$createSimpleProduct2$$"/> |
| 72 | + </actionGroup> |
| 73 | + </test> |
| 74 | +</tests> |
0 commit comments