-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
47 lines (43 loc) · 1.23 KB
/
playwright.config.ts
File metadata and controls
47 lines (43 loc) · 1.23 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
import { existsSync } from 'node:fs';
import { defineConfig, devices } from '@playwright/test';
const chromiumExecutablePath =
process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH || resolveChromiumExecutablePath();
function resolveChromiumExecutablePath(): string | undefined {
const candidates = [
'/usr/bin/chromium-browser',
'/usr/bin/chromium',
'/home/vscode/.cache/ms-playwright/chromium-1217/chrome-linux/chrome',
];
return candidates.find((candidate) => existsSync(candidate));
}
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'list',
use: {
baseURL: 'http://127.0.0.1:4001',
headless: true,
trace: 'on-first-retry',
launchOptions: chromiumExecutablePath
? {
executablePath: chromiumExecutablePath,
args: ['--no-sandbox'],
}
: undefined,
},
webServer: {
command: 'pnpm run dev -- --host 0.0.0.0 --port 4001',
url: 'http://127.0.0.1:4001',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});