|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest"> |
| 11 | + <annotations> |
| 12 | + <features value="SalesRule"/> |
| 13 | + <stories value="Create cart price rule"/> |
| 14 | + <title value="Category rules should apply to grouped product with invisible individual products"/> |
| 15 | + <description value="Category rules should apply to grouped product with invisible individual products"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-13608"/> |
| 18 | + <group value="SalesRule"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="ApiCategory" stepKey="createCategoryOne"/> |
| 22 | + <createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct"> |
| 23 | + <field key ="price">100</field> |
| 24 | + <field key="visibility">1</field> |
| 25 | + <requiredEntity createDataKey="createCategoryOne"/> |
| 26 | + </createData> |
| 27 | + <createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct"> |
| 28 | + <field key ="price">200</field> |
| 29 | + <field key="visibility">1</field> |
| 30 | + <requiredEntity createDataKey="createCategoryOne"/> |
| 31 | + </createData> |
| 32 | + <createData entity="ApiCategory" stepKey="createCategoryTwo"/> |
| 33 | + <createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct"> |
| 34 | + <field key ="price">300</field> |
| 35 | + <field key="visibility">1</field> |
| 36 | + <requiredEntity createDataKey="createCategoryTwo"/> |
| 37 | + </createData> |
| 38 | + <createData entity="ApiSimpleProduct" stepKey="createFourthSimpleProduct"> |
| 39 | + <field key ="price">400</field> |
| 40 | + <field key="visibility">1</field> |
| 41 | + <requiredEntity createDataKey="createCategoryTwo"/> |
| 42 | + </createData> |
| 43 | + <createData entity="ApiGroupedProduct2" stepKey="createGroupedProduct"> |
| 44 | + <requiredEntity createDataKey="createCategoryOne"/> |
| 45 | + </createData> |
| 46 | + <createData entity="OneSimpleProductLink" stepKey="addFirstProduct"> |
| 47 | + <requiredEntity createDataKey="createGroupedProduct"/> |
| 48 | + <requiredEntity createDataKey="createFirstSimpleProduct"/> |
| 49 | + </createData> |
| 50 | + <updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProduct" stepKey="addSecondProduct"> |
| 51 | + <requiredEntity createDataKey="createGroupedProduct"/> |
| 52 | + <requiredEntity createDataKey="createSecondSimpleProduct"/> |
| 53 | + </updateData> |
| 54 | + <createData entity="ApiGroupedProduct2" stepKey="createSecondGroupedProduct"> |
| 55 | + <requiredEntity createDataKey="createCategoryTwo"/> |
| 56 | + </createData> |
| 57 | + <createData entity="OneSimpleProductLink" stepKey="addThirdProduct"> |
| 58 | + <requiredEntity createDataKey="createSecondGroupedProduct"/> |
| 59 | + <requiredEntity createDataKey="createThirdSimpleProduct"/> |
| 60 | + </createData> |
| 61 | + <updateData entity="OneMoreSimpleProductLink" createDataKey="addThirdProduct" stepKey="addFourthProduct"> |
| 62 | + <requiredEntity createDataKey="createSecondGroupedProduct"/> |
| 63 | + <requiredEntity createDataKey="createFourthSimpleProduct"/> |
| 64 | + </updateData> |
| 65 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 66 | + </before> |
| 67 | + <after> |
| 68 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 69 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 70 | + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
| 71 | + <deleteData createDataKey="createFourthSimpleProduct" stepKey="deleteFourthSimpleProduct"/> |
| 72 | + <deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/> |
| 73 | + <deleteData createDataKey="createSecondGroupedProduct" stepKey="deleteSecondGroupedProduct"/> |
| 74 | + <deleteData createDataKey="createCategoryOne" stepKey="deleteCategoryOne"/> |
| 75 | + <deleteData createDataKey="createCategoryTwo" stepKey="deleteCategoryTwo"/> |
| 76 | + <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> |
| 77 | + <argument name="ruleName" value="TestSalesRule"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> |
| 80 | + <actionGroup ref="logout" stepKey="logout"/> |
| 81 | + </after> |
| 82 | + <!-- Start to create new cart price rule via Category conditions --> |
| 83 | + <actionGroup ref="AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup" stepKey="createCartPriceRuleWithCondition"> |
| 84 | + <argument name="ruleName" value="TestSalesRule"/> |
| 85 | + <argument name="actionValue" value="$createCategoryTwo.id$"/> |
| 86 | + </actionGroup> |
| 87 | + <!-- Add SecondGroupedProduct to the cart --> |
| 88 | + <actionGroup ref="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" stepKey="addSecondGroupedProductToCart"> |
| 89 | + <argument name="product" value="$createSecondGroupedProduct$"/> |
| 90 | + <argument name="linkedProduct1Name" value="$createThirdSimpleProduct.name$"/> |
| 91 | + <argument name="linkedProduct2Name" value="$createFourthSimpleProduct.name$"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithSecondGroupedProduct"/> |
| 94 | + <!-- Discount amount is not applied --> |
| 95 | + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="checkDiscountIsNotApplied"> |
| 96 | + <argument name="subtotal" value="$700.00"/> |
| 97 | + <argument name="shipping" value="$10.00"/> |
| 98 | + <argument name="total" value="$710.00"/> |
| 99 | + </actionGroup> |
| 100 | + <!-- Discount is absent in cart subtotal --> |
| 101 | + <dontSeeElement selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="discountIsNotApplied"/> |
| 102 | + <!-- Add FirstGroupedProduct to the cart --> |
| 103 | + <actionGroup ref="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" stepKey="addFirsGroupedProductToCart"> |
| 104 | + <argument name="product" value="$createGroupedProduct$"/> |
| 105 | + <argument name="linkedProduct1Name" value="$createFirstSimpleProduct.name$"/> |
| 106 | + <argument name="linkedProduct2Name" value="$createSecondSimpleProduct.name$"/> |
| 107 | + </actionGroup> |
| 108 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithFirstAndSecondGroupedProducts"/> |
| 109 | + <!-- Discount amount is applied for product from first category only --> |
| 110 | + <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsApplied"> |
| 111 | + <argument name="subtotal" value="$1,000.00"/> |
| 112 | + <argument name="shipping" value="$20.00"/> |
| 113 | + <argument name="discount" value="150.00"/> |
| 114 | + <argument name="total" value="$870.00"/> |
| 115 | + </actionGroup> |
| 116 | + </test> |
| 117 | +</tests> |
0 commit comments