playwright.config.ts
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 { defineConfig, devices } from '@playwright/test';
const isCI = Boolean(process.env.CI);
const singlePageApiTarget = process.env.E2E_SINGLE_PAGE_API_TARGET || 'http://192.168.1.191:8000/';
export default defineConfig({
testDir: './tests',
timeout: 30_000,
expect: {
timeout: 8_000,
},
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
workers: isCI ? 1 : undefined,
reporter: [['list'], ['html', { open: 'never' }]],
use: {
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'agent-admin-web',
testMatch: /agent-admin-web\/.*\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
baseURL: 'http://127.0.0.1:5173',
},
webServer: {
command: 'npm run dev -- --host 127.0.0.1 --port 5173',
cwd: '../workspace/agent-admin/web',
url: 'http://127.0.0.1:5173',
reuseExistingServer: !isCI,
timeout: 120_000,
},
},
{
name: 'agent-admin-single-page',
testMatch: /agent-admin-single-page\/.*\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
baseURL: 'http://127.0.0.1:3001/gl-agent-position/',
},
webServer: {
command: 'npm run dev -- --host 127.0.0.1 --port 3001',
cwd: '../workspace/agent-admin/single-page',
env: {
VITE_API_PROXY_TARGET: singlePageApiTarget,
},
url: 'http://127.0.0.1:3001/gl-agent-position/',
reuseExistingServer: !isCI,
timeout: 120_000,
},
},
],
});