Skip to content

Commit 4b89a3e

Browse files
committed
MC-41880: Wishlist is displayed even though "Show in Sidebar" option is selected as No
1 parent 6062477 commit 4b89a3e

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
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="StorefrontAssertWishlistBlockIsNotVisibleOnSidebarActionGroup">
12+
<!-- Assert sidebar itself is present on the page -->
13+
<seeElementInDOM selector="{{StorefrontCategoryMainSection.sidebarAdditional}}" stepKey="assertSidebarIsVisible"/>
14+
<!-- Assert wishlist block is not present in the sidebar -->
15+
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnSidebar"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDisabledWishlistInSidebarFunctionalityTest.xml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<group value="configuration"/>
2222
</annotations>
2323
<before>
24-
<magentoCLI command="config:set {{WishlistEnable.path}} {{WishlistEnable.value}}" stepKey="enableWishlist"/>
2524
<magentoCLI command="config:set {{WishlistHideFromSidebar.path}} {{WishlistHideFromSidebar.value}}" stepKey="disableWishlistInSidebar"/>
2625
<magentoCLI command="cache:clean config full_page block_html" stepKey="cleanCache"/>
2726
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
@@ -34,9 +33,8 @@
3433
</actionGroup>
3534
</before>
3635
<after>
37-
<magentoCLI command="config:set {{WishlistEnable.path}} {{WishlistEnable.value}}" stepKey="enableWishlist"/>
3836
<magentoCLI command="config:set {{WishlistShowInSidebar.path}} {{WishlistShowInSidebar.value}}" stepKey="enableWishlistInSidebar"/>
39-
<magentoCLI command="cache:clean config full_page block_html" stepKey="cacheClean"/>
37+
<magentoCLI command="cache:clean config full_page block_html" stepKey="cleanCache"/>
4038
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4139
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
4240
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
@@ -55,30 +53,30 @@
5553
</actionGroup>
5654

5755
<!-- Check the category page -->
58-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPageForLoggedInCustomer"/>
56+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPageAsLoggedInCustomer"/>
5957
<waitForPageLoad stepKey="waitForCategoryPageToLoadForLoggedInCustomer"/>
60-
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnCategoryPageForLoggedInCustomer"/>
58+
<actionGroup ref="StorefrontAssertWishlistBlockIsNotVisibleOnSidebarActionGroup" stepKey="assertWishlistBlockIsNotVisibleOnCategoryPageForLoggedInCustomer"/>
6159

6260
<!-- Check the search result page -->
6361
<actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefrontForLoggedInCustomer">
6462
<argument name="phrase" value="$createProduct.name$"/>
6563
</actionGroup>
6664
<waitForPageLoad stepKey="waitForSearchPageToLoadForLoggedInCustomer"/>
67-
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPageForLoggedInCustomer"/>
65+
<actionGroup ref="StorefrontAssertWishlistBlockIsNotVisibleOnSidebarActionGroup" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPageForLoggedInCustomer"/>
6866

6967
<!-- Assert the Wishlist is not visible in sidebar for guest customer -->
7068
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
7169

7270
<!-- 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"/>
71+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPageAsGuest"/>
72+
<waitForPageLoad stepKey="waitForCategoryPageToLoadForGuest"/>
73+
<actionGroup ref="StorefrontAssertWishlistBlockIsNotVisibleOnSidebarActionGroup" stepKey="assertWishlistBlockIsNotVisibleOnCategoryPageForGuest"/>
7674

7775
<!-- Check the search result page -->
78-
<actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefront">
76+
<actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="searchProductOnStorefrontForGuest">
7977
<argument name="phrase" value="$createProduct.name$"/>
8078
</actionGroup>
81-
<waitForPageLoad stepKey="waitForSearchPageToLoad"/>
82-
<dontSeeElementInDOM selector="{{StorefrontSidebarWishlistSection.wishlistBlock}}" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPage"/>
79+
<waitForPageLoad stepKey="waitForSearchPageToLoadForGuest"/>
80+
<actionGroup ref="StorefrontAssertWishlistBlockIsNotVisibleOnSidebarActionGroup" stepKey="assertWishlistBlockIsNotVisibleOnSearchResultPageForGuest"/>
8381
</test>
8482
</tests>

0 commit comments

Comments
 (0)