-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
57 lines (53 loc) · 1.57 KB
/
Copy pathplaywright.config.js
File metadata and controls
57 lines (53 loc) · 1.57 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
import fs from 'node:fs';
import { defineConfig, devices } from '@playwright/test';
const baseURL = process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:3101';
const syncWorkerUrl = process.env.VITE_SYNC_WORKER_URL || 'https://sync.tasktime.pro';
const chromiumExecutablePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH
|| ['/usr/bin/chromium-browser', '/usr/bin/chromium'].find((candidate) => fs.existsSync(candidate));
const launchOptions = {
args: ['--no-sandbox', '--disable-dev-shm-usage'],
...(chromiumExecutablePath ? { executablePath: chromiumExecutablePath } : {}),
};
export default defineConfig({
testDir: './e2e',
timeout: 60_000,
expect: {
timeout: 10_000,
},
fullyParallel: false,
retries: process.env.CI ? 2 : 0,
reporter: 'list',
use: {
baseURL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'off',
},
webServer: {
command: `VITE_SYNC_WORKER_URL=${syncWorkerUrl} npm run dev -- --host 0.0.0.0 --port 3101`,
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
launchOptions,
},
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
},
],
});