diff --git a/tests/pw/feature-map/feature-map.yml b/tests/pw/feature-map/feature-map.yml index 8a089a562..894fd3ff7 100644 --- a/tests/pw/feature-map/feature-map.yml +++ b/tests/pw/feature-map/feature-map.yml @@ -684,7 +684,7 @@ vendor can't bid own product: true vendor can add auction product: true vendor can view auction product: true - vendor can duplicate auction product: false + vendor can duplicate auction product: true vendor can permanently delete auction product: true vendor can edit auction product: true vendor can update auction product title: true @@ -760,13 +760,28 @@ admin: admin can enable delivery time module: false admin can disable delivery time module: false + admin can allow vendor to override delivery time settings: false + admin can set delivery support options: false + admin can set delivery date label: false + admin can set delivery blocked buffer: false + admin can set delivery time slot: false + admin can set delivery order per slot: false + admin can set delivery box info: false + admin can require delivery date and time: false + admin can set delivery days: false admin can update delivery time on order details: false vendor: vendor can view delivery time menu page: true + vendor can change view style of delivery time calendar: true + vendor can filter delivery time: true + vendor can view delivery time orders on calendar: false vendor can view delivery time settings menu page: true vendor can set delivery time settings: true - vendor can filter delivery time: true - vendor can change view style of delivery time calendar: true + vendor can set delivery support options: false + vendor can set delivery blocked buffer: false + vendor can set delivery time slot: false + vendor can set delivery order per slot: false + vendor can set delivery days: false vendor can update delivery time on order details: false customer: customer can buy product with delivery time: true diff --git a/tests/pw/pages/commissionPage.ts b/tests/pw/pages/commissionPage.ts index a59d7e8c9..f21a02759 100644 --- a/tests/pw/pages/commissionPage.ts +++ b/tests/pw/pages/commissionPage.ts @@ -22,26 +22,26 @@ export class CommissionPage extends AdminPage { // 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.wait(1); //todo: need to resolve await this.clearAndType(setupWizardAdmin.fixed, commission.commissionFixed); - await this.wait(0.5); + await this.wait(1); } else { // 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.wait(1); await this.clearAndType(setupWizardAdmin.categoryFixed(commission.commissionCategory.category), commission.commissionFixed); - await this.wait(0.5); + await this.wait(1); } 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.wait(1); await this.clearAndType(setupWizardAdmin.categoryFixedById(commission.commissionCategory.category), commission.commissionFixed); - await this.wait(0.5); + await this.wait(1); } } } @@ -124,7 +124,7 @@ export class CommissionPage extends AdminPage { // set commission for vendor async setCommissionForVendor(sellerId: string, commission: commission) { - await this.goto(data.subUrls.backend.dokan.vendorDetailsEdit(sellerId)); + await this.gotoUntilNetworkidle(data.subUrls.backend.dokan.vendorDetailsEdit(sellerId)); await this.selectByValue(vendors.editVendor.commissionType, commission.commissionType); @@ -141,14 +141,14 @@ export class CommissionPage extends AdminPage { // set commission to product async setCommissionForProduct(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.advanced); await this.clearAndType(productsAdmin.product.advanced.commissionPercentage, commission.commissionPercentage); - await this.wait(0.5); + await this.wait(1); await this.clearAndType(productsAdmin.product.advanced.commissionFixed, commission.commissionFixed); - await this.wait(0.5); + await this.wait(1); // update product await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, productsAdmin.product.publish); diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 221dbdc57..9d534059c 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -223,14 +223,14 @@ export const selector = { // dokan promotion promotion: { - promotion: '.dokan-notice-slides .dokan-promotion', - message: '.dokan-promotion .dokan-message', + promotion: 'div.dokan-notice-slides div.dokan-promotion', + message: 'div.dokan-promotion div.dokan-message', }, // dokan notice notice: { - noticeDiv: '.dokan-admin-notices', - noticeDiv1: '.dokan-admin-notice.dokan-alert', + noticeDiv: 'div.dokan-admin-notices', + noticeDiv1: '//div[@class="dokan-admin-notices"]//div[contains(@class,"dokan-admin-notice")and not(contains(@class,"dokan-promotion"))]', closeNotice: '.close-notice', slider: '.slide-notice', sliderPrev: '.slide-notice .prev', @@ -5708,6 +5708,8 @@ export const selector = { edit: (productName: string) => `//a[normalize-space()="${productName}"]/../..//span[@class="edit"]`, permanentlyDelete: (productName: string) => `//a[normalize-space()="${productName}"]/../..//span[@class="delete"]`, view: (productName: string) => `//a[normalize-space()="${productName}"]/../..//span[@class="view"]`, + duplicate: (productName: string) => `//a[normalize-space()="${productName}"]/../..//span[@class="duplicate"]`, + duplicateSuccessMessage: '//div[contains(@class,"dokan-alert dokan-alert-success")]//strong[normalize-space(text())="Product successfully duplicated"]', confirmDelete: '.swal2-confirm', cancelDelete: '.swal2-cancel', diff --git a/tests/pw/pages/shipstationPage.ts b/tests/pw/pages/shipStationPage.ts similarity index 100% rename from tests/pw/pages/shipstationPage.ts rename to tests/pw/pages/shipStationPage.ts diff --git a/tests/pw/pages/vendorAuctionsPage.ts b/tests/pw/pages/vendorAuctionsPage.ts index 3f8ec4d34..97d72de07 100644 --- a/tests/pw/pages/vendorAuctionsPage.ts +++ b/tests/pw/pages/vendorAuctionsPage.ts @@ -149,6 +149,16 @@ export class AuctionsPage extends VendorPage { await this.toBeVisible(auctionProductsVendor.productCell(productName)); } + // duplicate auction product + async duplicateAuctionProduct(productName: string) { + await this.searchAuctionProduct(productName); + await this.removeAttribute(auctionProductsVendor.rowActions(productName), 'class'); // forcing the row actions to be visible, to avoid flakiness + await this.hover(auctionProductsVendor.productCell(productName)); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.frontend.vDashboard.auction, auctionProductsVendor.duplicate(productName), 302); + await this.toBeVisible(auctionProductsVendor.duplicateSuccessMessage); + await this.toBeVisible(auctionProductsVendor.productCell(productName + ' (Copy)')); + } + // delete auction product async deleteAuctionProduct(productName: string) { await this.searchAuctionProduct(productName); diff --git a/tests/pw/tests/e2e/commission.spec.ts b/tests/pw/tests/e2e/commission.spec.ts index bb3a23469..826030b3c 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, PRODUCT_ID } = process.env; +const { PRODUCT_ID } = process.env; test.describe('Commission test', () => { let admin: CommissionPage; diff --git a/tests/pw/tests/e2e/vendorAuction.spec.ts b/tests/pw/tests/e2e/vendorAuction.spec.ts index 770ac1f3a..d8f319c61 100644 --- a/tests/pw/tests/e2e/vendorAuction.spec.ts +++ b/tests/pw/tests/e2e/vendorAuction.spec.ts @@ -69,6 +69,11 @@ test.describe('Auction Product test', () => { await vendor.searchAuctionProduct(auctionProductName); }); + test('vendor can duplicate auction product', { tag: ['@pro', '@vendor'] }, async () => { + const [, , auctionProductName] = await apiUtils.createProduct(payloads.createAuctionProduct(), payloads.vendorAuth); + await vendor.duplicateAuctionProduct(auctionProductName); + }); + test('vendor can permanently delete auction product', { tag: ['@pro', '@vendor'] }, async () => { const [, , auctionProductName] = await apiUtils.createProduct(payloads.createAuctionProduct(), payloads.vendorAuth); await vendor.deleteAuctionProduct(auctionProductName);