Skip to content

Commit 17076d3

Browse files
Merge branch 'ACQE-8211' into ACQE-functional-deployment-version10
2 parents 26cbb2b + 33af6dc commit 17076d3

File tree

7 files changed

+193
-0
lines changed

7 files changed

+193
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminDisableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin disables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminDisableReportConfigData.path}} {{AdminDisableReportConfigData.value}}" stepKey="setReportAsDisable"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminEnableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin enables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminEnableReportConfigData.path}} {{AdminEnableReportConfigData.value}}" stepKey="setReportAsEnable"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminMenuData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<data key="pageTitle">Dashboard</data>
2323
<data key="title">Dashboard</data>
2424
<data key="dataUiId">magento-backend-dashboard</data>
25+
<data key="message">Chart is disabled</data>
2526
</entity>
2627
<entity name="AdminMenuStores">
2728
<data key="pageTitle">Stores</data>

app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616
<data key="path">web/seo/use_rewrites</data>
1717
<data key="value">0</data>
1818
</entity>
19+
<entity name="AdminEnableReportConfigData">
20+
<data key="path">reports/options/enabled</data>
21+
<data key="value">1</data>
22+
</entity>
23+
<entity name="AdminDisableReportConfigData">
24+
<data key="path">reports/options/enabled</data>
25+
<data key="value">0</data>
26+
</entity>
1927
</entities>

