diff --git a/tests/pw/api.config.ts b/tests/pw/api.config.ts index 89701c8e47..c97ce5993d 100644 --- a/tests/pw/api.config.ts +++ b/tests/pw/api.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ // globalTeardown: './global-teardown' /* Path to the global teardown file. This file will be required and run after all the tests. */, globalTimeout: process.env.CI ? 20 * (60 * 1000) : 20 * (60 * 1000) /* Maximum time in milliseconds the whole test suite can run */, maxFailures: process.env.CI ? 30 : 30 /* The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and exit with an error. */, - timeout: process.env.CI ? 10 * 1000 : 15 * 1000 /* Maximum time one test can run for. */, + timeout: process.env.CI ? 15 * 1000 : 15 * 1000 /* Maximum time one test can run for. */, expect: { timeout: 5 * 1000 /* Maximum time expect() should wait for the condition to be met. For example in `await expect(locator).toHaveText();`*/, } /* Configuration for the expect assertion library */, diff --git a/tests/pw/e2e.config.ts b/tests/pw/e2e.config.ts index 74b037831c..66ed4dfb17 100644 --- a/tests/pw/e2e.config.ts +++ b/tests/pw/e2e.config.ts @@ -43,8 +43,8 @@ export default defineConfig({ use: { ...devices['Desktop Chrome'], acceptDownloads: true /* Whether to automatically download all the attachments. */, - actionTimeout: 20 * 1000 /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */, - navigationTimeout: 20 * 1000 /* Maximum time each navigation such as 'goto()' can take. */, + actionTimeout: 30 * 1000 /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */, + navigationTimeout: 30 * 1000 /* Maximum time each navigation such as 'goto()' can take. */, baseURL: process.env.BASE_URL ? process.env.BASE_URL : 'http://localhost:9999' /* Base URL */, // browserName: 'chromium' /* Name of the browser that runs tests. */, bypassCSP: true /* Toggles bypassing page's Content-Security-Policy. */, diff --git a/tests/pw/global-setup.ts b/tests/pw/global-setup.ts index 51e63fbec9..935ba211cb 100644 --- a/tests/pw/global-setup.ts +++ b/tests/pw/global-setup.ts @@ -9,10 +9,10 @@ async function globalSetup(config: FullConfig) { console.log('Global Setup running....'); // rewrite permalink structure - !CI && helpers.execommand(data.command.permalinkLocal); + !CI && helpers.exeCommand(data.command.permalinkLocal); // activate theme: storefront - !CI && helpers.execommand(data.command.activateTheme); + !CI && helpers.exeCommand(data.command.activateTheme); // get site url structure let serverUrl = config.projects[0]?.use.baseURL as string; diff --git a/tests/pw/tests/api/refunds.spec.ts b/tests/pw/tests/api/refunds.spec.ts index 68bebcd21f..b9027c12ac 100644 --- a/tests/pw/tests/api/refunds.spec.ts +++ b/tests/pw/tests/api/refunds.spec.ts @@ -19,7 +19,7 @@ test.describe('refunds api test', () => { test.beforeAll(async () => { apiUtils = new ApiUtils(await request.newContext()); [, orderResponseBody] = await apiUtils.createOrderWithStatus(payloads.createProduct(), payloads.createOrder, 'wc-processing', payloads.vendorAuth); - [, refundId] = await dbUtils.createRefund(orderResponseBody); + [, refundId] = await dbUtils.createRefundRequest(orderResponseBody); }); test.afterAll(async () => { diff --git a/tests/pw/tests/e2e/modules.spec.ts b/tests/pw/tests/e2e/modules.spec.ts index 0b489e556b..61e78f1308 100644 --- a/tests/pw/tests/e2e/modules.spec.ts +++ b/tests/pw/tests/e2e/modules.spec.ts @@ -39,7 +39,7 @@ test.describe('Modules test', () => { }); test('admin can activate module @pro @a', async () => { - await apiUtils.deactivateModules([payloads.moduleIds.auction]); + await apiUtils.deactivateModules([payloads.moduleIds.auction], payloads.adminAuth); await admin.activateDeactivateModule(data.modules.modulesName.AuctionIntegration); }); diff --git a/tests/pw/tests/e2e/productAddons.spec.ts b/tests/pw/tests/e2e/productAddons.spec.ts index b11b964e54..9fb30626e2 100644 --- a/tests/pw/tests/e2e/productAddons.spec.ts +++ b/tests/pw/tests/e2e/productAddons.spec.ts @@ -17,7 +17,6 @@ test.describe('Product addon functionality test', () => { async function createVendorProductAddon(): Promise<[string, string, string]> { const [, addonId, addonName, addonFieldTitle] = await apiUtils.createProductAddon(payloads.createProductAddons(), payloads.adminAuth); await dbUtils.updateCell(addonId, VENDOR_ID); - console.log(addonId, addonName, addonFieldTitle); return [addonId, addonName, addonFieldTitle]; } diff --git a/tests/pw/tests/e2e/requestForQuotes.spec.ts b/tests/pw/tests/e2e/requestForQuotes.spec.ts index 4381d81643..14517a070b 100644 --- a/tests/pw/tests/e2e/requestForQuotes.spec.ts +++ b/tests/pw/tests/e2e/requestForQuotes.spec.ts @@ -87,9 +87,9 @@ test.describe('Request for quotation test vendor', () => { vPage = await vendorContext.newPage(); vendor = new RequestForQuotationsPage(vPage); - // apiUtils = new ApiUtils(await request.newContext()); - // [, productId[0], productName] = await apiUtils.createProduct(payloads.createProduct(), payloads.vendorAuth); - // [, quoteId, quoteTitle] = await apiUtils.createQuoteRequest({ ...payloads.createQuoteRequest(), product_ids: productId, user_id: CUSTOMER_ID }, payloads.adminAuth); + apiUtils = new ApiUtils(await request.newContext()); + [, productId[0], productName] = await apiUtils.createProduct(payloads.createProduct(), payloads.vendorAuth); + [, quoteId, quoteTitle] = await apiUtils.createQuoteRequest({ ...payloads.createQuoteRequest(), product_ids: productId, user_id: CUSTOMER_ID }, payloads.adminAuth); }); test.afterAll(async () => {