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 c3750a8 + d15569e commit 1c4807a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tests/pw/tests/api/_resetSite.teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ test.describe('test environment', () => {
});

test('delete all products', async () => {
await apiUtils.deleteAllProducts('', payloads.adminAuth);
await apiUtils.deleteAllProducts(payloads.adminAuth);
await apiUtils.deleteAllProducts(payloads.vendorAuth);
await apiUtils.deleteAllProducts(payloads.vendor2Auth);
});

test('delete all stores', async () => {
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('customer can order again @lite @c', async () => {
test.skip('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
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('vendor can buy product advertising @pro @v', async () => {
test.skip('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 @@ -60,7 +60,7 @@ test.describe('Product functionality test', () => {
await admin.addExternalProduct(data.product.external);
});

test('admin can add vendor subscription @pro @a', async () => {
test.skip('admin can add vendor subscription @pro @a', async () => {
await admin.addDokanSubscription(data.product.vendorSubscription);
});

Expand Down
7 changes: 5 additions & 2 deletions tests/pw/utils/apiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,11 @@ export class ApiUtils {
}

// delete all products
async deleteAllProducts(productName?: string, auth?: auth): Promise<responseBody> {
// todo: apply multiple optional parameter
async deleteAllProducts(productName?: any, auth?: auth): Promise<responseBody> {
if (arguments.length === 1 && typeof productName === 'object') {
auth = productName as auth;
productName = undefined;
}
const allProducts = await this.getAllProducts(auth);
if (!allProducts?.length) {
console.log('No product exists');
Expand Down

0 comments on commit 1c4807a

Please sign in to comment.