Skip to content

Commit e6bf0e7

Browse files
authored
e2e tests: fix setup (#875)
1 parent 1bf959c commit e6bf0e7

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

test/e2e/playwright.config.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,24 @@ export default defineConfig({
2929
/* Configure projects for major browsers */
3030
projects: [
3131
{
32-
name: 'Setup esm deploy url',
33-
testMatch: 'test/Setup/global.setup.ts',
32+
name: 'setup',
33+
testMatch: 'specs/Setup/global.setup.ts',
34+
use: {
35+
...devices['Desktop Chrome'],
36+
channel: 'chrome',
37+
},
3438
},
3539
{
36-
name: 'ESM',
40+
name: 'esm',
3741
testMatch: 'test/e2e/specs/ESM/**/*.spec.ts',
3842
use: {
3943
...devices['Desktop Chrome'],
4044
channel: 'chrome',
4145
},
42-
dependencies: ['Setup esm deploy url'],
46+
dependencies: ['setup'],
4347
},
4448
{
45-
name: 'Non ESM',
49+
name: 'non esm',
4650
testMatch: 'test/e2e/specs/NonESM/**/*.spec.ts',
4751
use: {
4852
...devices['Desktop Chrome'],
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { ExampleLinkType } from '../../types/exampleLinkType';
2-
import { expect, Page } from '@playwright/test';
2+
import { expect, Page, test } from '@playwright/test';
33
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
44
import { ESM_URL } from '../../testData/esmUrl';
55

6-
async function globalSetup(page: Page) {
6+
7+
/**
8+
* Ensures the esm deploy is ready by checking the 'Adaptive Streaming' link is visible at ESM_URL.
9+
*/
10+
test('global setup', async ({ page }) => {
711
if (ESM_URL) {
812
const link: ExampleLinkType = {
913
name: ExampleLinkName.AdaptiveStreaming,
1014
endpoint: 'adaptive-streaming',
1115
};
1216
await waitForDeployPreviewUrl(link, page);
1317
}
14-
}
18+
});
1519

1620
/**
1721
* Waits for a deploy preview URL to become available by making repeated requests and check that link is visible.
@@ -23,4 +27,4 @@ async function waitForDeployPreviewUrl(link: ExampleLinkType, page: Page): Promi
2327
await expect(linkLocator).toBeVisible({ timeout: 10000 });
2428
}).toPass({ intervals: [1_000], timeout: 120000 });
2529
}
26-
export default globalSetup;
30+

0 commit comments

Comments
 (0)