|
8 | 8 |
|
9 | 9 | <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
10 | 10 | xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
11 |
| - <test name="AdminCreatedFixedAmountWholeCartDiscountWithZeroPriceProductTest"> |
| 11 | + <test name="StoreFrontAddZeroPriceProductToCardWithFixedAmountPriceRule"> |
12 | 12 | <annotations>
|
13 | 13 | <features value="SalesRule"/>
|
14 | 14 | <stories value="Zero price product added to cart while cart price rule is Fixed amount discount for whole cart"/>
|
15 |
| - <title value="Admin should be able to create a cart price rule of type Fixed amount discount for whole cart and add to cart when cart total is zero"/> |
16 |
| - <description value="Admin should be able to create a cart price rule of type Fixed amount discount for whole cart and add to cart when cart total is zero"/> |
| 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 | 17 | <severity value="MAJOR"/>
|
18 | 18 | <testCaseId value="AC-1618"/>
|
19 | 19 | <useCaseId value="ACP2E-285"/>
|
20 | 20 | <group value="SalesRule"/>
|
21 |
| - </annotations> |
| 21 | + </annotations> |
22 | 22 |
|
23 | 23 | <before>
|
| 24 | + <!--Create Simple Product and Category --> |
24 | 25 | <createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
|
| 26 | + <createData entity="SimpleProduct_zero" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createPreReqCategory"/> |
| 28 | + </createData> |
25 | 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> |
26 | 35 | </before>
|
27 | 36 |
|
28 | 37 | <after>
|
29 | 38 | <!-- Delete the cart price rule we made during the test -->
|
30 | 39 | <actionGroup ref="DeleteCartPriceRuleByName" stepKey="cleanUpRule">
|
31 |
| - <argument name="ruleName" value="{{SimpleSalesRule.name}}"/> |
| 40 | + <argument name="ruleName" value="{{PriceRuleWithCondition.name}}"/> |
32 | 41 | </actionGroup>
|
33 |
| - <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> |
34 |
| - <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> |
35 |
| - <argument name="sku" value="{{_defaultProduct.sku}}"/> |
36 |
| - </actionGroup> |
37 |
| - <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> |
| 42 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 43 | + <deleteData createDataKey="createPreReqCategory" stepKey="deleteCategory"/> |
38 | 44 | <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
|
39 | 45 | </after>
|
40 | 46 |
|
41 |
| - <!-- Create a cart price rule for Fixed amount discount for whole cart --> |
42 |
| - <actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="amOnCartPriceList"/> |
43 |
| - <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> |
44 |
| - <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> |
45 |
| - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> |
46 |
| - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> |
47 |
| - <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="No Coupon" stepKey="selectCoupon"/> |
48 |
| - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> |
49 |
| - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionType"/> |
50 |
| - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="50" stepKey="fillDiscountAmount"/> |
51 |
| - <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> |
52 |
| - <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> |
53 |
| - |
54 |
| - <!-- Create a product to check the storefront --> |
55 |
| - <actionGroup ref="FillAdminSimpleProductFormWithZeroPriceActionGroup" stepKey="fillProductFieldsInAdmin"> |
56 |
| - <argument name="simpleProduct" value="_defaultProduct"/> |
| 47 | + <!-- Go to the storefront and add the product to the cart --> |
| 48 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="gotoAndAddProductToCart"> |
| 49 | + <argument name="product" value="$$createSimpleProduct$$"/> |
57 | 50 | </actionGroup>
|
58 | 51 |
|
59 |
| - <!-- Spot check the storefront --> |
60 |
| - <actionGroup ref="VerifyProductInCartActionGroup" stepKey="verifyStorefront"> |
61 |
| - <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> |
62 |
| - <argument name="quantity" value="1"/> |
63 |
| - <argument name="productName" value="{{_defaultProduct.name}}"/> |
| 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="productSku" value="$$createSimpleProduct.sku$$"/> |
| 57 | + <argument name="productPrice" value="$$createSimpleProduct.price$$"/> |
| 58 | + <argument name="subtotal" value="$$createSimpleProduct.price$$" /> |
| 59 | + <argument name="qty" value="1"/> |
64 | 60 | </actionGroup>
|
65 | 61 | </test>
|
66 | 62 | </tests>
|
0 commit comments