Skip to content

Commit d3253a1

Browse files
committed
MC-41880: Wishlist is displayed even though "Show in Sidebar" option is selected as No
1 parent 1990aec commit d3253a1

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertCustomerSidebarItemIsPresentActionGroup">
12+
<arguments>
13+
<argument name="itemName" type="string"/>
14+
</arguments>
15+
<see userInput="{{itemName}}" selector="{{StorefrontCustomerSidebarSection.sidebarTab(itemName)}}" stepKey="seeElement"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Data/WishlistData.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@
2929
<data key="min_email_text_length_limit">1</data>
3030
<data key="max_email_text_length_limit">10000</data>
3131
</entity>
32+
<entity name="WishlistEnable">
33+
<data key="path">wishlist/general/active</data>
34+
<data key="value">1</data>
35+
</entity>
36+
<entity name="WishlistDisable">
37+
<data key="path">wishlist/general/active</data>
38+
<data key="value">0</data>
39+
</entity>
40+
<entity name="WishlistShowInSidebar">
41+
<data key="path">wishlist/general/show_in_sidebar</data>
42+
<data key="value">1</data>
43+
</entity>
44+
<entity name="WishlistHideFromSidebar">
45+
<data key="path">wishlist/general/show_in_sidebar</data>
46+
<data key="value">0</data>
47+
</entity>
3248
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontSidebarWishlistSection">
12+
<element name="wishlistBlock" type="block" selector="div.sidebar.sidebar-additional > div.block.block-wishlist"/>
13+
</section>
14+
</sections>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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="StorefrontDisabledWishlistInSidebarFunctionalityTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="'Show In Sidebar' Wishlist Functionality"/>
15+
<title value="Wishlist should not be displayed in the sidebar if 'Show in Sidebar' option is set to 'No'"/>
16+
<description value="Customer should not see wishlist block in the sidebar if 'Show in Sidebar' option is set to 'No'"/>
17+
<testCaseId value="MC-42429"/>
18+
<useCaseId value="MC-41880"/>
19+
<severity value="AVERAGE"/>
20+
<group value="wishlist"/>
21+
<group value="configuration"/>
22+
</annotations>
23+
<before>
24+
<magentoCLI command="config:set {{WishlistEnable.path}} {{WishlistEnable.value}}" stepKey="enableWishlist"/>
25+
<magentoCLI command="config:set {{WishlistHideFromSidebar.path}} {{WishlistHideFromSidebar.value}}" stepKey="disableWishlistInSidebar"/>
26+
<magentoCLI command="cache:clean config full_page block_html" stepKey="cleanCache"/>
27+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
28+
<createData entity="SimpleProduct" stepKey="createProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
32+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
33+
<argument name="indices" value=""/>
34+
</actionGroup>
35+
</before>
36+
<after>
37+
<magentoCLI command="config:set {{WishlistEnable.path}} {{WishlistEnable.value}}" stepKey="enableWishlist"/>
38+
<magentoCLI command="config:set {{WishlistShowInSidebar.path}} {{WishlistShowInSidebar.value}}" stepKey="enableWishlistInSidebar"/>
39+
<magentoCLI command="cache:clean config full_page block_html" stepKey="cacheClean"/>
40+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
41+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
42+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
43+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
44+
<argument name="indices" value=""/>
45+
</actionGroup>
46+
</after>
47+
48+
<!-- Assert the Wishlist is not visible in sidebar for logged in customer -->
49+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
50+
<argument name="Customer" value="$createCustomer$"/>
51+
</actionGroup>
52+
53+
<actionGroup ref="StorefrontAssertCustomerSidebarItemIsPresentActionGroup" stepKey="assertWishlistFunctionalityIsEnabledForCustomer">
54+
<argument name="itemName" value="My Wish List"/>
55+
</actionGroup>
56+
57+
<!-- Check the category page -->
58+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPageForLoggedInCustomer"/>
59+
<waitForPageLoad stepKey="waitForCategoryPageToLoadForLoggedInCustomer"/>
60+
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnCategoryPageForLoggedInCustomer"/>
61+
62+
<!-- Check the search result page -->
63+
<actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefrontForLoggedInCustomer">
64+
<argument name="phrase" value="$createProduct.name$"/>
65+
</actionGroup>
66+
<waitForPageLoad stepKey="waitForSearchPageToLoadForLoggedInCustomer"/>
67+
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPageForLoggedInCustomer"/>
68+
69+
<!-- Assert the Wishlist is not visible in sidebar for guest customer -->
70+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
71+
72+
<!-- Check the category page -->
73+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/>
74+
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
75+
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnCategoryPage"/>
76+
77+
<!-- Check the search result page -->
78+
<actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefront">
79+
<argument name="phrase" value="$createProduct.name$"/>
80+
</actionGroup>
81+
<waitForPageLoad stepKey="waitForSearchPageToLoad"/>
82+
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPage"/>
83+
</test>
84+
</tests>

0 commit comments

Comments
 (0)