Skip to content

Commit 95eccb3

Browse files
shashikant.kumarshashikant.kumar
authored andcommitted
MC-26846:Recently Ordered widget contains no more 5 products if qty of products > 5
1 parent 14536ae commit 95eccb3

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontWidgetsSection">
12+
<element name="RecentOrderedProductCount" type="block" selector="#cart-sidebar-reorder li"/>
1213
<element name="widgetRecentlyViewedProductsGrid" type="block" selector=".block.widget.block-viewed-products-grid"/>
1314
<element name="widgetRecentlyComparedProductsGrid" type="block" selector=".block.widget.block-compared-products-grid"/>
1415
<element name="widgetRecentlyOrderedProductsGrid" type="block" selector=".block.block-reorder"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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="StorefrontVerifyThatRecentlyOrderedWidgetShowOnlyFiveProductTest">
12+
<annotations>
13+
<stories value="Recently Ordered Product Widget"/>
14+
<title value="Recently Ordered Product widget show only 5 products"/>
15+
<description value="Recently Ordered widget contains no more 5 products if qty of products > 5"/>
16+
<testCaseId value="MC-26846"/>
17+
<severity value="MAJOR"/>
18+
</annotations>
19+
20+
<before>
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="SimpleProduct" stepKey="createProduct">
23+
<field key="price">11.00</field>
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="SimpleProduct" stepKey="createProduct2">
27+
<field key="price">12.00</field>
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
<createData entity="SimpleProduct" stepKey="createProduct3">
31+
<field key="price">13.00</field>
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
<createData entity="SimpleProduct" stepKey="createProduct4">
35+
<field key="price">14.00</field>
36+
<requiredEntity createDataKey="createCategory"/>
37+
</createData>
38+
39+
<createData entity="SimpleProduct" stepKey="createProduct5">
40+
<field key="price">15.00</field>
41+
<requiredEntity createDataKey="createCategory"/>
42+
</createData>
43+
44+
<createData entity="SimpleProduct" stepKey="createProduct6">
45+
<field key="price">16.00</field>
46+
<requiredEntity createDataKey="createCategory"/>
47+
</createData>
48+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
49+
50+
</before>
51+
52+
<after>
53+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/>
54+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
55+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
56+
<deleteData createDataKey="createProduct2" stepKey="deleteSecondSimpleProduct"/>
57+
<deleteData createDataKey="createProduct3" stepKey="deleteSimpleProduct3"/>
58+
<deleteData createDataKey="createProduct4" stepKey="deleteSimpleProduct4"/>
59+
<deleteData createDataKey="createProduct5" stepKey="deleteSimpleProduct5"/>
60+
<deleteData createDataKey="createProduct6" stepKey="deleteSimpleProduct6"/>
61+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
62+
</after>
63+
64+
<!--Login to storefront from customer-->
65+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
66+
<argument name="Customer" value="$$createCustomer$$"/>
67+
</actionGroup>
68+
<see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="checkWelcomeMessage"/>
69+
70+
<!--Open the detail page of each created product and add to cart, get to the category-->
71+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductProductToCart">
72+
<argument name="product" value="$$createProduct$$"/>
73+
</actionGroup>
74+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondSimpleProductProductToCart2">
75+
<argument name="product" value="$$createProduct2$$"/>
76+
</actionGroup>
77+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductProductToCart3">
78+
<argument name="product" value="$$createProduct3$$"/>
79+
</actionGroup>
80+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondSimpleProductProductToCart4">
81+
<argument name="product" value="$$createProduct4$$"/>
82+
</actionGroup>
83+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductProductToCart5">
84+
<argument name="product" value="$$createProduct5$$"/>
85+
</actionGroup>
86+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondSimpleProductProductToCart6">
87+
<argument name="product" value="$$createProduct6$$"/>
88+
</actionGroup>
89+
90+
<!--Place the order-->
91+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCartPage"/>
92+
<actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder">
93+
<argument name="shippingMethod" value="Flat Rate"/>
94+
</actionGroup>
95+
96+
<!-- Open My Account Page from Customer dropdown -->
97+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
98+
99+
<!-- Validate that Recent Ordered Widget contains only 5 product -->
100+
<grabMultiple selector="{{StorefrontWidgetsSection.RecentOrderedProductCount}}" stepKey="reorders" />
101+
<assertCount stepKey="check">
102+
<expectedResult type="int">5</expectedResult>
103+
<actualResult type="variable">reorders</actualResult>
104+
</assertCount>
105+
</test>
106+
</tests>

0 commit comments

Comments
 (0)