Skip to content

Commit 9765c08

Browse files
committed
Convert DeleteProductsFromWishlistOnFrontendTest to MFTF
1 parent 484cc98 commit 9765c08

File tree

5 files changed

+335
-0
lines changed

5 files changed

+335
-0
lines changed

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<element name="productSuccessShareMessage" type="text" selector="div.message-success"/>
2525
<element name="pager" type="block" selector=".toolbar .pager"/>
2626
<element name="wishlistEmpty" type="block" selector=".form-wishlist-items .message.info.empty"/>
27+
<element name="removeProduct" type="button" selector=".products-grid a.btn-remove" timeout="30"/>
2728
</section>
2829
</sections>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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="StorefrontDeleteBundleDynamicProductFromWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Delete Dynamic Bundle Product from Wishlist on Frontend"/>
15+
<description value="Delete Dynamic Bundle Product from Wishlist on Frontend"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-28874"/>
18+
<group value="wishlist"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
26+
<field key="price">100.00</field>
27+
</createData>
28+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
29+
<field key="price">100.00</field>
30+
</createData>
31+
<!--Create Bundle product-->
32+
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct">
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
36+
<requiredEntity createDataKey="createBundleProduct"/>
37+
<field key="required">True</field>
38+
</createData>
39+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
40+
<requiredEntity createDataKey="createBundleProduct"/>
41+
<requiredEntity createDataKey="createBundleOption1_1"/>
42+
<requiredEntity createDataKey="simpleProduct1"/>
43+
</createData>
44+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
45+
<requiredEntity createDataKey="createBundleProduct"/>
46+
<requiredEntity createDataKey="createBundleOption1_1"/>
47+
<requiredEntity createDataKey="simpleProduct2"/>
48+
</createData>
49+
50+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
51+
<actionGroup ref="goToProductPageViaID" stepKey="goToProduct">
52+
<argument name="productId" value="$$createBundleProduct.id$$"/>
53+
</actionGroup>
54+
<scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/>
55+
<selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/>
56+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
57+
</before>
58+
<after>
59+
<!-- Delete data -->
60+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
61+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
62+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
63+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
64+
<deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/>
65+
<actionGroup ref="logout" stepKey="logout"/>
66+
</after>
67+
68+
<!-- Login as a customer -->
69+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
70+
<argument name="Customer" value="$$createCustomer$$"/>
71+
</actionGroup>
72+
73+
<!-- Navigate to catalog page -->
74+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
75+
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
76+
</actionGroup>
77+
78+
<!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message -->
79+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist">
80+
<argument name="productVar" value="$$createBundleProduct$$"/>
81+
</actionGroup>
82+
83+
<!-- Navigate to My Account > My Wishlist -->
84+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/>
85+
<waitForPageLoad stepKey="waitForWishlistPageLoad"/>
86+
87+
<!-- Click "Remove item". -->
88+
<scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="scrollToProduct"/>
89+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="mouseOverOnProduct"/>
90+
<click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/>
91+
92+
<!-- Assert Wishlist is empty -->
93+
<actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/>
94+
</test>
95+
</tests>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="StorefrontDeleteBundleFixedProductFromWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Delete Fixed Bundle Product from Wishlist on Frontend"/>
15+
<description value="Delete Fixed Bundle Product from Wishlist on Frontend"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-28874"/>
18+
<group value="wishlist"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
26+
<field key="price">100.00</field>
27+
</createData>
28+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
29+
<field key="price">100.00</field>
30+
</createData>
31+
<!-- Create bundle product -->
32+
<createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"/>
33+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
34+
<requiredEntity createDataKey="createBundleProduct"/>
35+
</createData>
36+
<createData entity="ApiBundleLink" stepKey="createBundleLink">
37+
<field key="price_type">0</field>
38+
<requiredEntity createDataKey="createBundleProduct"/>
39+
<requiredEntity createDataKey="createBundleOption1_1"/>
40+
<requiredEntity createDataKey="simpleProduct1"/>
41+
</createData>
42+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
43+
<field key="price_type">0</field>
44+
<requiredEntity createDataKey="createBundleProduct"/>
45+
<requiredEntity createDataKey="createBundleOption1_1"/>
46+
<requiredEntity createDataKey="simpleProduct2"/>
47+
</createData>
48+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
49+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
50+
</before>
51+
<after>
52+
<!-- Delete data -->
53+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
54+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
55+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
56+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
57+
<actionGroup ref="logout" stepKey="logout"/>
58+
</after>
59+
60+
<!-- Login as a customer -->
61+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
62+
<argument name="Customer" value="$$createCustomer$$"/>
63+
</actionGroup>
64+
65+
<!-- Navigate to catalog page -->
66+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
67+
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
68+
</actionGroup>
69+
70+
<!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message -->
71+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist">
72+
<argument name="productVar" value="$$createBundleProduct$$"/>
73+
</actionGroup>
74+
75+
<!-- Navigate to My Account > My Wishlist -->
76+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/>
77+
<waitForPageLoad stepKey="waitForWishlistPageLoad"/>
78+
79+
<!-- Click "Remove item". -->
80+
<scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="scrollToProduct"/>
81+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="mouseOverOnProduct"/>
82+
<click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/>
83+
84+
<!-- Assert Wishlist is empty -->
85+
<actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/>
86+
</test>
87+
</tests>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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="StorefrontAddConfigurableProductWithoutConfigureToWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Delete Configurable Product from Wishlist on Frontend"/>
15+
<description value="Delete Configurable Product from Wishlist on Frontend"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-28874"/>
18+
<group value="wishlist"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
26+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
27+
<requiredEntity createDataKey="createConfigProductAttribute"/>
28+
</createData>
29+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
30+
<requiredEntity createDataKey="createConfigProductAttribute"/>
31+
</createData>
32+
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
33+
<requiredEntity createDataKey="createConfigProductAttribute"/>
34+
</createData>
35+
36+
<!-- Add the attribute just created to default attribute set -->
37+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
41+
<!-- Get the first option of the attribute created -->
42+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
43+
<requiredEntity createDataKey="createConfigProductAttribute"/>
44+
</getData>
45+
46+
<!-- Get the second option of the attribute created -->
47+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
48+
<requiredEntity createDataKey="createConfigProductAttribute"/>
49+
</getData>
50+
51+
<!-- Get the third option of the attribute created -->
52+
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
53+
<requiredEntity createDataKey="createConfigProductAttribute"/>
54+
</getData>
55+
56+
<!-- Create Configurable product -->
57+
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
58+
<requiredEntity createDataKey="createCategory"/>
59+
</createData>
60+
61+
<!-- Create a simple product and give it the attribute with the first option -->
62+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
63+
<requiredEntity createDataKey="createConfigProductAttribute"/>
64+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
65+
<field key="price">10.00</field>
66+
</createData>
67+
68+
<!--Create a simple product and give it the attribute with the second option -->
69+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
70+
<requiredEntity createDataKey="createConfigProductAttribute"/>
71+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
72+
<field key="price">20.00</field>
73+
</createData>
74+
75+
<!--Create a simple product and give it the attribute with the Third option -->
76+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
77+
<requiredEntity createDataKey="createConfigProductAttribute"/>
78+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
79+
<field key="price">30.00</field>
80+
</createData>
81+
82+
<!-- Create the configurable product -->
83+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
84+
<requiredEntity createDataKey="createConfigProduct"/>
85+
<requiredEntity createDataKey="createConfigProductAttribute"/>
86+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
87+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
88+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
89+
</createData>
90+
91+
<!-- Add the first simple product to the configurable product -->
92+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
93+
<requiredEntity createDataKey="createConfigProduct"/>
94+
<requiredEntity createDataKey="createConfigChildProduct1"/>
95+
</createData>
96+
97+
<!-- Add the second simple product to the configurable product -->
98+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
99+
<requiredEntity createDataKey="createConfigProduct"/>
100+
<requiredEntity createDataKey="createConfigChildProduct2"/>
101+
</createData>
102+
103+
<!-- Add the third simple product to the configurable product -->
104+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
105+
<requiredEntity createDataKey="createConfigProduct"/>
106+
<requiredEntity createDataKey="createConfigChildProduct3"/>
107+
</createData>
108+
</before>
109+
<after>
110+
<!-- Delete data -->
111+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
112+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/>
113+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/>
114+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/>
115+
<deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/>
116+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
117+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
118+
<actionGroup ref="logout" stepKey="logout"/>
119+
</after>
120+
121+
<!-- 1. Login as a customer -->
122+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
123+
<argument name="Customer" value="$$createCustomer$$"/>
124+
</actionGroup>
125+
126+
<!-- 2. Navigate to catalog page -->
127+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openProductFromCategory">
128+
<argument name="category" value="$$createCategory$$"/>
129+
</actionGroup>
130+
131+
<!-- 3. Add created product to Wishlist according to dataset and assert add product to wishlist success message -->
132+
<actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addProductToWishlist">
133+
<argument name="productVar" value="$$createConfigProduct$$"/>
134+
</actionGroup>
135+
136+
137+
<!-- Navigate to My Account > My Wishlist -->
138+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/>
139+
<waitForPageLoad stepKey="waitForWishlistPageLoad"/>
140+
141+
<!-- Click "Remove item". -->
142+
<scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="scrollToProduct"/>
143+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="mouseOverOnProduct"/>
144+
<click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/>
145+
146+
<!-- Assert Wishlist is empty -->
147+
<actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/>
148+
</test>
149+
</tests>

dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductsFromWishlistOnFrontendTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,23 @@
3939
<constraint name="Magento\Wishlist\Test\Constraint\AssertWishlistIsEmpty" />
4040
</variation>
4141
<variation name="DeleteProductsFromWishlistOnFrontendTestVariation4">
42+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
4243
<data name="products/0" xsi:type="string">bundleProduct::bundle_dynamic_product</data>
4344
<data name="removedProductsIndex" xsi:type="array">
4445
<item name="0" xsi:type="string">1</item>
4546
</data>
4647
<constraint name="Magento\Wishlist\Test\Constraint\AssertWishlistIsEmpty" />
4748
</variation>
4849
<variation name="DeleteProductsFromWishlistOnFrontendTestVariation5">
50+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
4951
<data name="products/0" xsi:type="string">bundleProduct::bundle_fixed_product</data>
5052
<data name="removedProductsIndex" xsi:type="array">
5153
<item name="0" xsi:type="string">1</item>
5254
</data>
5355
<constraint name="Magento\Wishlist\Test\Constraint\AssertWishlistIsEmpty" />
5456
</variation>
5557
<variation name="DeleteProductsFromWishlistOnFrontendTestVariation6">
58+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
5659
<data name="products/0" xsi:type="string">configurableProduct::default</data>
5760
<data name="removedProductsIndex" xsi:type="array">
5861
<item name="0" xsi:type="string">1</item>

0 commit comments

Comments
 (0)