Skip to content

Commit

Permalink
add expect/toPass loop
Browse files Browse the repository at this point in the history
JSUI-3539
  • Loading branch information
wmannard committed Oct 15, 2024
1 parent 284a02a commit 58da2cb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions playwright/e2e/validateJsuiVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Check failure on line 19 in playwright/e2e/validateJsuiVersion.ts

View workflow job for this annotation

GitHub Actions / e2e-certifier

[validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version

1) [validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version ───────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: "2.10120.1" Received: "2.10120.0" Call Log: - Test timeout of 180000ms exceeded 17 | expect(coveoVersion.lib).toBe(expectedJsuiVersion); 18 | expect(coveoVersion.product).toBe(expectedJsuiVersion); > 19 | }).toPass({timeout}); | ^ 20 | }); 21 | 22 | } else { at /home/runner/work/search-ui/search-ui/playwright/e2e/validateJsuiVersion.ts:19:12

Check failure on line 19 in playwright/e2e/validateJsuiVersion.ts

View workflow job for this annotation

GitHub Actions / e2e-certifier

[validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version

1) [validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version ───────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: "2.10120.1" Received: "2.10120.0" Call Log: - Test timeout of 180000ms exceeded 17 | expect(coveoVersion.lib).toBe(expectedJsuiVersion); 18 | expect(coveoVersion.product).toBe(expectedJsuiVersion); > 19 | }).toPass({timeout}); | ^ 20 | }); 21 | 22 | } else { at /home/runner/work/search-ui/search-ui/playwright/e2e/validateJsuiVersion.ts:19:12

Check failure on line 19 in playwright/e2e/validateJsuiVersion.ts

View workflow job for this annotation

GitHub Actions / e2e-certifier

[validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version

1) [validate-jsui-version] › validateJsuiVersion.ts:11:9 › validate JSUI version ───────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: "2.10120.1" Received: "2.10120.0" Call Log: - Test timeout of 180000ms exceeded 17 | expect(coveoVersion.lib).toBe(expectedJsuiVersion); 18 | expect(coveoVersion.product).toBe(expectedJsuiVersion); > 19 | }).toPass({timeout}); | ^ 20 | }); 21 | 22 | } else { at /home/runner/work/search-ui/search-ui/playwright/e2e/validateJsuiVersion.ts:19:12
});

} else {
console.log('No JSUI version to validate.');
}

0 comments on commit 58da2cb

Please sign in to comment.