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 =" StorefrontDeleteConfigurableProductFromMiniShoppingCartTest" >
11
+ <annotations >
12
+ <stories value =" DeleteConfigurableProduct" />
13
+ <title value =" Storefront Delete Configurable Product From Mini Shopping Cart Test" />
14
+ <description value =" Test log in to Shopping Cart and Delete Configurable Product From Mini Shopping Cart Test" />
15
+ <testCaseId value =" MC-14681" />
16
+ <severity value =" CRITICAL" />
17
+ <group value =" Shopping Cart" />
18
+ <group value =" mtf_migrated" />
19
+ </annotations >
20
+
21
+ <before >
22
+ <actionGroup ref =" LoginAsAdmin" stepKey =" LoginAsAdmin" />
23
+ <!-- Create Default Category -->
24
+ <createData entity =" _defaultCategory" stepKey =" createCategory" />
25
+
26
+ <!-- Create an attribute with three options to be used in the first child product -->
27
+ <createData entity =" productAttributeWithTwoOptions" stepKey =" createConfigProductAttribute" />
28
+ <createData entity =" productAttributeOption1" stepKey =" createConfigProductAttributeOption1" >
29
+ <requiredEntity createDataKey =" createConfigProductAttribute" />
30
+ </createData >
31
+
32
+ <!-- Add the attribute just created to default attribute set -->
33
+ <createData entity =" AddToDefaultSet" stepKey =" createConfigAddToAttributeSet" >
34
+ <requiredEntity createDataKey =" createConfigProductAttribute" />
35
+ </createData >
36
+
37
+ <!-- Get the first option of the attribute created -->
38
+ <getData entity =" ProductAttributeOptionGetter" index =" 1" stepKey =" getConfigAttributeOption1" >
39
+ <requiredEntity createDataKey =" createConfigProductAttribute" />
40
+ </getData >
41
+
42
+ <!-- Create Configurable product -->
43
+ <createData entity =" BaseConfigurableProduct" stepKey =" createConfigProduct" >
44
+ <requiredEntity createDataKey =" createCategory" />
45
+ </createData >
46
+
47
+ <!-- Create a simple product and give it the attribute with the first option -->
48
+ <createData entity =" ApiSimpleOne" stepKey =" createConfigChildProduct1" >
49
+ <requiredEntity createDataKey =" createConfigProductAttribute" />
50
+ <requiredEntity createDataKey =" getConfigAttributeOption1" />
51
+ <field key =" price" >10.00</field >
52
+ </createData >
53
+
54
+ <!-- Create the configurable product -->
55
+ <createData entity =" ConfigurableProductThreeOptions" stepKey =" createConfigProductOption" >
56
+ <requiredEntity createDataKey =" createConfigProduct" />
57
+ <requiredEntity createDataKey =" createConfigProductAttribute" />
58
+ <requiredEntity createDataKey =" getConfigAttributeOption1" />
59
+ </createData >
60
+
61
+ <!-- Add the first simple product to the configurable product -->
62
+ <createData entity =" ConfigurableProductAddChild" stepKey =" createConfigProductAddChild1" >
63
+ <requiredEntity createDataKey =" createConfigProduct" />
64
+ <requiredEntity createDataKey =" createConfigChildProduct1" />
65
+ </createData >
66
+ <magentoCLI command =" indexer:reindex" stepKey =" reindex" />
67
+ <magentoCLI command =" cache:flush" stepKey =" flushCache" />
68
+ </before >
69
+ <after >
70
+ <deleteData createDataKey =" createConfigChildProduct1" stepKey =" deleteSimpleProduct1" />
71
+ <deleteData createDataKey =" createConfigProduct" stepKey =" deleteProduct" />
72
+ <deleteData createDataKey =" createCategory" stepKey =" deleteCategory" />
73
+ <deleteData createDataKey =" createConfigProductAttribute" stepKey =" deleteProductAttribute" />
74
+ <actionGroup ref =" logout" stepKey =" logout" />
75
+ </after >
76
+
77
+ <!-- Add Configurable Product to the cart -->
78
+ <actionGroup ref =" StorefrontAddConfigurableProductToTheCartActionGroup" stepKey =" addConfigurableProductToCart" >
79
+ <argument name =" urlKey" value =" $$createConfigProduct.custom_attributes[url_key]$$" />
80
+ <argument name =" productAttribute" value =" $$createConfigProductAttribute.default_value$$" />
81
+ <argument name =" productOption" value =" $$getConfigAttributeOption1.label$$" />
82
+ <argument name =" qty" value =" 1" />
83
+ </actionGroup >
84
+
85
+ <!-- Select Mini Cart and select 'View And Edit Cart' -->
86
+ <actionGroup ref =" assertOneProductNameInMiniCart" stepKey =" seeProductInMiniCart" >
87
+ <argument name =" productName" value =" $$createConfigProduct.name$$" />
88
+ </actionGroup >
89
+
90
+ <!-- Remove an item from the cart using minicart-->
91
+ <actionGroup ref =" removeProductFromMiniCart" stepKey =" removeProductFromMiniCart" >
92
+ <argument name =" productName" value =" $$createConfigProduct.name$$" />
93
+ </actionGroup >
94
+ <reloadPage stepKey =" reloadPage" />
95
+
96
+ <!-- Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart-->
97
+ <actionGroup ref =" assertMiniCartEmpty" stepKey =" miniCartEnpty" />
98
+ <dontSee selector =" {{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey =" verifyAssertProductAbsentInMiniShoppingCart" />
99
+ </test >
100
+ </tests >
0 commit comments