Skip to content

Commit

Permalink
Fix test data issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Nov 14, 2024
1 parent 1a9f01d commit 562f328
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/pw/pages/commissionPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class CommissionPage extends AdminPage {
await this.addCommission(commission);

// save settings
await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.selling.sellingOptionsSaveChanges);
await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.saveChanges);

// assert values
await this.assertCommission(commission);
Expand Down
3 changes: 2 additions & 1 deletion tests/pw/pages/settingsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export class SettingsPage extends AdminPage {
await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.saveChanges);
await this.toHaveValue(settingsAdmin.selling.percentage, selling.commission.commissionPercentage);
await this.toHaveValue(settingsAdmin.selling.percentage, selling.commission.commissionFixed);

}

// Admin Set Dokan Withdraw Settings
async setDokanWithdrawSettings(withdraw: dokanSettings['withdraw']) {
await this.goToDokanSettings();
Expand Down
1 change: 0 additions & 1 deletion tests/pw/tests/e2e/coupons.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ test.describe('Coupons test', () => {
});

test('vendor can view marketPlace coupons', { tag: ['@pro', '@exploratory', '@vendor'] }, async () => {
test.skip(true, 'Has dokan issues');
await vendor.viewMarketPlaceCoupons(marketplaceCouponCode);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/pw/tests/e2e/vendorSettings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test.describe('Vendor settings test', () => {

test('vendor can set catalog settings', { tag: ['@lite', '@vendor'] }, async () => {
await vendor.setStoreSettings(data.vendor.vendorInfo, 'catalog');

// disable catalog
await dbUtils.updateOptionValue(dbData.dokan.optionName.selling, { catalog_mode_hide_add_to_cart_button: 'off', catalog_mode_hide_product_price: 'off' });
});
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/utils/dbData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BASE_URL, GMAP, MAPBOX, LICENSE_KEY, TALKJS_APP_ID, TALKJS_APP_SECRET, PRINTFUL_APP_ID, PRINTFUL_APP_SECRET } = process.env;
const { BASE_URL, GMAP, MAPBOX, LICENSE_KEY, CATEGORY_ID, TALKJS_APP_ID, TALKJS_APP_SECRET, PRINTFUL_APP_ID, PRINTFUL_APP_SECRET } = process.env;

export const dbData = {
dokan: {
Expand Down
78 changes: 74 additions & 4 deletions tests/pw/utils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const {
GMAP,
MAPBOX,
LICENSE_KEY,
CATEGORY_ID,
VONAGE_API_KEY,
VONAGE_API_SECRET,
FB_APP_ID,
Expand Down Expand Up @@ -570,6 +571,16 @@ export const data = {
minimumProductQuantity: '1',
maximumProductQuantity: '20',
},

commission: {
commissionType: 'fixed', // 'fixed','category_based' [category commission will only be applicable to dokan subscription product]
commissionPercentage: '2',
commissionFixed: '2',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},
},
},

Expand Down Expand Up @@ -853,6 +864,39 @@ export const data = {
},
},

// commission [for all dokan setup wizard, dokan selling settings, dokan subscription product]
commission: {
fixed: {
commissionType: 'fixed', // 'fixed','category_based'
commissionPercentage: '10',
commissionFixed: '10',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},

allCategory: {
commissionType: 'category_based', // 'fixed','category_based'
commissionPercentage: '5',
commissionFixed: '5',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},

specficCategory: {
commissionType: 'category_based', // 'fixed','category_based'
commissionPercentage: '2',
commissionFixed: '2',
commissionCategory: {
allCategory: false, // true for all category, false for specific category
category: CATEGORY_ID,
},
},
},

// Dokan Setup Wizard
dokanSetupWizard: {
vendorStoreURL: 'store',
Expand All @@ -861,8 +905,15 @@ export const data = {
mapApiSource: 'google_maps', // 'google_maps', 'mapbox'
googleMapApiKey: GMAP,
sellingProductTypes: 'sell_both', // 'physical', 'digital', 'sell_both',
commissionType: 'percentage', // 'flat','percentage' 'combine',
adminCommission: '10',
commission: {
commissionType: 'fixed', // 'fixed','category_based'
commissionPercentage: '10',
commissionFixed: '0',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},
minimumWithdrawLimit: '5',
},

Expand Down Expand Up @@ -1128,6 +1179,7 @@ export const data = {
dummyDataImport: 'dokan/v1/dummy-data/import',
refunds: 'dokan/v1/refunds',
modules: 'dokan/v1/admin/modules',
multistepCategories: 'dokan/v1/products/multistep-categories',
storeReviews: 'dokan/v1/store-reviews',
productAdvertising: 'dokan/v1/product_adv',
wholesaleRegister: 'dokan/v1/wholesale/register',
Expand Down Expand Up @@ -1240,6 +1292,17 @@ export const data = {
// address fields enable flag (on vendor registration)
addressFieldsEnabled: false,

// commission
commission: {
commissionType: 'fixed', // 'fixed','category_based'
commissionPercentage: '5',
commissionFixed: '5',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},

// subscription pack
vendorSubscriptionPack: 'Dokan_Subscription_Non_recurring',

Expand Down Expand Up @@ -2071,8 +2134,15 @@ export const data = {
// selling options settings
selling: {
settingTitle: 'Selling Option Settings',
commissionType: 'percentage', // 'flat', 'percentage', 'combine'
adminCommission: '10',
commission: {
commissionType: 'fixed', // 'fixed','category_based'
commissionPercentage: '10',
commissionFixed: '10',
commissionCategory: {
allCategory: true, // true for all category, false for specific category
category: 'All Categories',
},
},
shippingFeeRecipient: 'seller', // 'seller', 'admin'
productTaxFeeRecipient: 'seller', // 'seller', 'admin'
shippingTaxFeeRecipient: 'seller', // 'seller', 'admin'
Expand Down

0 comments on commit 562f328

Please sign in to comment.