-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
39 lines (36 loc) · 1.18 KB
/
playwright.config.js
File metadata and controls
39 lines (36 loc) · 1.18 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
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
// Load .env file for local development (GITHUB_AUTH_STATE, API_CONTRACT_TEST_PAT)
dotenv.config({ quiet: true });
// Prevent list reporter from truncating test names
process.stdout.columns = 200;
export default defineConfig({
globalSetup: './tests/global-setup.js',
testDir: './tests/chrome',
snapshotPathTemplate: '{snapshotDir}/{arg}{ext}',
snapshotDir: './tests/screenshots/chrome',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
outputDir: './tests/runs/chrome/results',
reporter: [['list'], ['html', { open: 'never', outputFolder: './tests/runs/chrome/report' }]],
use: {
trace: 'on-first-retry',
},
expect: {
toHaveScreenshot: {
// 2% threshold: tolerates system font differences across platforms
// (macOS: San Francisco, Linux: Noto Sans/DejaVu, Windows: Segoe UI)
maxDiffPixelRatio: 0.02,
// Per-pixel threshold: allow slight color variance from anti-aliasing
threshold: 0.2,
},
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});