|
| 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