-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
57 lines (56 loc) · 1.72 KB
/
Copy pathplaywright.config.ts
File metadata and controls
57 lines (56 loc) · 1.72 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';
export default defineConfig({
testDir: './e2e/tests',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: [['html', { open: 'never' }], ['list']],
timeout: 60000,
// Snapshot configuration for visual regression
// Platform-specific snapshots: linux/ for CI, darwin/ for local macOS
snapshotDir: './e2e/snapshots',
snapshotPathTemplate: '{snapshotDir}/{testFilePath}/{platform}/{arg}{ext}',
expect: {
toHaveScreenshot: {
maxDiffPixels: 100,
maxDiffPixelRatio: 0.01,
animations: 'disabled',
},
},
use: {
baseURL: 'https://localhost:3001',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
ignoreHTTPSErrors: true,
// Consistent viewport for visual regression
viewport: { width: 1280, height: 720 },
},
projects: [
{
name: 'themed',
testMatch: /.*(?<!unthemed-regression)\.spec\.ts$/,
use: { ...devices['Desktop Chrome'] },
},
{
name: 'unthemed',
testMatch: /unthemed-regression\.spec\.ts$/,
use: { ...devices['Desktop Chrome'] },
},
],
webServer: [
{
command: `THEME_FIXTURE=${process.env.THEME_FIXTURE || 'withFullCustomTheme'} node e2e/fixture-server.js`,
url: 'http://localhost:8001/metaData',
reuseExistingServer: true,
timeout: 60000, // 1 minute - Docker startup can be slow
},
{
command: 'HTTPS=true PORT=3001 REACT_APP_PROXY_LOCALHOST_PORT=8001 npm start',
url: 'https://localhost:3001',
reuseExistingServer: true,
timeout: 300000, // 5 minutes - React compilation in Docker takes time
ignoreHTTPSErrors: true,
},
],
});