|
1 | | -import type { PlaywrightTestConfig } from '@playwright/test'; |
2 | | -import { devices } from '@playwright/test'; |
| 1 | +import { getPlaywrightConfig } from '@sentry-internal/test-utils'; |
3 | 2 |
|
4 | 3 | // Fix urls not resolving to localhost on Node v17+ |
5 | 4 | // See: https://github.com/axios/axios/issues/3821#issuecomment-1413727575 |
6 | 5 | import { setDefaultResultOrder } from 'dns'; |
7 | 6 | setDefaultResultOrder('ipv4first'); |
8 | 7 |
|
9 | 8 | const eventProxyPort = 3031; |
10 | | -const lambdaPort = 3030; |
11 | 9 |
|
12 | 10 | /** |
13 | 11 | * See https://playwright.dev/docs/test-configuration. |
14 | 12 | */ |
15 | | -const config: PlaywrightTestConfig = { |
16 | | - testDir: './tests', |
17 | | - /* Maximum time one test can run for. */ |
18 | | - timeout: 150_000, |
19 | | - expect: { |
20 | | - /** |
21 | | - * Maximum time expect() should wait for the condition to be met. |
22 | | - * For example in `await expect(locator).toHaveText();` |
23 | | - */ |
24 | | - timeout: 5000, |
25 | | - }, |
26 | | - /* Run tests in files in parallel */ |
27 | | - fullyParallel: true, |
28 | | - /* Fail the build on CI if you accidentally left test.only in the source code. */ |
29 | | - forbidOnly: !!process.env.CI, |
30 | | - /* Retry on CI only */ |
31 | | - retries: 0, |
32 | | - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
33 | | - reporter: 'list', |
34 | | - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
35 | | - use: { |
36 | | - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ |
37 | | - actionTimeout: 0, |
38 | | - |
39 | | - /* Base URL to use in actions like `await page.goto('/')`. */ |
40 | | - baseURL: `http://localhost:${lambdaPort}`, |
41 | | - |
42 | | - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
43 | | - trace: 'on-first-retry', |
44 | | - }, |
45 | | - |
46 | | - /* Configure projects for major browsers */ |
47 | | - projects: [ |
48 | | - { |
49 | | - name: 'chromium', |
50 | | - use: { |
51 | | - ...devices['Desktop Chrome'], |
| 13 | +const config = getPlaywrightConfig( |
| 14 | + { startCommand: '' }, |
| 15 | + { |
| 16 | + /* Run your local dev server before starting the tests */ |
| 17 | + webServer: [ |
| 18 | + { |
| 19 | + command: `node start-event-proxy.mjs && pnpm wait-port ${eventProxyPort}`, |
| 20 | + port: eventProxyPort, |
| 21 | + stdout: 'pipe', |
52 | 22 | }, |
53 | | - }, |
54 | | - // For now we only test Chrome! |
55 | | - // { |
56 | | - // name: 'firefox', |
57 | | - // use: { |
58 | | - // ...devices['Desktop Firefox'], |
59 | | - // }, |
60 | | - // }, |
61 | | - // { |
62 | | - // name: 'webkit', |
63 | | - // use: { |
64 | | - // ...devices['Desktop Safari'], |
65 | | - // }, |
66 | | - // }, |
67 | | - ], |
68 | | - |
69 | | - /* Run your local dev server before starting the tests */ |
70 | | - webServer: [ |
71 | | - { |
72 | | - command: `node start-event-proxy.mjs && pnpm wait-port ${eventProxyPort}`, |
73 | | - port: eventProxyPort, |
74 | | - stdout: 'pipe', |
75 | | - }, |
76 | | - ], |
77 | | -}; |
| 23 | + ], |
| 24 | + }, |
| 25 | +); |
78 | 26 |
|
79 | 27 | export default config; |
0 commit comments