-
Notifications
You must be signed in to change notification settings - Fork 19
/
playwright.config.ts
46 lines (41 loc) · 1.05 KB
/
playwright.config.ts
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
import { defineConfig, devices } from '@playwright/test';
import dotenv, { type DotenvPopulateInput } from 'dotenv';
import { join } from 'node:path';
import { readCanisterIds } from './env.utils';
dotenv.config({
path: join(process.cwd(), '.env.e2e')
});
dotenv.populate(
process.env as DotenvPopulateInput,
readCanisterIds({
filePath: join(process.cwd(), 'canister_e2e_ids.json'),
prefix: 'E2E_'
})
);
const DEV = (process.env.NODE_ENV ?? 'production') === 'development';
const TIMEOUT = 5 * 60 * 1000;
export default defineConfig({
timeout: TIMEOUT,
workers: DEV ? 5 : 2,
webServer: {
command: DEV ? 'npm run dev' : 'npm run build && npm run preview',
reuseExistingServer: true,
port: DEV ? 5173 : 4173,
timeout: TIMEOUT
},
testDir: 'e2e',
testMatch: ['**/*.e2e.ts', '**/*.spec.ts'],
use: {
testIdAttribute: 'data-tid',
trace: 'on',
actionTimeout: TIMEOUT,
navigationTimeout: TIMEOUT,
...(DEV && { headless: false })
},
projects: [
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' }
}
]
});