/
StorefrontAddGroupedProductToShoppingCartTest.xml
129 lines (119 loc) · 6.82 KB
/
StorefrontAddGroupedProductToShoppingCartTest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontAddGroupedProductToShoppingCartTest">
<annotations>
<stories value="Shopping Cart"/>
<title value="Create grouped product with three simple product and Add grouped product to the cart"/>
<description value="Create grouped product with three simple product and Add grouped product to the cart"/>
<testCaseId value="MC-14718"/>
<severity value="CRITICAL"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
<magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRateDefaultPrice"/>
<!--Create Grouped product with three simple product -->
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2">
<field key="price">100.00</field>
</createData>
<createData entity="ApiProductWithDescription" stepKey="simple2" before="simple3">
<field key="price">200.00</field>
</createData>
<createData entity="ApiProductWithDescription" stepKey="simple3" before="product">
<field key="price">300.00</field>
</createData>
<createData entity="ApiGroupedProduct" stepKey="product"/>
<createData entity="OneSimpleProductLink" stepKey="addProductOne">
<requiredEntity createDataKey="product"/>
<requiredEntity createDataKey="simple1"/>
</createData>
<updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductTwo">
<requiredEntity createDataKey="product"/>
<requiredEntity createDataKey="simple2"/>
</updateData>
<updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductThree">
<requiredEntity createDataKey="product"/>
<requiredEntity createDataKey="simple3"/>
</updateData>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
</before>
<after>
<deleteData createDataKey="simple1" stepKey="deleteProduct1"/>
<deleteData createDataKey="simple2" stepKey="deleteProduct2"/>
<deleteData createDataKey="simple3" stepKey="deleteProduct3"/>
<deleteData createDataKey="product" stepKey="deleteGroupProduct"/>
</after>
<!-- Fill Quantity and add Product to the cart -->
<actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart">
<argument name="urlKey" value="$$product.custom_attributes[url_key]$$"/>
<argument name="product1" value="$$simple1.name$$"/>
<argument name="product2" value="$$simple2.name$$"/>
<argument name="product3" value="$$simple3.name$$"/>
<argument name="qty1" value="1"/>
<argument name="qty2" value="2"/>
<argument name="qty3" value="3"/>
</actionGroup>
<!-- Select Mini Cart and select 'View And Edit Cart' -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>
<!--Assert Product1 items in cart -->
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct1ItemsInCheckOutCart">
<argument name="productName" value="$$simple1.name$$"/>
<argument name="productSku" value="$$simple1.sku$$"/>
<argument name="productPrice" value="$100.00"/>
<argument name="subtotal" value="$100.00" />
<argument name="qty" value="1"/>
</actionGroup>
<!--Assert Product2 items in cart -->
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct2ItemsInCheckOutCart">
<argument name="productName" value="$$simple2.name$$"/>
<argument name="productSku" value="$$simple2.sku$$"/>
<argument name="productPrice" value="$200.00"/>
<argument name="subtotal" value="$400.00" />
<argument name="qty" value="2"/>
</actionGroup>
<!--Assert Product3 items in cart -->
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct3ItemsInCheckOutCart">
<argument name="productName" value="$$simple3.name$$"/>
<argument name="productSku" value="$$simple3.sku$$"/>
<argument name="productPrice" value="$300.00"/>
<argument name="subtotal" value="$900.00" />
<argument name="qty" value="3"/>
</actionGroup>
<!--Assert Shopping Cart Summary-->
<actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" >
<argument name="subtotal" value="$1,400.00"/>
<argument name="shipping" value="30.00"/>
<argument name="total" value="1,430.00"/>
</actionGroup>
<!-- Assert product1 details in Mini Cart -->
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
<waitForPageLoad stepKey="waitForPageToLoad1"/>
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart">
<argument name="productName" value="$$simple3.name$$"/>
<argument name="productPrice" value="$300.00"/>
<argument name="cartSubtotal" value="$1,400.00" />
<argument name="qty" value="3"/>
</actionGroup>
<!-- Assert product2 details in Mini Cart -->
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct2MiniCart">
<argument name="productName" value="$$simple2.name$$"/>
<argument name="productPrice" value="$200.00"/>
<argument name="cartSubtotal" value="$1,400.00" />
<argument name="qty" value="2"/>
</actionGroup>
<!-- Assert product3 details in Mini Cart -->
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct1MiniCart">
<argument name="productName" value="$$simple1.name$$"/>
<argument name="productPrice" value="$100.00"/>
<argument name="cartSubtotal" value="$1,400.00" />
<argument name="qty" value="1"/>
</actionGroup>
</test>
</tests>