Repository navigation
Expand file tree
/
Copy pathplaywright.config.js
More file actions
52 lines (50 loc) · 1.69 KB
/
Copy pathplaywright.config.js
File metadata and controls
52 lines (50 loc) · 1.69 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
import { defineConfig, devices } from '@playwright/test';
import { existsSync } from 'node:fs';
// Use Playwright's matching browser by default, including on Linux. A system
// browser is an explicit opt-in rather than an automatic distro dependency.
const systemChromePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH || undefined;
if (systemChromePath && !existsSync(systemChromePath)) {
throw new Error(`Chromium executable does not exist: ${systemChromePath}`);
}
export default defineConfig({
testDir: './tests/e2e',
timeout: 60000,
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
// Real inference uses SwiftShader. Running one browser per CPU core can
// starve even UI-only tests; --workers remains available as an override.
workers: 1,
reporter: 'html',
use: {
baseURL: 'http://localhost:8080',
trace: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
launchOptions: {
executablePath: systemChromePath,
args: [
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
`--use-file-for-fake-video-capture=${require('path').join(__dirname, 'tests/fixtures/mock-face.y4m')}`,
'--autoplay-policy=no-user-gesture-required',
'--use-angle=swiftshader',
'--use-gl=angle',
'--enable-webgl',
'--ignore-gpu-blocklist',
],
},
permissions: ['camera', 'microphone'],
},
},
],
webServer: {
command: 'npx http-server -p 8080',
url: 'http://localhost:8080',
reuseExistingServer: !process.env.CI,
},
});