app/code/Magento/Backend/Test/Mftf/Section/AdminDashboardSection.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@
1919
<element name="dashboardTotals" type="text" selector="//*[@class='dashboard-totals-label' and contains(text(), '{{columnName}}')]/../*[@class='dashboard-totals-value']" parameterized="true"/>
2020
<element name="productInBestsellers" type="text" selector="#productsOrderedGrid_table td.col-product.col-name"/>
2121
<element name="dashboardButtonReloadData" type="button" selector=".action-primary[title='Reload Data'][type='submit']"/>
22+
<element name="productTab" type="button" selector="//*[@class='data-grid-th no-link col-name']" timeout="30"/>
23+
<element name="priceTab" type="button" selector="//*[@class='data-grid-th no-link col-price']" timeout="30"/>
24+
<element name="viewsTab" type="button" selector="//*[@class='data-grid-th col-views no-link col-views']" timeout="30"/>
25+
<element name="productName" type="text" selector="//td[contains(text(), '{{columnName}}')]" parameterized="true"/>
26+
<element name="productPrice" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-price a-right ')]" parameterized="true"/>
27+
<element name="productViews" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-views col-views last')]" parameterized="true"/>
28+
<element name="mostViewProductsTab" type="button" selector="//*[contains(@class, 'ui-state-default ui-corner-top') and contains(@aria-labelledby, 'grid_tab_reviewed_products')]" timeout="30"/>
29+
<element name="dashboardChart" type="text" selector="//*[@class='dashboard-diagram-disabled' and contains(text(), '{{columnName}}')]" parameterized="true"/>
2230
</section>
2331
</sections>
32+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminVerifyProductDetailsInDashboardActionGroup">
11+
<annotations>
12+
<description>Admin asserts name, price and views details on the dashboard for most viewed products.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productName" type="string" defaultValue="$$createProduct.name$$"/>
16+
<argument name="productPrice" type="string" defaultValue=""/>
17+
<argument name="productViews" type="string" defaultValue=""/>
18+
</arguments>
19+
<waitForElementVisible selector="{{AdminDashboardSection.productTab}}" stepKey="waitForProductColumnToBeVisible"/>
20+
<waitForElementVisible selector="{{AdminDashboardSection.priceTab}}" stepKey="waitForPriceColumnToBeVisible"/>
21+
<waitForElementVisible selector="{{AdminDashboardSection.viewsTab}}" stepKey="waitForViewColumnToBeVisible"/>
22+
<waitForElementVisible selector="{{AdminDashboardSection.productName(productName)}}" stepKey="assertProductSkuInLineItem"/>
23+
<waitForText selector="{{AdminDashboardSection.productPrice(productName)}}" userInput="{{productPrice}}" stepKey="assertProductPrice"/>
24+
<waitForText selector="{{AdminDashboardSection.productViews(productName)}}" userInput="{{productViews}}" stepKey="assertProductViews"/>
25+
</actionGroup>
26+
</actionGroups>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminVerifyMostViewProductsAndDisabledChartInDashBoardTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Most viewed products widget and disabled charts on dashboard"/>
15+
<title value="Validating most Viewed products widget and disabled charts behaviour on admin dashboard"/>
16+
<description value="Verify most view products as well as disables charts behaviour on admin dashboard page"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-11007"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<!-- Precondition Step 1: Create 5 Simple Products -->
23+
<createData entity="_defaultProduct" stepKey="createProduct">
24+
<field key="price">100.00</field>
25+
</createData>
26+
<createData entity="defaultSimpleProduct" stepKey="createSimpleProduct">
27+
<field key="price">200.00</field>
28+
</createData>
29+
<createData entity="SimpleProduct" stepKey="createFirstProduct">
30+
<field key="price">300.00</field>
31+
</createData>
32+
<createData entity="SimpleProduct2" stepKey="createSecondProduct">
33+
<field key="price">400.00</field>
34+
</createData>
35+
<createData entity="SimpleProduct3" stepKey="createThirdProduct">
36+
<field key="price">500.00</field>
37+
</createData>
38+
<!-- Precondition Step 2: Create Customer -->
39+
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
40+
<!-- Precondition Step 3: Enable View Report In Configuration -->
41+
<actionGroup ref="AdminEnableViewProductReportActionGroup" stepKey="enableViewProductReport"/>
42+
</before>
43+
<after>
44+
<!-- Delete Customer and Product -->
45+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
47+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
48+
<deleteData createDataKey="createThirdProduct" stepKey="deleteThirdProduct"/>
49+
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
50+
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
51+
<!-- Disable View Report -->
52+
<actionGroup ref="AdminDisableViewProductReportActionGroup" stepKey="disableViewProductReport"/>
53+
<!-- Logout from Storefront -->
54+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
55+
<!-- Logout from Admin -->
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
57+
</after>
58+
<!--Step 1: Login To Storefront -->
59+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
60+
<argument name="Customer" value="$$createCustomer$$"/>
61+
</actionGroup>
62+
<!--Step 2: View All 5 Products -->
63+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
64+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
65+
</actionGroup>
66+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToSimpleProductPage">
67+
<argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
68+
</actionGroup>
69+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToFirstProductPage">
70+
<argument name="productUrlKey" value="$$createFirstProduct.custom_attributes[url_key]$$"/>
71+
</actionGroup>
72+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToSecondProductPage">
73+
<argument name="productUrlKey" value="$$createSecondProduct.custom_attributes[url_key]$$"/>
74+
</actionGroup>
75+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToThirdProductPage">
76+
<argument name="productUrlKey" value="$$createThirdProduct.custom_attributes[url_key]$$"/>
77+
</actionGroup>
78+
<!--Step 3: Login as Admin -->
79+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
80+
<waitForPageLoad stepKey="waitForPageLoad"/>
81+
<!--Step 4: Go To Admin Dash Board Page -->
82+
<actionGroup ref="AdminOpenDashboardPageActionGroup" stepKey="goToAdminDashboard"/>
83+
<!--Step 5: Click On Most Viewed Product -->
84+
<waitForElementClickable selector="{{AdminDashboardSection.mostViewProductsTab}}" stepKey="waitForMostViewProductsToBeClickable"/>
85+
<click selector="{{AdminDashboardSection.mostViewProductsTab}}" stepKey="clickOnMostViewProductsTab"/>
86+
<!--Step 6: Verify all 5 Product details In Most View Products Tab -->
87+
<actionGroup ref="AdminVerifyProductDetailsInDashboardActionGroup" stepKey="adminAssertProductDetails">
88+
<argument name="productName" value="$$createProduct.name$$"/>
89+
<argument name="productPrice" value="$$createProduct.price$$"/>
90+
<argument name="productViews" value="1"/>
91+
</actionGroup>
92+
<actionGroup ref="AdminVerifyProductDetailsInDashboardActionGroup" stepKey="adminAssertProductDetails1">
93+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
94+
<argument name="productPrice" value="$$createSimpleProduct.price$$"/>
95+
<argument name="productViews" value="1"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminVerifyProductDetailsInDashboardActionGroup" stepKey="adminAssertProductDetails2">
98+
<argument name="productName" value="$$createFirstProduct.name$$"/>
99+
<argument name="productPrice" value="$$createFirstProduct.price$$"/>
100+
<argument name="productViews" value="1"/>
101+
</actionGroup>
102+
<actionGroup ref="AdminVerifyProductDetailsInDashboardActionGroup" stepKey="adminAssertProductDetails3">
103+
<argument name="productName" value="$$createSecondProduct.name$$"/>
104+
<argument name="productPrice" value="$$createSecondProduct.price$$"/>
105+
<argument name="productViews" value="1"/>
106+
</actionGroup>
107+
<actionGroup ref="AdminVerifyProductDetailsInDashboardActionGroup" stepKey="adminAssertProductDetails4">
108+
<argument name="productName" value="$$createThirdProduct.name$$"/>
109+
<argument name="productPrice" value="$$createThirdProduct.price$$"/>
110+
<argument name="productViews" value="1"/>
111+
</actionGroup>
112+
<!--Step 7: Verify charts are disabled on the dashboard by default -->
113+
<waitForElementVisible selector="{{AdminDashboardSection.dashboardChart(AdminMenuDashboard.message)}}" stepKey="waitForChartsToBeVisibleAsDisabled"/>
114+
</test>
115+
</tests>

0 commit comments

Comments
 (0)