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