Skip to content

Commit 6f93dc3

Browse files
committed
streamline playwright config
1 parent 9d0c186 commit 6f93dc3

File tree

1 file changed

+13
-65
lines changed

1 file changed

+13
-65
lines changed
Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,27 @@
1-
import type { PlaywrightTestConfig } from '@playwright/test';
2-
import { devices } from '@playwright/test';
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
32

43
// Fix urls not resolving to localhost on Node v17+
54
// See: https://github.com/axios/axios/issues/3821#issuecomment-1413727575
65
import { setDefaultResultOrder } from 'dns';
76
setDefaultResultOrder('ipv4first');
87

98
const eventProxyPort = 3031;
10-
const lambdaPort = 3030;
119

1210
/**
1311
* See https://playwright.dev/docs/test-configuration.
1412
*/
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',
5222
},
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+
);
7826

7927
export default config;

0 commit comments

Comments
 (0)