Skip to content

Commit db910a0

Browse files
Merge branch 'ACQE-8251' into ACQE-functional-deployment-v4-4
2 parents fe6e0ce + c97bee2 commit db910a0

File tree

3 files changed

+74
-4
lines changed

3 files changed

+74
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2018 Adobe
5-
* All Rights Reserved.
6-
*/
3+
/**
4+
* Copyright 2017 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
@@ -61,4 +61,7 @@
6161
<data key="path">rss/wishlist/active</data>
6262
<data key="value">1</data>
6363
</entity>
64+
<entity name="NumberOfItemsInWishlist">
65+
<data key="item">2 items</data>
66+
</entity>
6467
</entities>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@
2929
<element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/>
3030
<element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/>
3131
<element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/>
32+
<element name="wishListLink" type="text" selector="//header[@class='page-header']//li[@class='link wishlist']"/>
33+
<element name="wishListCount" type="text" selector="//header[@class='page-header']//div[@class='customer-menu']//span"/>
3234
</section>
3335
</sections>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests
10+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontVerifyTheWishlistCountDisplayedInTheHomePageCustomerMenuTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Wishlist count"/>
15+
<title value="Wishlist count in menu"/>
16+
<description value="Validate wishlist count on homepage matches actual wishlist items."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-15274"/>
19+
<group value="wishlist"/>
20+
</annotations>
21+
<before>
22+
<!-- Pre-condition 1,2: Create products, customer -->
23+
<createData entity="SimpleProduct" stepKey="createProduct"/>
24+
<createData entity="_defaultProduct" stepKey="createSimpleProduct"/>
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
</before>
27+
<after>
28+
<!-- Logout from storefront-->
29+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
30+
<!-- Delete products, customer -->
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteTheProduct"/>
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
</after>
35+
<!-- Step 1: Log in as a customer on storefront. -->
36+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
37+
<argument name="Customer" value="$createCustomer$"/>
38+
</actionGroup>
39+
<!-- Open product page -->
40+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
41+
<argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/>
42+
</actionGroup>
43+
<!-- Step 2: Add product to wishlist -->
44+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addFirstProductToWishlist">
45+
<argument name="productVar" value="$createProduct$"/>
46+
</actionGroup>
47+
<!-- Open second product page -->
48+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openTheProductPage">
49+
<argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
50+
</actionGroup>
51+
<!-- Step 2: Add second product to wishlist -->
52+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addSecondProductToWishlist">
53+
<argument name="productVar" value="$createSimpleProduct$"/>
54+
</actionGroup>
55+
<!-- Step 3: Navigate to Store front home page-->
56+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/>
57+
<!-- Step 4: Click on customer menu-->
58+
<waitForElementClickable selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" stepKey="waitToOpenCustomerDropdownMenu"/>
59+
<click selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" stepKey="openCustomerDropdownMenu"/>
60+
<waitForPageLoad stepKey="waitToLoadCustomerDropdownMenu"/>
61+
<!-- Step 4 assertion: The wishlist item count should display-->
62+
<waitForElementVisible selector="{{StorefrontCustomerWishlistProductSection.wishListLink}}" stepKey="wishListLink"/>
63+
<waitForText userInput="{{NumberOfItemsInWishlist.item}}" selector="{{StorefrontCustomerWishlistProductSection.wishListCount}}" stepKey="seeWishListCount"/>
64+
</test>
65+
</tests>

0 commit comments

Comments
 (0)