-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
62 lines (58 loc) · 1.37 KB
/
Copy pathplaywright.config.ts
File metadata and controls
62 lines (58 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig, devices } from '@playwright/test';
const isCI = !!process.env['CI'];
const noProxyEnv = {
no_proxy: 'localhost,127.0.0.1,::1',
NO_PROXY: 'localhost,127.0.0.1,::1',
};
const browserLaunchOptions = {
args: ['--proxy-server=direct://', ...(isCI ? ['--no-sandbox'] : [])],
env: {
...process.env,
...noProxyEnv,
},
};
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
...(isCI ? { workers: 1 } : {}),
reporter: isCI ? 'github' : 'list',
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
ignoreHTTPSErrors: true,
launchOptions: browserLaunchOptions,
},
projects: [
{
name: 'chromium-desktop',
use: { ...devices['Desktop Chrome'], launchOptions: browserLaunchOptions },
},
{
name: 'chromium-mobile',
use: { ...devices['Pixel 7'], launchOptions: browserLaunchOptions },
},
],
webServer: [
{
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !isCI,
timeout: 30_000,
env: {
...noProxyEnv,
},
},
{
command: 'npm run signaling',
url: 'http://localhost:7777/health',
reuseExistingServer: !isCI,
timeout: 15_000,
env: {
...noProxyEnv,
},
},
],
});