-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (51 loc) · 1.51 KB
/
playwright.config.ts
File metadata and controls
52 lines (51 loc) · 1.51 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 E2E Test Configuration
*
* E2E tests run against a dedicated test stack:
* - `make e2e` starts the E2E stack on port 8766 and runs tests
* - `make e2e-up` starts only the stack for manual testing
* - `make e2e-run` runs tests against an already-running stack
*
* The E2E stack uses:
* - APP_ENV=test with .env.test.local overrides
* - Local LDAP server (ldap-dev container)
* - Main database with test users
*
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
// In CI with sharding, use 2 workers per shard for parallelism
workers: process.env.CI ? 2 : undefined,
reporter: [
['html', { open: 'never' }],
['list'],
],
use: {
// E2E stack runs on port 8766 by default
baseURL: process.env.E2E_BASE_URL || 'http://localhost:8766',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
// Web server is managed by Makefile (make e2e-up)
// Use `make e2e` to run tests with automatic stack management
webServer: process.env.CI
? undefined
: {
command: 'make e2e-up',
url: 'http://localhost:8766/login',
reuseExistingServer: true,
timeout: 120000, // 2 minutes for container startup
},
});