-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
45 lines (44 loc) · 1.23 KB
/
Copy pathplaywright.config.js
File metadata and controls
45 lines (44 loc) · 1.23 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
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E configuration.
*
* The dev server must be running (npm run dev from repo root) before executing
* these tests. The backend must have ALLOW_TEST_SESSION=true set so the
* POST /api/auth/test-session endpoint is available for auth seeding.
*
* Run with:
* npx playwright test
*
* Or to run with UI:
* npx playwright test --ui
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: false, // Run sequentially - tests share a DB user state
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
timeout: 30000,
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npm run dev -- --host 127.0.0.1 --strictPort --port 5173',
cwd: './client',
env: {
...process.env,
VITE_API_URL: 'http://127.0.0.1:5000/api'
},
url: 'http://127.0.0.1:5173',
reuseExistingServer: true,
timeout: 30000
},
// The Express server must be up separately on port 5000 with ALLOW_TEST_SESSION=true.
});