-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplaywright.prod.config.ts
More file actions
52 lines (48 loc) · 1.33 KB
/
Copy pathplaywright.prod.config.ts
File metadata and controls
52 lines (48 loc) · 1.33 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';
/**
* Playwright configuration for production-bundle smoke tests.
*
* Separate from playwright.config.ts because:
* - It points at the static-served dist (port 5557), not `ng serve` (port 5556)
* - It runs only e2e/prod-smoke.spec.ts — the boot regression canary
* - It must run *after* `pnpm build` so dist/Patcher/browser exists
*
* Local: `pnpm test:e2e:prod` builds + serves + runs.
* CI: invoked as its own matrix entry in .github/workflows/angular-tests.yml.
*/
const PORT = 5557;
const BASE_URL = `http://localhost:${ PORT }`;
export default defineConfig({
testDir: './e2e',
testMatch: ['**/prod-smoke.spec.ts'],
tsconfig: './e2e/tsconfig.json',
timeout: 30_000,
expect: {timeout: 5_000},
fullyParallel: true,
forbidOnly: !!process.env['CI'],
retries: process.env['CI'] ? 1 : 0,
workers: process.env['CI'] ? 1 : undefined,
reporter: 'list',
webServer: {
command: `node scripts/build/serve-dist.cjs`,
url: BASE_URL,
env: {PORT: String(PORT)},
reuseExistingServer: !process.env['CI'],
timeout: 60_000
},
use: {
baseURL: BASE_URL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
headless: true
},
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']}
}
]
});