-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathplaywright.config.js
More file actions
58 lines (48 loc) · 1.68 KB
/
Copy pathplaywright.config.js
File metadata and controls
58 lines (48 loc) · 1.68 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
58
// @ts-check
const { defineConfig, devices } = require('@playwright/test');
/**
* Playwright configuration for smoke and integration tests.
*
* Test Types:
* - Smoke tests (./tests/smoke): Fast, critical path tests for production containers
* - Integration tests (./tests/integration): Module-specific functional tests
*
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
// Test directory: defaults to smoke tests, but can be overridden for integration tests
// Integration tests use tags (e.g., @people-teams) to filter by module
testDir: './tests',
// Each test can run for a max of 30 seconds
timeout: 30 * 1000,
// Run tests in parallel
fullyParallel: true,
// Fail the build on CI if tests were accidentally left in exclusive mode
forbidOnly: !!process.env.CI,
// No retries - tests should be stable, failures indicate real problems
retries: 0,
// Single worker in CI to avoid resource contention
workers: process.env.CI ? 1 : undefined,
// Reporter config
reporter: process.env.CI
? [['list'], ['github']] // CI: console + GitHub annotations
: [['list']], // Local: console only
use: {
baseURL: process.env.BASE_URL || 'http://localhost:5173',
actionTimeout: 10 * 1000,
},
// Web server configuration - only for local dev (not used in container tests)
webServer: process.env.CI ? undefined : {
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
},
// Test projects - Chromium only for fast CI tests
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});