|
| 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="StoreFrontAddZeroPriceProductToCardWithFixedAmountPriceRule"> |
| 12 | + <annotations> |
| 13 | + <features value="SalesRule"/> |
| 14 | + <stories value="Zero price product added to cart while cart price rule is Fixed amount discount for whole cart"/> |
| 15 | + <title value="Add zero price product to cart when fixed amount discount for the whole cart rule is active"/> |
| 16 | + <description value="Customers should be able to add a zero price product from the storefront when the cart price rule of type Fixed amount discount for the whole cart is configured"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-1618"/> |
| 19 | + <useCaseId value="ACP2E-285"/> |
| 20 | + <group value="SalesRule"/> |
| 21 | + </annotations> |
| 22 | + |
| 23 | + <before> |
| 24 | + <!-- Create Simple Product and Category --> |
| 25 | + <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> |
| 26 | + <createData entity="SimpleProduct_zero" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createPreReqCategory"/> |
| 28 | + </createData> |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 30 | + |
| 31 | + <!-- Create cart price rule --> |
| 32 | + <actionGroup ref="AdminCreateCartPriceRuleActionGroup" stepKey="createCartPriceRule"> |
| 33 | + <argument name="ruleName" value="PriceRuleWithCondition"/> |
| 34 | + </actionGroup> |
| 35 | + </before> |
| 36 | + |
| 37 | + <after> |
| 38 | + <!-- Delete the cart price rule we made during the test --> |
| 39 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="cleanUpRule"> |
| 40 | + <argument name="ruleName" value="{{PriceRuleWithCondition.name}}"/> |
| 41 | + </actionGroup> |
| 42 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 43 | + <deleteData createDataKey="createPreReqCategory" stepKey="deleteCategory"/> |
| 44 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 45 | + </after> |
| 46 | + |
| 47 | + <!-- Go to the storefront and add the product to the cart --> |
| 48 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="gotoAndAddProductToCart"> |
| 49 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Go to the cart page and verify we see the product --> |
| 53 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> |
| 54 | + <actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertProductItemInCheckOutCart"> |
| 55 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 56 | + <argument name="productPrice" value="$$createSimpleProduct.price$$"/> |
| 57 | + <argument name="subtotal" value="$$createSimpleProduct.price$$" /> |
| 58 | + <argument name="qty" value="1"/> |
| 59 | + </actionGroup> |
| 60 | + </test> |
| 61 | +</tests> |
0 commit comments