From 3d3c9d38786b3b78df6ab3013a7b8ac086026ff8 Mon Sep 17 00:00:00 2001 From: shashwata Halder Date: Tue, 19 Nov 2024 13:28:09 +0600 Subject: [PATCH] Add E2E tests for shortcode, commission, geolocation (#2441) * Add dokan tracking tests * Add commission meta box test * Update feature map * Update config file * Update feature map * Add vendor filters test * Add a shortcode test * Fix commission tests * Add geolocation tests --- tests/pw/api.config.ts | 2 +- tests/pw/e2e.config.ts | 2 +- tests/pw/feature-map/feature-map.yml | 102 +++++++++++--------- tests/pw/pages/adminPage.ts | 8 +- tests/pw/pages/basePage.ts | 10 +- tests/pw/pages/commissionPage.ts | 29 ++++-- tests/pw/pages/geolocationPage.ts | 100 +++++++++++++++++++ tests/pw/pages/noticeAndPromotionPage.ts | 23 +++++ tests/pw/pages/selectors.ts | 20 +++- tests/pw/pages/shortcodePage.ts | 15 +++ tests/pw/pages/singleProductPage.ts | 2 +- tests/pw/pages/storesPage.ts | 19 ++++ tests/pw/playwright.config.ts | 2 +- tests/pw/tests/e2e/commission.spec.ts | 8 +- tests/pw/tests/e2e/diagnosticnotice.spec.ts | 35 +++++++ tests/pw/tests/e2e/geolocation.spec.ts | 49 ++++++++++ tests/pw/tests/e2e/plugin.spec.ts | 18 ++-- tests/pw/tests/e2e/shortcodes.spec.ts | 7 ++ tests/pw/tests/e2e/stores.spec.ts | 20 +++- tests/pw/tests/e2e/vendorAuction.spec.ts | 5 +- tests/pw/utils/apiUtils.ts | 6 ++ tests/pw/utils/dbData.ts | 8 +- tests/pw/utils/dbUtils.ts | 7 ++ tests/pw/utils/interfaces.ts | 5 + tests/pw/utils/payloads.ts | 7 ++ tests/pw/utils/testData.ts | 22 ++++- 26 files changed, 443 insertions(+), 88 deletions(-) create mode 100644 tests/pw/pages/geolocationPage.ts create mode 100644 tests/pw/tests/e2e/diagnosticnotice.spec.ts create mode 100644 tests/pw/tests/e2e/geolocation.spec.ts diff --git a/tests/pw/api.config.ts b/tests/pw/api.config.ts index a19002a59a..dfe66d7cc5 100644 --- a/tests/pw/api.config.ts +++ b/tests/pw/api.config.ts @@ -5,7 +5,7 @@ const { CI, BASE_URL, NO_SETUP, ADMIN, ADMIN_PASSWORD, DOKAN_PRO } = process.env export default defineConfig({ /* test directory */ - testDir: './tests/api', + testDir: 'tests/api', /* Include tests based on the pattern */ grep: [/@lite/, /@pro/], /* Exclude tests based on the pattern */ diff --git a/tests/pw/e2e.config.ts b/tests/pw/e2e.config.ts index 3ebdb93714..8a70dbc577 100644 --- a/tests/pw/e2e.config.ts +++ b/tests/pw/e2e.config.ts @@ -5,7 +5,7 @@ const { CI, NON_HEADLESS, BASE_URL, SLOWMO, NO_SETUP, DOKAN_PRO } = process.env; export default defineConfig({ /* test directory */ - testDir: './tests/e2e', + testDir: 'tests/e2e', /* Include tests based on the pattern */ grep: [/@lite/, /@liteOnly/, /@pro/], /* Exclude tests based on the pattern */ diff --git a/tests/pw/feature-map/feature-map.yml b/tests/pw/feature-map/feature-map.yml index 32eaf05a65..8ab3067c01 100644 --- a/tests/pw/feature-map/feature-map.yml +++ b/tests/pw/feature-map/feature-map.yml @@ -2,15 +2,15 @@ features: admin: admin can install Dokan plugin [lite]: false - admin can activate Dokan plugin [lite]: false - admin can deactivate Dokan plugin [lite]: false - admin can deactivate Dokan plugin with deactivate reason [lite]: false - admin can delete Dokan plugin [lite]: false + admin can activate Dokan plugin [lite]: true + admin can deactivate Dokan plugin [lite]: true + admin can deactivate Dokan plugin with deactivate reason [lite]: true + admin can delete Dokan plugin [lite]: true admin can install Dokan pro plugin: false - admin can activate Dokan pro plugin: false - admin can deactivate Dokan pro plugin: false - admin can deactivate Dokan pro plugin with deactivate reason: false - admin can delete Dokan pro plugin: false + admin can activate Dokan pro plugin: true + admin can deactivate Dokan pro plugin: true + admin can deactivate Dokan pro plugin with deactivate reason: true + admin can delete Dokan pro plugin: true - page: 'Tax' features: @@ -314,12 +314,12 @@ customer can view stores on map: true customer can go to single store from store list [lite]: true -- page: 'Stores' +- page: 'Vendors' features: admin: admin can view vendors menu page [lite]: true - admin can filter vendors by pending status: false - admin can filter vendors by approved status: false + admin can filter vendors by status (pending): true + admin can filter vendors by status (approved): true admin can search vendors [lite]: true admin can view vendor details: true admin can disable vendor's selling capability [lite]: true @@ -347,6 +347,7 @@ admin can set commission to Dokan subscription product (fixed): true admin can set commission to Dokan subscription product (category based): true admin can set commission to Dokan subscription product (specific category based): true + admin can view commission meta-box on order details [lite]: true - page: 'Withdraw' features: @@ -357,7 +358,7 @@ admin can filter withdrawal requests by cancelled status: true admin can filter withdrawal requests by vendor [lite]: true admin can filter withdrawal requests by payment methods [lite]: true - admin can filter withdrawal requests by date: false + # admin can filter withdrawal requests by date: false admin can clear withdrawal request filters: false admin can export withdrawal requests [lite]: true admin can add note to withdrawal request [lite]: true @@ -379,7 +380,7 @@ admin: admin can view reverse withdrawal menu page [lite]: true admin can filter reverse withdrawal by store [lite]: true - admin can filter reverse withdrawal by date [lite]: false + # admin can filter reverse withdrawal by date [lite]: false admin can clear reverse withdrawal filters: true admin can add reverse withdrawal [lite]: true vendor: @@ -412,6 +413,13 @@ customer can contact vendor [lite]: true customer can navigate to Dokan privacy policy [lite]: true +- page: 'Diagnostic Notice' + features: + admin: + admin can view Dokan diagnostic notice [lite]: true + admin can allow Dokan diagnostic tracking [lite]: true + admin can disallow Dokan diagnostic tracking [lite]: true + - page: 'Notice And Promotion' features: admin: @@ -428,7 +436,7 @@ - page: 'Shortcode' features: admin: - admin can create page with Dokan shortcode: false + admin can create page with Dokan shortcode: true vendor: vendor can view Dokan dashboard (shortcode): true vendor can view Dokan subscription packs (shortcode): true @@ -438,7 +446,7 @@ customer can view top rated products (shortcode): true customer can view customer migration form (shortcode): true customer can view geolocation filter form (shortcode): true - customer can view advertised products (shortcode): false + customer can view advertised products (shortcode): true customer can view stores (shortcode): true customer can view my orders (shortcode): true customer can view request for quote (shortcode): true @@ -460,7 +468,7 @@ vendor can set vacation settings: true vendor can set discount settings: true vendor can set biography settings: true - vendor can set live chat settings: false + vendor can set live chat settings: true vendor can set store support settings: true vendor can set social profile settings: true vendor can set rma settings (no warranty): true @@ -534,7 +542,7 @@ - page: 'coupons' features: admin: - admin can add marketplace coupon: false + admin can add marketplace coupon: true vendor: vendor can view coupons menu page: true vendor can view marketPlace coupons: true @@ -597,7 +605,7 @@ admin can trash announcement: true admin can restore announcement: true admin can permanently delete announcement: true - admin can perform bulk action on announcements: false + admin can perform bulk action on announcements: true vendor: vendor can view announcements menu page: true vendor can view announcement details: true @@ -638,10 +646,10 @@ features: admin: admin can view license menu page: true - admin can't activate license with incorrect key: false - admin can activate license: false + admin can't activate license with incorrect key: true + admin can activate license: true admin can refresh license: true - admin can deactivate license: false + admin can deactivate license: true - page: 'Modules' features: @@ -720,7 +728,7 @@ customer: customer can bid auction product: true - customer can buy auction product with buy it now price: false + customer can buy auction product with buy it now price: true - page: 'Color Scheme Customizer' features: @@ -807,10 +815,16 @@ features: admin: # admin can set Dokan geolocation settings [duplicate]: false - admin can set map location position: false - admin can set where to display store map: false - admin can enable filters before location map: false - admin can enable product location tab on single product page: false + admin can set map location position (top): true + admin can set map location position (left): true + admin can set map location position (right): true + admin can set map display page (all): true + admin can set map display page (store_listing): true + admin can set map display page (shop): true + admin can enable filters before location map: true + admin can disable filters before location map: true + admin can enable product location tab on single product page: true + admin can disable product location tab on single product page: true admin can set map radius search unit and distance: false admin can set map zoom level: false admin can set map default location: false @@ -825,8 +839,8 @@ # customer can view map on shop page [duplicate]: false # customer can view map on store list page [duplicate]: false # customer can view map on single product page [duplicate]: false - # customer can view product location on map [duplicate]: false - # customer can view store location on map [duplicate]: false + # customer can view product location [duplicate]: false + # customer can view store location [duplicate]: false # customer can use filters on shop page [duplicate]: false # customer can use filters on store list page [duplicate]: false @@ -870,7 +884,7 @@ - page: 'PayPal Marketplace' features: admin: - admin can add Paypal Marketplace payment method: false + admin can add Paypal Marketplace payment method: true - page: 'Printful' features: @@ -928,7 +942,7 @@ # admin can filter advertised product by calendar: false admin can expire advertised product: true admin can delete advertised product: true - admin can perform bulk action on product advertisements: false + admin can perform bulk action on product advertisements: true vendor: vendor can buy product advertising (product list page): true vendor can buy product advertising (product edit page): false @@ -977,18 +991,18 @@ features: vendor: vendor can view user subscriptions menu page: true - vendor can view product subscription details: false - vendor can filter user subscriptions by customer: false - vendor can filter user subscriptions by date: false - vendor can view user subscription: false + vendor can view product subscription details: true + vendor can filter user subscriptions by customer: true + vendor can filter user subscriptions by date: true + vendor can view user subscription: true customer: - customer can view product subscription details: false - customer can cancel subscription: false - customer can reactivate subscription: false - customer can change address of subscription: false - customer can change payment of subscription: false - customer can renew subscription: false - customer can buy product subscription: false + customer can view product subscription details: true + customer can cancel subscription: true + customer can reactivate subscription: true + customer can change address of subscription: true + customer can change payment of subscription: true + customer can renew subscription: true + customer can buy product subscription: true - page: 'Rank Math SEO' features: @@ -1076,8 +1090,8 @@ admin can search seller badge: true admin can create seller badge: true admin can edit seller badge: true - admin can filter vendors by seller badge: false - admin can view seller badge vendors: false + admin can filter vendors by seller badge: true + admin can view seller badge vendors: true admin can view seller badges acquired by vendor: true admin can update seller badge status: true admin can delete seller badge: true @@ -1227,7 +1241,7 @@ admin can filter subscribed vendors by subscription pack: true admin can cancel subscription (immediately): true admin can cancel subscription (end of the current period): true - admin can reactive recurring subscription (has active period ): false + admin can reactive recurring subscription (has active period): false admin can perform bulk action on subscribed vendors: true admin can assign non recurring subscription pack to vendor: true vendor: diff --git a/tests/pw/pages/adminPage.ts b/tests/pw/pages/adminPage.ts index 682d2fcd9c..99e8e428fc 100644 --- a/tests/pw/pages/adminPage.ts +++ b/tests/pw/pages/adminPage.ts @@ -117,20 +117,20 @@ export class AdminPage extends BasePage { if (DOKAN_PRO) { await this.selectByValue(setupWizardAdmin.sellingProductTypes, dokanSetupWizard.sellingProductTypes); } - await this.click(setupWizardAdmin.continue); + await this.clickAndAcceptAndWaitForResponseAndLoadState(data.subUrls.backend.dokan.setupWizardStore, setupWizardAdmin.continue, 302); // await this.click(setupWizardAdmin.skipThisStep) // Selling await this.enableSwitcherSetupWizard(setupWizardAdmin.newVendorEnableSelling); await this.enableSwitcherSetupWizard(setupWizardAdmin.orderStatusChange); - await this.click(setupWizardAdmin.continue); + await this.clickAndAcceptAndWaitForResponseAndLoadState(data.subUrls.backend.dokan.setupWizardSelling, setupWizardAdmin.continue, 302); // await this.click(setupWizardAdmin.skipThisStep) // Commission await this.selectByValue(setupWizardAdmin.commissionType, dokanSetupWizard.commission.commissionType); await this.clearAndType(setupWizardAdmin.percentage, dokanSetupWizard.commission.commissionPercentage); await this.clearAndType(setupWizardAdmin.fixed, dokanSetupWizard.commission.commissionFixed); - await this.click(setupWizardAdmin.continue); + await this.clickAndAcceptAndWaitForResponseAndLoadState(data.subUrls.backend.dokan.setupWizardCommission, setupWizardAdmin.continue, 302); // Withdraw await this.enableSwitcherSetupWizard(setupWizardAdmin.payPal); @@ -144,7 +144,7 @@ export class AdminPage extends BasePage { await this.clearAndType(setupWizardAdmin.minimumWithdrawLimit, dokanSetupWizard.minimumWithdrawLimit); await this.enableSwitcherSetupWizard(setupWizardAdmin.orderStatusForWithdrawCompleted); await this.enableSwitcherSetupWizard(setupWizardAdmin.orderStatusForWithdrawProcessing); - await this.click(setupWizardAdmin.continue); + await this.clickAndAcceptAndWaitForResponseAndLoadState(data.subUrls.backend.dokan.setupWizardWithdraw, setupWizardAdmin.continue, 302); // Recommended await this.disableSwitcherSetupWizard(setupWizardAdmin.wooCommerceConversionTracking); diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index 3d36e88fe7..948e21662c 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -43,13 +43,19 @@ export class BasePage { } // goto subUrl - async goto(subPath: string, options: { referer?: string; timeout?: number; waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit' } | undefined = { waitUntil: 'domcontentloaded' }): Promise { + async goto(subPath: string, options: { referer?: string; timeout?: number; waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit' } | undefined = { waitUntil: 'domcontentloaded' }, force = false): Promise { await this.page.goto(subPath, options); + if (force) { + await this.reload(); + } } // goto subUrl until networkidle - async gotoUntilNetworkidle(subPath: string, options: { referer?: string; timeout?: number; waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit' } | undefined = { waitUntil: 'networkidle' }): Promise { + async gotoUntilNetworkidle(subPath: string, options: { referer?: string; timeout?: number; waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit' } | undefined = { waitUntil: 'networkidle' }, force = false): Promise { await this.goto(subPath, options); + if (force) { + await this.reload(); + } } // go forward diff --git a/tests/pw/pages/commissionPage.ts b/tests/pw/pages/commissionPage.ts index 3f0dd3d204..a59d7e8c9f 100644 --- a/tests/pw/pages/commissionPage.ts +++ b/tests/pw/pages/commissionPage.ts @@ -17,24 +17,31 @@ export class CommissionPage extends AdminPage { // add commission async addCommission(commission: commission) { + await this.selectByValue(setupWizardAdmin.commissionType, commission.commissionType); if (commission.commissionType === 'fixed') { - await this.selectByValue(setupWizardAdmin.commissionType, commission.commissionType); + // await this.selectByValue(setupWizardAdmin.commissionType, commission.commissionType); await this.clearAndType(setupWizardAdmin.percentage, commission.commissionPercentage); + await this.wait(0.5); //todo: need to resolve await this.clearAndType(setupWizardAdmin.fixed, commission.commissionFixed); + await this.wait(0.5); } else { - await this.selectByValueAndWaitForResponse(data.subUrls.api.dokan.multistepCategories, setupWizardAdmin.commissionType, commission.commissionType); + // await this.selectByValueAndWaitForResponse(data.subUrls.api.dokan.multistepCategories, setupWizardAdmin.commissionType, commission.commissionType); if (commission.commissionCategory.allCategory) { await this.clearAndType(setupWizardAdmin.categoryPercentage(commission.commissionCategory.category), commission.commissionPercentage); + await this.wait(0.5); await this.clearAndType(setupWizardAdmin.categoryFixed(commission.commissionCategory.category), commission.commissionFixed); + await this.wait(0.5); } else { const categoryExpanded = await this.isVisible(setupWizardAdmin.expandedCategories); if (!categoryExpanded) { await this.click(setupWizardAdmin.expandCategories); } await this.clearAndType(setupWizardAdmin.categoryPercentageById(commission.commissionCategory.category), commission.commissionPercentage); + await this.wait(0.5); await this.clearAndType(setupWizardAdmin.categoryFixedById(commission.commissionCategory.category), commission.commissionFixed); + await this.wait(0.5); } } } @@ -49,6 +56,7 @@ export class CommissionPage extends AdminPage { await this.toHaveValue(settingsAdmin.selling.categoryPercentage(commission.commissionCategory.category), commission.commissionPercentage); await this.toHaveValue(settingsAdmin.selling.categoryFixed(commission.commissionCategory.category), commission.commissionFixed); } else { + await this.wait(0.5); const categoryExpanded = await this.isVisible(setupWizardAdmin.expandedCategories); if (!categoryExpanded) { await this.click(setupWizardAdmin.expandCategories); @@ -71,7 +79,7 @@ export class CommissionPage extends AdminPage { // add commission await this.addCommission(commission); - await this.click(setupWizardAdmin.continue); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.backend.dokan.setupWizardCommission, setupWizardAdmin.continue, 302); // skip withdraw setup await this.click(setupWizardAdmin.skipThisStep); @@ -100,7 +108,7 @@ export class CommissionPage extends AdminPage { // set commission on dokan selling settings async setCommissionOnDokanSellingSettings(commission: commission) { await this.goToDokanSettings(); - await this.click(settingsAdmin.menus.sellingOptions); + await this.clickAndWaitForLoadState(settingsAdmin.menus.sellingOptions); await this.selectByValue(settingsAdmin.selling.commissionType, commission.commissionType); @@ -122,7 +130,6 @@ export class CommissionPage extends AdminPage { // add commission await this.addCommission(commission); - await this.wait(1); // todo: resolve in future; test failed for fixed commission await this.clickAndWaitForResponse(data.subUrls.api.dokan.stores, vendors.editVendor.saveChanges); await this.click(vendors.editVendor.closeUpdateSuccessModal); @@ -139,7 +146,9 @@ export class CommissionPage extends AdminPage { // add commission await this.click(productsAdmin.product.subMenus.advanced); await this.clearAndType(productsAdmin.product.advanced.commissionPercentage, commission.commissionPercentage); + await this.wait(0.5); await this.clearAndType(productsAdmin.product.advanced.commissionFixed, commission.commissionFixed); + await this.wait(0.5); // update product await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, productsAdmin.product.publish); @@ -153,7 +162,7 @@ export class CommissionPage extends AdminPage { // set commission to dokan subscription product async setCommissionToDokanSubscriptionProduct(productId: string, commission: commission) { - await this.goto(data.subUrls.backend.wc.productDetails(productId)); + await this.gotoUntilNetworkidle(data.subUrls.backend.wc.productDetails(productId)); // add commission await this.click(productsAdmin.product.subMenus.commission); @@ -169,4 +178,12 @@ export class CommissionPage extends AdminPage { await this.click(productsAdmin.product.subMenus.commission); await this.assertCommission(commission); } + + // view commission metabox + async viewCommissionMetaBox(orderId: string) { + await this.gotoUntilNetworkidle(data.subUrls.backend.orderDetails(orderId)); + + // metabox elements are visible + await this.multipleElementVisible(selector.admin.wooCommerce.orders.commissionMetaBox); + } } diff --git a/tests/pw/pages/geolocationPage.ts b/tests/pw/pages/geolocationPage.ts new file mode 100644 index 0000000000..b34d88ae97 --- /dev/null +++ b/tests/pw/pages/geolocationPage.ts @@ -0,0 +1,100 @@ +import { Page } from '@playwright/test'; +import { AdminPage } from '@pages/adminPage'; +import { selector } from '@pages/selectors'; +import { data } from '@utils/testData'; +import { helpers } from '@utils/helpers'; + +export class GeolocationPage extends AdminPage { + constructor(page: Page) { + super(page); + } + + async goToProductDetails(productName: string): Promise { + await this.gotoUntilNetworkidle(data.subUrls.frontend.productDetails(helpers.slugify(productName))); + } + + // view map position + async viewMapPosition(position: 'top' | 'left' | 'right'): Promise { + await this.gotoUntilNetworkidle(data.subUrls.frontend.storeListing); + switch (position) { + case 'top': + await this.toHaveAttribute(selector.customer.cStoreList.map.locationMap, 'class', 'dokan-geolocation-locations-map-top'); + break; + + case 'left': + await this.toHaveAttribute(selector.customer.cStoreList.map.locationMap, 'class', 'dokan-geolocation-locations-map-left'); + break; + + case 'right': + await this.toHaveAttribute(selector.customer.cStoreList.map.locationMap, 'class', 'dokan-geolocation-locations-map-right'); + break; + + default: + break; + } + } + + // view map + async viewMap(position: 'all' | 'store_listing' | 'shop'): Promise { + switch (position) { + case 'all': + await this.gotoUntilNetworkidle(data.subUrls.frontend.shop); + await this.toBeVisible(selector.customer.cStoreList.map.locationMap); + await this.gotoUntilNetworkidle(data.subUrls.frontend.storeListing); + await this.toBeVisible(selector.customer.cStoreList.map.locationMap); + break; + + case 'store_listing': + await this.gotoUntilNetworkidle(data.subUrls.frontend.shop); + await this.notToBeVisible(selector.customer.cStoreList.map.locationMap); + await this.gotoUntilNetworkidle(data.subUrls.frontend.storeListing); + await this.toBeVisible(selector.customer.cStoreList.map.locationMap); + break; + + case 'shop': + await this.gotoUntilNetworkidle(data.subUrls.frontend.shop); + await this.toBeVisible(selector.customer.cStoreList.map.locationMap); + await this.gotoUntilNetworkidle(data.subUrls.frontend.storeListing); + await this.notToBeVisible(selector.customer.cStoreList.map.locationMap); + break; + + default: + break; + } + } + + // view map filters + async viewMapFilters(status: 'enable' | 'disable'): Promise { + await this.gotoUntilNetworkidle(data.subUrls.frontend.shop); + switch (status) { + case 'enable': + await this.toBeVisible(selector.customer.cShop.filters.filterDiv); + break; + + case 'disable': + await this.notToBeVisible(selector.customer.cShop.filters.filterDiv); + break; + + default: + break; + } + } + + // view product location + async viewProductLocationTab(productName: string, status: 'enable' | 'disable'): Promise { + switch (status) { + case 'enable': + await this.goToProductDetails(productName); + await this.toBeVisible(selector.customer.cSingleProduct.menus.location); + break; + + case 'disable': + await this.goToProductDetails(productName); + await this.notToBeVisible(selector.customer.cSingleProduct.menus.location); + break; + + default: + break; + } + } +} diff --git a/tests/pw/pages/noticeAndPromotionPage.ts b/tests/pw/pages/noticeAndPromotionPage.ts index 1ae05185b5..6a836457c1 100644 --- a/tests/pw/pages/noticeAndPromotionPage.ts +++ b/tests/pw/pages/noticeAndPromotionPage.ts @@ -2,6 +2,7 @@ import { Page } from '@playwright/test'; import { AdminPage } from '@pages/adminPage'; import { selector } from '@pages/selectors'; import { data } from '@utils/testData'; +import { diagnosticNotice } from '@utils/interfaces'; export class NoticeAndPromotionPage extends AdminPage { constructor(page: Page) { @@ -74,4 +75,26 @@ export class NoticeAndPromotionPage extends AdminPage { // settings pro advertisement banner elements are visible await this.multipleElementVisible(selector.admin.dokan.settings.proAdvertisementBanner); } + + // dokan diagnostic notice + async dokanDiagnosticNoticeRenderProperly(diagnosticNotice: diagnosticNotice) { + await this.gotoUntilNetworkidle(data.subUrls.backend.adminDashboard); + await this.toBeVisible(selector.admin.dokan.diagnostic.noticeDiv); + await this.toContainText(selector.admin.dokan.diagnostic.paragraph1, diagnosticNotice.paragraph1); + await this.toContainText(selector.admin.dokan.diagnostic.paragraph2, diagnosticNotice.paragraph2); + } + + // allow diagnostic tracking + async allowDiagnosticTracking() { + await this.goIfNotThere(data.subUrls.backend.adminDashboard, 'networkidle'); + await this.clickAndWaitForResponse(data.subUrls.backend.diagnosticNotice, selector.admin.dokan.diagnostic.allowCollectData, 302); + await this.notToBeVisible(selector.admin.dokan.diagnostic.noticeDiv); + } + + // allow diagnostic tracking + async disallowDiagnosticTracking() { + await this.goIfNotThere(data.subUrls.backend.adminDashboard, 'networkidle'); + await this.clickAndWaitForLoadState(selector.admin.dokan.diagnostic.disallowCollectData); + await this.notToBeVisible(selector.admin.dokan.diagnostic.noticeDiv); + } } diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 252b6e9320..0726386a56 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -237,6 +237,14 @@ export const selector = { sliderNext: '.slide-notice .next', }, + diagnostic: { + noticeDiv: '//a[@class="dokan-insights-data-we-collect"]/../..', + allowCollectData: '//a[@class="dokan-insights-data-we-collect"]/../..//a[normalize-space()="Allow"]', + disallowCollectData: '//a[@class="dokan-insights-data-we-collect"]/../..//a[normalize-space()="No thanks"]', + paragraph1: '(//a[@class="dokan-insights-data-we-collect"]/../..//p)[1]', + paragraph2: '//a[@class="dokan-insights-data-we-collect"]/../..//p[@class="description"]', + }, + // promo banner promoBanner: { promoBanner: '.dokan-promo-banner', @@ -433,7 +441,7 @@ export const selector = { // Nav Tabs navTabs: { - cancelled: '//ul[@class="subsubsub"]//li//a[contains(text(),"All")]', + all: '//ul[@class="subsubsub"]//li//a[contains(text(),"All")]', approved: '//ul[@class="subsubsub"]//li//a[contains(text(),"Approved")]', pending: '//ul[@class="subsubsub"]//li//a[contains(text(),"Pending")]', }, @@ -2972,6 +2980,13 @@ export const selector = { //table numberOfRowsFound: '(//span[@class="displaying-num"])[1]', noRowsFound: '//td[normalize-space(text())="No items found."]', + + commissionMetaBox: { + metaBoxDiv: 'div#dokan_commission_box', + commissionsText: '//h2[normalize-space()="Commissions"]', + orderItemInfo: 'div#dokan_commission_box table.woocommerce_order_items', + orderTotalInfo: 'div#dokan_commission_box div.wc-order-totals-items', + }, }, }, @@ -6997,6 +7012,7 @@ export const selector = { // Filter filters: { + filterDiv: 'form.dokan-geolocation-location-filters', searchProduct: 'input.dokan-form-control[placeholder="Search Products"]', location: '.location-address input', selectCategory: '#product_cat', @@ -7253,7 +7269,7 @@ export const selector = { storeListText: '//h1[normalize-space()="Store List"]', map: { - locationMap: '#dokan-geolocation-locations-map', + locationMap: 'div#dokan-geolocation-locations-map', map: '//button[normalize-space()="Map"]', satellite: '//button[normalize-space()="Satellite"]', fullScreenToggle: '//button[@title="Toggle fullscreen view"]', diff --git a/tests/pw/pages/shortcodePage.ts b/tests/pw/pages/shortcodePage.ts index 443ac5a3f5..b68e5f5fff 100644 --- a/tests/pw/pages/shortcodePage.ts +++ b/tests/pw/pages/shortcodePage.ts @@ -140,4 +140,19 @@ export class ShortcodePage extends AdminPage { async viewRequestQuote(link: string) { await this.requestForQuotationsPage.requestForQuoteRenderProperly(link); } + + // view advertised products + async viewAdvertisedProducts(link: string) { + await this.goto(link); + + const productCount = await this.getElementCount(shopCustomer.productCard.card); + if (productCount) { + // product card elements are visible + await this.notToHaveCount(shopCustomer.productCard.card, 0); + await this.notToHaveCount(shopCustomer.productCard.productDetailsLink, 0); + await this.notToHaveCount(shopCustomer.productCard.productTitle, 0); + await this.notToHaveCount(shopCustomer.productCard.productPrice, 0); + await this.notToHaveCount(shopCustomer.productCard.addToCart, 0); + } + } } diff --git a/tests/pw/pages/singleProductPage.ts b/tests/pw/pages/singleProductPage.ts index 951147d02b..4b129da4ec 100644 --- a/tests/pw/pages/singleProductPage.ts +++ b/tests/pw/pages/singleProductPage.ts @@ -99,7 +99,7 @@ export class SingleProductPage extends CustomerPage { async productLocation(productName: string) { await this.goToProductDetails(productName); await this.click(singleProductCustomer.menus.location); - // await this.multipleElementVisible(singleProductCustomer.location); //todo: need to resolve: product location gets reset by other tests, skipeed for now + // await this.multipleElementVisible(singleProductCustomer.location); //todo: need to resolve: product location gets reset by other tests, skipped for now await this.toBeVisible(singleProductCustomer.location.map); } diff --git a/tests/pw/pages/storesPage.ts b/tests/pw/pages/storesPage.ts index 26a706403c..1fef85685d 100644 --- a/tests/pw/pages/storesPage.ts +++ b/tests/pw/pages/storesPage.ts @@ -235,6 +235,25 @@ export class StoresPage extends AdminPage { } } + // filter vendors + async filterVendors(filterBy: string): Promise { + await this.goIfNotThere(data.subUrls.backend.dokan.vendors); + + switch (filterBy) { + case 'pending': + await this.clickAndWaitForResponseAndLoadState(data.subUrls.api.dokan.stores, vendors.navTabs.pending); + break; + + case 'approved': + await this.clickAndWaitForResponseAndLoadState(data.subUrls.api.dokan.stores, vendors.navTabs.approved); + break; + + default: + break; + } + await this.notToHaveCount(vendors.numberOfRows, 0); + } + // update vendor async updateVendor(vendorName: string, action: string) { await this.searchVendor(vendorName); diff --git a/tests/pw/playwright.config.ts b/tests/pw/playwright.config.ts index 8e397b2483..58b5e9ac8f 100644 --- a/tests/pw/playwright.config.ts +++ b/tests/pw/playwright.config.ts @@ -4,7 +4,7 @@ import { customExpect } from '@utils/pwMatchers'; const { CI, NON_HEADLESS, BASE_URL, SLOWMO } = process.env; export default defineConfig({ - testDir: './tests/', + testDir: 'tests', testMatch: /.*\.spec\.ts/, /* Folder for test artifacts such as screenshots, videos, traces, etc. */ outputDir: 'playwright/test-artifacts/', diff --git a/tests/pw/tests/e2e/commission.spec.ts b/tests/pw/tests/e2e/commission.spec.ts index 910078a14b..055e8b1707 100644 --- a/tests/pw/tests/e2e/commission.spec.ts +++ b/tests/pw/tests/e2e/commission.spec.ts @@ -6,7 +6,7 @@ import { payloads } from '@utils/payloads'; import { dbUtils } from '@utils/dbUtils'; import { dbData } from '@utils/dbData'; -// const { DOKAN_PRO } = process.env; +const { DOKAN_PRO, PRODUCT_ID } = process.env; test.describe('Commission test', () => { let admin: CommissionPage; @@ -78,7 +78,6 @@ test.describe('Commission test', () => { }); test('admin can set commission for a product (fixed)', { tag: ['@lite', '@admin'] }, async () => { - test.skip(true, 'dokan issue, decimal separator , becomes .'); const [, productId] = await apiUtils.createProduct(payloads.createProduct(), payloads.vendorAuth); await admin.setCommissionForProduct(productId, data.commission.fixed); }); @@ -97,4 +96,9 @@ test.describe('Commission test', () => { test.skip(true, 'Need to implement createDokanSubscriptionProduct function'); await admin.setCommissionToDokanSubscriptionProduct(subscriptionProductId, data.commission.specificCategory); }); + + test('admin can view commission meta-box on order details', { tag: ['@lite', '@admin'] }, async () => { + const [, , orderId] = await apiUtils.createOrderWithStatus(PRODUCT_ID, payloads.createOrder, data.order.orderStatus.onhold, payloads.vendorAuth); + await admin.viewCommissionMetaBox(orderId); + }); }); diff --git a/tests/pw/tests/e2e/diagnosticnotice.spec.ts b/tests/pw/tests/e2e/diagnosticnotice.spec.ts new file mode 100644 index 0000000000..d3b629b4da --- /dev/null +++ b/tests/pw/tests/e2e/diagnosticnotice.spec.ts @@ -0,0 +1,35 @@ +import { test, Page } from '@playwright/test'; +import { NoticeAndPromotionPage } from '@pages/noticeAndPromotionPage'; +import { data } from '@utils/testData'; +import { dbUtils } from '@utils/dbUtils'; + +test.describe('Diagnostic notice test', () => { + let admin: NoticeAndPromotionPage; + let aPage: Page; + + test.beforeAll(async ({ browser }) => { + const adminContext = await browser.newContext(data.auth.adminAuth); + aPage = await adminContext.newPage(); + admin = new NoticeAndPromotionPage(aPage); + + // delete previous settings if exists + await dbUtils.deleteOptionRow(['dokan_tracking_notice', 'dokan_allow_tracking']); + }); + + test.afterAll(async () => { + await aPage.close(); + }); + + test('admin can view Dokan diagnostic notice', { tag: ['@lite', '@admin'] }, async () => { + await admin.dokanDiagnosticNoticeRenderProperly(data.diagnosticNotice); + }); + + test('admin can allow Dokan diagnostic tracking', { tag: ['@lite', '@admin'] }, async () => { + await admin.allowDiagnosticTracking(); + }); + + test('admin can disallow Dokan diagnostic tracking [lite]', { tag: ['@lite', '@admin'] }, async () => { + await dbUtils.deleteOptionRow(['dokan_tracking_notice', 'dokan_allow_tracking']); + await admin.disallowDiagnosticTracking(); + }); +}); diff --git a/tests/pw/tests/e2e/geolocation.spec.ts b/tests/pw/tests/e2e/geolocation.spec.ts new file mode 100644 index 0000000000..bf0df53e6e --- /dev/null +++ b/tests/pw/tests/e2e/geolocation.spec.ts @@ -0,0 +1,49 @@ +import { test, Page } from '@playwright/test'; +import { GeolocationPage } from '@pages/geolocationPage'; +import { dbData } from '@utils/dbData'; +import { dbUtils } from '@utils/dbUtils'; +import { data } from '@utils/testData'; + +test.describe('Geolocation test', () => { + let admin: GeolocationPage; + let aPage: Page; + + test.beforeAll(async ({ browser }) => { + const adminContext = await browser.newContext(data.auth.adminAuth); + aPage = await adminContext.newPage(); + admin = new GeolocationPage(aPage); + }); + + test.afterAll(async () => { + await dbUtils.setOptionValue(dbData.dokan.optionName.geolocation, dbData.dokan.geolocationSettings); + await aPage.close(); + }); + + ['top', 'left', 'right'].forEach((position: string) => { + test(`admin can set map position (${position})`, { tag: ['@pro', '@admin'] }, async () => { + await dbUtils.updateOptionValue(dbData.dokan.optionName.geolocation, { show_locations_map: position }); + await admin.viewMapPosition(position as 'top' | 'left' | 'right'); + }); + }); + + ['all', 'store_listing', 'shop'].forEach((place: string) => { + test(`admin can set map display page (${place})`, { tag: ['@pro', '@admin'] }, async () => { + await dbUtils.updateOptionValue(dbData.dokan.optionName.geolocation, { show_location_map_pages: place }); + await admin.viewMap(place as 'all' | 'store_listing' | 'shop'); + }); + }); + + ['enable', 'disable'].forEach((status: string) => { + test(`admin can ${status} filters before location map`, { tag: ['@pro', '@admin'] }, async () => { + await dbUtils.updateOptionValue(dbData.dokan.optionName.geolocation, { show_filters_before_locations_map: status === 'enable' ? 'on' : 'off' }); + await admin.viewMapFilters(status as 'enable' | 'disable'); + }); + }); + + ['enable', 'disable'].forEach((status: string) => { + test(`admin can ${status} product location tab on single product page`, { tag: ['@pro', '@admin'] }, async () => { + await dbUtils.updateOptionValue(dbData.dokan.optionName.geolocation, { show_product_location_in_wc_tab: status === 'enable' ? 'on' : 'off' }); + await admin.viewProductLocationTab(data.predefined.simpleProduct.product1.name, status as 'enable' | 'disable'); + }); + }); +}); diff --git a/tests/pw/tests/e2e/plugin.spec.ts b/tests/pw/tests/e2e/plugin.spec.ts index 5c2cb92410..31e78fd3e2 100644 --- a/tests/pw/tests/e2e/plugin.spec.ts +++ b/tests/pw/tests/e2e/plugin.spec.ts @@ -32,43 +32,45 @@ test.describe.skip('Plugin functionality test', () => { await apiUtils.dispose(); }); - test('activate Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { + test('admin can activate Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan-pro/dokan-pro', { status: 'inactive' }, payloads.adminAuth); await admin.activatePlugin(data.plugin.pluginName.dokanPro); }); - test('deactivate Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { + test('admin can deactivate Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan-pro/dokan-pro', { status: 'active' }, payloads.adminAuth); await admin.deactivateDokanPlugin(data.plugin.pluginName.dokanPro, false); }); - test('deactivate Dokan pro plugin with deactivate reason', { tag: ['@pro', '@admin', '@serial'] }, async () => { + test('admin can deactivate Dokan pro plugin with deactivate reason', { tag: ['@pro', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan-pro/dokan-pro', { status: 'active' }, payloads.adminAuth); await admin.deactivateDokanPlugin(data.plugin.pluginName.dokanPro, true); }); - test('activate Dokan lite plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { + test('admin can activate Dokan plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan/dokan', { status: 'inactive' }, payloads.adminAuth); await admin.activatePlugin(data.plugin.pluginName.dokanLite); }); - test('deactivate Dokan lite plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { + test('admin can deactivate Dokan plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan/dokan', { status: 'active' }, payloads.adminAuth); await admin.deactivateDokanPlugin(data.plugin.pluginName.dokanLite, false); }); - test('deactivate Dokan lite plugin with deactivate reason', { tag: ['@lite', '@admin', '@serial'] }, async () => { + test('admin can deactivate Dokan plugin with deactivate reason', { tag: ['@lite', '@admin', '@serial'] }, async () => { await apiUtils.updatePlugin('dokan/dokan', { status: 'active' }, payloads.adminAuth); await admin.deactivateDokanPlugin(data.plugin.pluginName.dokanLite, true); }); - test.skip('delete Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { + test.skip('admin can delete Dokan pro plugin', { tag: ['@pro', '@admin', '@serial'] }, async () => { await admin.activatePlugin(data.plugin.pluginName.dokanLite); }); - test.skip('delete Dokan lite plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { + test.skip('admin can delete Dokan plugin', { tag: ['@lite', '@admin', '@serial'] }, async () => { await admin.activatePlugin(data.plugin.pluginName.dokanLite); }); //todo: replace (one zip with another) plugin test + + //todo: add plugin install test }); diff --git a/tests/pw/tests/e2e/shortcodes.spec.ts b/tests/pw/tests/e2e/shortcodes.spec.ts index 61a608c2c3..097bd008bd 100644 --- a/tests/pw/tests/e2e/shortcodes.spec.ts +++ b/tests/pw/tests/e2e/shortcodes.spec.ts @@ -87,6 +87,13 @@ test.describe('Shortcodes test', () => { await apiUtils.deletePage(pageId, payloads.adminAuth); }); + test('customer can view advertised products (shortcode)', { tag: ['@pro', '@admin'] }, async () => { + await apiUtils.createProductAdvertisement(payloads.createProduct(), payloads.adminAuth); + const [responseBody, pageId] = await apiUtils.createPage(payloads.productAdvertisementShortcode, payloads.adminAuth); + await customer.viewAdvertisedProducts(responseBody.link); + await apiUtils.deletePage(pageId, payloads.adminAuth); + }); + test('customer can view stores (shortcode)', { tag: ['@lite', '@admin'] }, async () => { const [responseBody, pageId] = await apiUtils.createPage(payloads.storesShortcode, payloads.adminAuth); await customer.viewStores(responseBody.link); diff --git a/tests/pw/tests/e2e/stores.spec.ts b/tests/pw/tests/e2e/stores.spec.ts index 9cfac67edb..575404a62e 100644 --- a/tests/pw/tests/e2e/stores.spec.ts +++ b/tests/pw/tests/e2e/stores.spec.ts @@ -46,17 +46,27 @@ test.describe('Stores test', () => { await admin.searchVendor(data.predefined.vendorStores.vendor1); }); - test("admin can disable vendor's selling capability", { tag: ['@lite', '@admin'] }, async () => { - // todo: might need to combine with enable - const [, , storeName] = await apiUtils.createStore(payloads.createStore(), payloads.adminAuth); - await admin.updateVendor(storeName, 'disable'); + test('admin can filter vendors by status (pending)', { tag: ['@lite', '@admin'] }, async () => { + const [, sellerId] = await apiUtils.createStore(payloads.createStore(), payloads.adminAuth); + await apiUtils.updateStoreStatus(sellerId, { status: 'inactive' }, payloads.adminAuth); + await admin.filterVendors('pending'); + }); + + test('admin can filter vendors by status (approved)', { tag: ['@lite', '@admin'] }, async () => { + await admin.filterVendors('approved'); }); test("admin can enable vendor's selling capability", { tag: ['@lite', '@admin'] }, async () => { - const [, , storeName] = await apiUtils.createStore(payloads.createStore(), payloads.adminAuth); + const [, sellerId, storeName] = await apiUtils.createStore(payloads.createStore(), payloads.adminAuth); + await apiUtils.updateStoreStatus(sellerId, { status: 'inactive' }, payloads.adminAuth); await admin.updateVendor(storeName, 'enable'); }); + test("admin can disable vendor's selling capability", { tag: ['@lite', '@admin'] }, async () => { + const [, , storeName] = await apiUtils.createStore(payloads.createStore(), payloads.adminAuth); + await admin.updateVendor(storeName, 'disable'); + }); + test('admin can edit vendor info', { tag: ['@lite', '@admin'] }, async () => { // todo: implement option to edit particular chunk of data: social profile, address, etc await admin.editVendor(VENDOR_ID, data.vendor); diff --git a/tests/pw/tests/e2e/vendorAuction.spec.ts b/tests/pw/tests/e2e/vendorAuction.spec.ts index ba9a11f4ca..770ac1f3ad 100644 --- a/tests/pw/tests/e2e/vendorAuction.spec.ts +++ b/tests/pw/tests/e2e/vendorAuction.spec.ts @@ -90,8 +90,9 @@ test.describe('Auction Product test', () => { await customer.bidAuctionProduct(auctionProductName); }); - test.skip('customer can buy auction product with buy it now price', { tag: ['@pro', '@customer'] }, async () => { - const [, , auctionProductName] = await apiUtils.createProduct(payloads.createAuctionProduct(), payloads.vendorAuth); // todo: buy it now price is not saved by api + test('customer can buy auction product with buy it now price', { tag: ['@pro', '@customer'] }, async () => { + test.skip(true, 'buy it now price is not saved by api'); // todo: buy it now price is not saved by api + const [, , auctionProductName] = await apiUtils.createProduct(payloads.createAuctionProduct(), payloads.vendorAuth); await customer.buyAuctionProduct(auctionProductName); }); }); diff --git a/tests/pw/utils/apiUtils.ts b/tests/pw/utils/apiUtils.ts index e09748ecd2..fc05a15b20 100644 --- a/tests/pw/utils/apiUtils.ts +++ b/tests/pw/utils/apiUtils.ts @@ -261,6 +261,12 @@ export class ApiUtils { return responseBody; } + // update store status + async updateStoreStatus(storeId: string, payload: object, auth?: auth): Promise { + const [, responseBody] = await this.put(endPoints.updateStoreStatus(storeId), { data: payload, headers: auth }); + return responseBody; + } + // delete all stores async deleteAllStores(auth?: auth): Promise { const allStores = await this.getAllStores(auth); diff --git a/tests/pw/utils/dbData.ts b/tests/pw/utils/dbData.ts index 255572094c..a60b983ef2 100644 --- a/tests/pw/utils/dbData.ts +++ b/tests/pw/utils/dbData.ts @@ -1039,10 +1039,10 @@ export const dbData = { }, geolocationSettings: { - show_locations_map: 'top', - show_location_map_pages: 'all', - show_filters_before_locations_map: 'on', - show_product_location_in_wc_tab: 'on', + show_locations_map: 'top', // top, left, right + show_location_map_pages: 'all', // all, store_listing, shop + show_filters_before_locations_map: 'on', // on, off + show_product_location_in_wc_tab: 'on', // on, off distance_unit: 'km', distance_min: '0', distance_max: '10', diff --git a/tests/pw/utils/dbUtils.ts b/tests/pw/utils/dbUtils.ts index c07d2ae392..5f38b8a43d 100644 --- a/tests/pw/utils/dbUtils.ts +++ b/tests/pw/utils/dbUtils.ts @@ -101,6 +101,13 @@ export const dbUtils = { return [currentSettings, newSettings]; }, + // delete option row + async deleteOptionRow(optionNames: string[]): Promise { + const query = `DELETE FROM ${dbPrefix}_options WHERE option_name IN (${optionNames.map(() => '?').join(',')})`; + const res = await dbUtils.dbQuery(query, optionNames); + return res; + }, + // create abuse report async createAbuseReport(abuseReport: any, productId: string, vendorId: string, customerId: string): Promise { const query = `INSERT INTO ${dbPrefix}_dokan_report_abuse_reports (reason, product_id, vendor_id, customer_id, description, reported_at) VALUES (?, ?, ?, ?, ?, ?);`; diff --git a/tests/pw/utils/interfaces.ts b/tests/pw/utils/interfaces.ts index cd5cfcc2e7..2fa542188b 100644 --- a/tests/pw/utils/interfaces.ts +++ b/tests/pw/utils/interfaces.ts @@ -25,6 +25,11 @@ export interface adminDashboard { }; } +export interface diagnosticNotice { + paragraph1: string; + paragraph2: string; +} + export interface bookings { startDate: Date; endDate: Date; diff --git a/tests/pw/utils/payloads.ts b/tests/pw/utils/payloads.ts index 0f486e0d09..7c0e52e8d8 100644 --- a/tests/pw/utils/payloads.ts +++ b/tests/pw/utils/payloads.ts @@ -4943,4 +4943,11 @@ export const payloads = { content: '[dokan-request-quote]', status: 'publish', }, + + // product advertisement shortcode + productAdvertisementShortcode: { + title: 'Advertised-products', + content: '[dokan_product_advertisement]', + status: 'publish', + }, }; diff --git a/tests/pw/utils/testData.ts b/tests/pw/utils/testData.ts index b55f30d9c2..4b22809c0c 100644 --- a/tests/pw/utils/testData.ts +++ b/tests/pw/utils/testData.ts @@ -128,6 +128,12 @@ export const data = { saveSuccessMessage: 'Your settings have been saved.', }, + diagnosticNotice: { + paragraph1: 'Want to help make Dokan Multivendor Marketplace even more awesome? Allow Dokan Multivendor Marketplace to collect diagnostic data and usage information. (what we collect)', + paragraph2: + 'Server environment details (php, mysql, server, WordPress versions), Number of users in your site, Site language, Number of active and inactive plugins, Site name and URL, Your name and email address. We are using Appsero to collect your data. Learn more about how Appsero collects and handle your data.', + }, + // Product product: { publishSuccessMessage: 'Product published. ', @@ -909,7 +915,7 @@ export const data = { fixed: { commissionType: 'fixed', // 'fixed','category_based' commissionPercentage: helpers.priceStringWithDecimal(10, 'ES'), - commissionFixed: helpers.priceStringWithDecimal(0, 'ES'), + commissionFixed: helpers.priceStringWithDecimal(10, 'ES'), commissionCategory: { allCategory: true, // true for all category, false for specific category category: 'All Categories', @@ -918,8 +924,8 @@ export const data = { allCategory: { commissionType: 'category_based', // 'fixed','category_based' - commissionPercentage: helpers.priceStringWithDecimal(5, 'US'), // todo: change to ES when issue is fixed - commissionFixed: helpers.priceStringWithDecimal(5, 'US'), // todo: change to ES when issue is fixed + commissionPercentage: helpers.priceStringWithDecimal(5, 'ES'), + commissionFixed: helpers.priceStringWithDecimal(5, 'ES'), commissionCategory: { allCategory: true, // true for all category, false for specific category category: 'All Categories', @@ -928,8 +934,8 @@ export const data = { specificCategory: { commissionType: 'category_based', // 'fixed','category_based' - commissionPercentage: helpers.priceStringWithDecimal(2, 'US'), // todo: change to ES when issue is fixed - commissionFixed: helpers.priceStringWithDecimal(2, 'US'), // todo: change to ES when issue is fixed + commissionPercentage: helpers.priceStringWithDecimal(2, 'ES'), + commissionFixed: helpers.priceStringWithDecimal(2, 'ES'), commissionCategory: { allCategory: false, // true for all category, false for specific category category: CATEGORY_ID, @@ -1002,6 +1008,8 @@ export const data = { adminLogin: 'wp-admin', adminLogout: 'wp-login.php?action=logout', adminDashboard: 'wp-admin', + diagnosticNotice: 'dokan_tracker_optin=true', + orderDetails: (orderId: string) => `wp-admin/admin.php?page=wc-orders&action=edit&id=${orderId}`, pages: 'wp-admin/edit.php?post_type=page', addNewPage: 'wp-admin/post-new.php?post_type=page', user: 'wp-admin/user-edit.php', @@ -1016,6 +1024,10 @@ export const data = { dokan: { setupWizard: 'wp-admin/admin.php?page=dokan-setup', + setupWizardStore: 'wp-admin/admin.php?page=dokan-setup&step=store', + setupWizardSelling: 'wp-admin/admin.php?page=dokan-setup&step=selling', + setupWizardCommission: 'wp-admin/admin.php?page=dokan-setup&step=commission', + setupWizardWithdraw: 'wp-admin/admin.php?page=dokan-setup&step=withdraw', dokan: 'wp-admin/admin.php?page=dokan#', // only lite