-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
45 lines (41 loc) · 1.32 KB
/
Copy pathplaywright.config.ts
File metadata and controls
45 lines (41 loc) · 1.32 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
import { existsSync } from 'fs';
import { defineConfig } from '@playwright/test';
const loopbackNoProxy = '127.0.0.1,localhost,::1';
process.env.NO_PROXY = process.env.NO_PROXY ? `${process.env.NO_PROXY},${loopbackNoProxy}` : loopbackNoProxy;
process.env.no_proxy = process.env.no_proxy ? `${process.env.no_proxy},${loopbackNoProxy}` : loopbackNoProxy;
const chromiumCandidates = [
process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,
'/usr/bin/google-chrome-stable',
'/usr/bin/chromium',
].filter((value): value is string => Boolean(value));
const chromiumExecutablePath = chromiumCandidates.find(candidate => existsSync(candidate));
export default defineConfig({
testDir: './test/ui',
fullyParallel: false,
reporter: 'line',
timeout: 90_000,
expect: {
timeout: 15_000,
},
use: {
baseURL: 'http://127.0.0.1:4173',
viewport: {
width: 1440,
height: 1100,
},
trace: 'on-first-retry',
launchOptions: {
executablePath: chromiumExecutablePath,
args: [
'--no-sandbox',
'--disable-dev-shm-usage',
],
},
},
webServer: {
command: 'cross-env VITE_NETEASE_API_BASE=http://127.0.0.1:4173/__mock_netease__ npm run dev -- --host 127.0.0.1 --port 4173 --strictPort',
url: 'http://127.0.0.1:4173',
reuseExistingServer: true,
timeout: 120_000,
},
});