Skip to content

Commit

Permalink
Update: update feature map
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Oct 3, 2024
1 parent e4bd6eb commit e941861
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
14 changes: 9 additions & 5 deletions tests/pw/feature-map/feature-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,17 @@
vendor:
vendor can view payment settings menu page [lite]: true
vendor can add paypal payment method [lite]: true
vendor can update paypal payment method [lite]: true
vendor can remove paypal payment method [lite]: true
vendor can add bank payment method [lite]: true
vendor can add Skrill payment method: true
vendor can update bank payment method [lite]: true
vendor can remove bank payment method [lite]: true
vendor can add skrill payment method: true
vendor can update skrill payment method: true
vendor can remove skrill payment method: true
vendor can add custom payment method: true
vendor can disconnect paypal payment method: true
vendor can disconnect bank payment method: true
vendor can disconnect Skrill payment method: true
vendor can disconnect custom payment method: true
vendor can update custom payment method: true
vendor can remove custom payment method: true

- page: 'Shop'
features:
Expand Down
6 changes: 3 additions & 3 deletions tests/pw/pages/paymentsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,22 @@ export class PaymentsPage extends AdminPage {
}

// set basic payment method [paypal, skrill, custom ]
async setBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
async addBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
await this.goToPaymentSettings(paymentMethod.methodName);
await this.clearAndType(paymentSettingsVendor.paymentEmail, paymentMethod.email());
await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.updateSettings);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}

// disconnect basic payment method [paypal, skrill, custom ]
async disconnectBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
async removeBasicPayment(paymentMethod: vendor['payment']): Promise<void> {
await this.goToPaymentSettings(paymentMethod.methodName);
await this.clickAndWaitForResponse(data.subUrls.ajax, paymentSettingsVendor.disconnectPayment);
await this.toContainText(paymentSettingsVendor.updateSettingsSuccessMessage, paymentMethod.saveSuccessMessage);
}

// bank transfer payment settings
async setBankTransfer(paymentMethod: vendor['payment']): Promise<void> {
async addBankTransfer(paymentMethod: vendor['payment']): Promise<void> {
await this.goIfNotThere(data.subUrls.frontend.vDashboard.bankTransfer);

// await this.clickIfVisible(paymentSettingsVendor.disconnectAccount);
Expand Down
32 changes: 16 additions & 16 deletions tests/pw/tests/e2e/payments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,61 +81,61 @@ test.describe('Payments test', () => {
test('vendor can add paypal payment method', { tag: ['@lite', '@vendor'] }, async () => {
// await apiUtils.setStoreSettings({ payment: { paypal: { email: '' } } }, payloads.vendorAuth);
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { paypal: { email: '' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
});

test('vendor can update paypal payment method', { tag: ['@lite', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { paypal: { email: '[email protected]' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
});

test('vendor can disconnect paypal payment method', { tag: ['@lite', '@vendor'] }, async () => {
test('vendor can remove paypal payment method', { tag: ['@lite', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { paypal: { email: '[email protected]' } } });
await vendor.disconnectBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
await vendor.removeBasicPayment({ ...data.vendor.payment, methodName: 'paypal' });
});

test('vendor can add bank payment method', { tag: ['@lite', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', helpers.emptyObjectValues(dbData.testData.dokan.paymentSettings.bank));
await vendor.setBankTransfer(data.vendor.payment);
await vendor.addBankTransfer(data.vendor.payment);
});

test('vendor can update bank payment method', { tag: ['@lite', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', dbData.testData.dokan.paymentSettings.bank);
await vendor.setBankTransfer(data.vendor.payment);
await vendor.addBankTransfer(data.vendor.payment);
});

test('vendor can disconnect bank payment method', { tag: ['@lite', '@vendor'] }, async () => {
test.only('vendor can remove bank payment method', { tag: ['@lite', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', dbData.testData.dokan.paymentSettings.bank);
await vendor.disconnectBasicPayment({ ...data.vendor.payment, methodName: 'bank' });
await vendor.removeBasicPayment({ ...data.vendor.payment, methodName: 'bank' });
});

test('vendor can add skrill payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { skrill: { email: '' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
});

test('vendor can update skrill payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { skrill: { email: '[email protected]' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
});

test('vendor can disconnect skrill payment method', { tag: ['@pro', '@vendor'] }, async () => {
test('vendor can remove skrill payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { skrill: { email: '[email protected]' } } });
await vendor.disconnectBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
await vendor.removeBasicPayment({ ...data.vendor.payment, methodName: 'skrill' });
});

test('vendor can add custom payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { dokan_custom: { value: '' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
});

test('vendor can update custom payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { dokan_custom: { value: '0123456789' } } });
await vendor.setBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
await vendor.addBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
});

test('vendor can disconnect custom payment method', { tag: ['@pro', '@vendor'] }, async () => {
test('vendor can remove custom payment method', { tag: ['@pro', '@vendor'] }, async () => {
await dbUtils.updateUserMeta(VENDOR_ID, 'dokan_profile_settings', { payment: { dokan_custom: { value: '0123456789' } } });
await vendor.disconnectBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
await vendor.removeBasicPayment({ ...data.vendor.payment, methodName: 'custom' });
});
});

0 comments on commit e941861

Please sign in to comment.