Skip to content

Commit

Permalink
Merge branch 'testlite' into e2e-pw
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Feb 18, 2024
2 parents d5ab336 + a399f25 commit c3750a8
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 25 deletions.
1 change: 0 additions & 1 deletion tests/pw/pages/basePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,6 @@ export class BasePage {

// get last matching locator
lastLocator(selector: string): Locator {
// todo: update all selector parameter to both selector or locator
const locator = this.page.locator(selector);
return locator.last();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/pages/reportsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ReportsPage extends AdminPage {
await this.clearInputField(reportsAdmin.allLogs.search);
await this.typeAndWaitForResponseAndLoadState(data.subUrls.api.dokan.logs, reportsAdmin.allLogs.search, orderId);
await this.notToBeVisible(selector.admin.dokan.loader);
await this.wait(1); // todo: resolve this
await this.wait(2); // todo: resolve this
await this.toBeVisible(reportsAdmin.allLogs.orderIdCell(orderId));
const count = (await this.getElementText(reportsAdmin.allLogs.numberOfRowsFound))?.split(' ')[0];
expect(Number(count)).toBe(1);
Expand Down
7 changes: 3 additions & 4 deletions tests/pw/tests/e2e/_localSite.install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { dbData } from '@utils/dbData';
test.describe('setup local site', () => {
test.skip(!!process.env.CI, 'skip site setup on CI');

// test('download wordpress to desired folder', async ({ page }) => {
test('download wordpress to desired folder', async ({ page }) => {});

// todo:
/*
Expand All @@ -24,8 +24,7 @@ test.describe('setup local site', () => {

// });

// test('delete database or all tables ', async ({ page }) => {
// });
test('delete database or all tables', async ({ page }) => {});

test('admin setup WP', async ({ page }) => {
const loginPage = new LoginPage(page);
Expand All @@ -40,7 +39,7 @@ test.describe('setup local site', () => {
// await dbUtils.updateWpOptionTable(dbData.dokan.optionName.dokanActiveModules, dbData.dokan.modules, 'serialize');
});

// test('install and activate theme', async ({ request }) => {}
test('install and activate theme', async ({ request }) => {});

// todo: skip global setup for local_setup

Expand Down
14 changes: 4 additions & 10 deletions tests/pw/tests/e2e/abuseReports.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const { VENDOR_ID, CUSTOMER_ID } = process.env;
test.describe('Abuse report test', () => {
let admin: AbuseReportsPage;
let customer: AbuseReportsPage;
let guest: AbuseReportsPage;
let aPage: Page, cPage: Page, gPage: Page;
let aPage: Page, cPage: Page;
let apiUtils: ApiUtils;

test.beforeAll(async ({ browser }) => {
Expand All @@ -24,10 +23,6 @@ test.describe('Abuse report test', () => {
cPage = await customerContext.newPage();
customer = new AbuseReportsPage(cPage);

const guestContext = await browser.newContext(data.auth.noAuth);
gPage = await guestContext.newPage();
guest = new AbuseReportsPage(gPage);

apiUtils = new ApiUtils(await request.newContext());
const productId = await apiUtils.getProductId(data.predefined.simpleProduct.product1.name, payloads.vendorAuth);
await dbUtils.createAbuseReport(dbData.dokan.createAbuseReport, productId, VENDOR_ID, CUSTOMER_ID);
Expand Down Expand Up @@ -72,13 +67,12 @@ test.describe('Abuse report test', () => {
});

test('guest customer can report product @pro @g', async ({ page }) => {
guest = new AbuseReportsPage(page); //todo: apply guest user like this where every test need seperate guest user
const guest = new AbuseReportsPage(page);
await guest.reportProduct(data.predefined.simpleProduct.product1.name, data.product.report);
});

test.skip('guest customer need to log-in to report product @pro @g', async ({ page }) => {
// todo: might cause other tests to fail in parallel
guest = new AbuseReportsPage(page);
test('guest customer need to log-in to report product @pro @g', async ({ page }) => {
const guest = new AbuseReportsPage(page);
await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, { ...dbData.dokan.productReportAbuseSettings, reported_by_logged_in_users_only: 'on' });
await guest.reportProduct(data.predefined.simpleProduct.product1.name, data.product.report);
await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, dbData.dokan.productReportAbuseSettings);
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/tests/e2e/myOrders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test.describe('My orders functionality test', () => {
await customer.cancelPendingOrder(orderId);
});

test.skip('customer can order again @lite @c', async () => {
test('customer can order again @lite @c', async () => {
const [, , orderId] = await apiUtils.createOrderWithStatus(PRODUCT_ID, { ...payloads.createOrder, customer_id: CUSTOMER_ID }, data.order.orderStatus.completed, payloads.vendorAuth);
await customer.orderAgain(orderId);
});
Expand Down
10 changes: 5 additions & 5 deletions tests/pw/tests/e2e/orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ test.describe('Order functionality test', () => {
await vendor.addShipment(orderId, data.orderShipmentDetails);
});

// test.skip('vendor can add downloadable product permission to order @lite @v', async ( ) => {
// const [,, downloadableProductName] = await apiUtils.createProduct(payloads.createDownloadableProduct(), payloads.vendorAuth);
// await vendor.addDownloadableProduct(orderId, downloadableProductName);
// await vendor.removeDownloadableProduct(orderId, downloadableProductName);
// });
test.skip('vendor can add downloadable product permission to order @lite @v', async () => {
const [, , downloadableProductName] = await apiUtils.createProduct(payloads.createDownloadableProduct(), payloads.vendorAuth);
await vendor.addDownloadableProduct(orderId, downloadableProductName);
await vendor.removeDownloadableProduct(orderId, downloadableProductName);
});

test('vendor can perform order bulk action @lite @v', async () => {
await vendor.orderBulkAction('completed', orderId);
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/tests/e2e/productAdvertising.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.describe('Product Advertising test', () => {

// vendor

test.skip('vendor can buy product advertising @pro @v', async () => {
test('vendor can buy product advertising @pro @v', async () => {
//todo: p1_v1 status gets pending review; need to resolve
const [, , productName] = await apiUtils.createProduct(payloads.createProduct(), payloads.vendorAuth);
const orderId = await vendor.buyProductAdvertising(productName);
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/tests/e2e/products.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ test.describe('Product functionality test', () => {
await vendor.vendorAddVirtualProduct(data.product.virtual, false);
});

test.skip('vendor can add product category @lite @v', async () => {
test('vendor can add product category @lite @v', async () => {
await vendor.vendorAddProductCategory(data.predefined.simpleProduct.product1.name, data.product.category.unCategorized);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/pw/tests/e2e/vendorBooking.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test.describe('Booking Product test', () => {
await vendor.filterBookingProducts('by-other', 'featured');
});

test.skip('vendor can view booking product @pro @v', async () => {
test('vendor can view booking product @pro @v', async () => {
await vendor.viewBookingProduct(bookableProductName);
});

Expand Down

0 comments on commit c3750a8

Please sign in to comment.