diff --git a/playwright/e2e/validateJsuiVersion.ts b/playwright/e2e/validateJsuiVersion.ts index 69e67b974..7728e38da 100644 --- a/playwright/e2e/validateJsuiVersion.ts +++ b/playwright/e2e/validateJsuiVersion.ts @@ -3,17 +3,22 @@ import {test, expect} from '@playwright/test'; import {pageURL} from '../utils/utils'; const expectedJsuiVersion = process.env.JSUI_VERSION; -console.log(`Expected JSUI version: ${expectedJsuiVersion}`); +const timeout = 180_000; if (expectedJsuiVersion) { + console.log(`Expected JSUI version: ${expectedJsuiVersion}`); + test('validate JSUI version', async ({page}) => { - test.setTimeout(180_000); - await page.goto(pageURL()); - const coveoVersion = await page.evaluate(() => (window as any).Coveo.version); - // Example value: {lib: '2.10120.0', product: '2.10120.0', supportedApiVersion: 2} - expect(coveoVersion.lib).toBe(expectedJsuiVersion); - expect(coveoVersion.product).toBe(expectedJsuiVersion); + test.setTimeout(timeout); + await expect(async () => { + await page.goto(pageURL()); + const coveoVersion = await page.evaluate(() => (window as any).Coveo.version); + // Example value: {lib: '2.10120.0', product: '2.10120.0', supportedApiVersion: 2} + expect(coveoVersion.lib).toBe(expectedJsuiVersion); + expect(coveoVersion.product).toBe(expectedJsuiVersion); + }).toPass({timeout}); }); + } else { console.log('No JSUI version to validate.'); }