-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.audits.config.mjs
More file actions
63 lines (61 loc) · 1.8 KB
/
Copy pathplaywright.audits.config.mjs
File metadata and controls
63 lines (61 loc) · 1.8 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
59
60
61
62
63
import { defineConfig } from '@playwright/test';
const host = process.env.PLAYWRIGHT_HOST ?? '127.0.0.1';
const port = Number.parseInt(process.env.PLAYWRIGHT_AUDIT_PORT ?? process.env.PLAYWRIGHT_PORT ?? '4324', 10);
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://${host}:${port}`;
const launchOptions = process.env.CHROME_PATH
? { executablePath: process.env.CHROME_PATH }
: undefined;
export default defineConfig({
testDir: './tests/playwright',
outputDir: '.tmp/playwright-results',
snapshotPathTemplate: '{testDir}/__screenshots__/{projectName}/{arg}{ext}',
timeout: 90_000,
expect: {
timeout: 10_000,
toHaveScreenshot: {
animations: 'disabled',
caret: 'hide',
maxDiffPixelRatio: 0.015,
},
},
fullyParallel: false,
forbidOnly: Boolean(process.env.CI),
retries: 0,
workers: 1,
reporter: [
['list'],
['html', { outputFolder: '.tmp/playwright-report', open: 'never' }],
],
use: {
baseURL,
browserName: 'chromium',
colorScheme: 'dark',
deviceScaleFactor: 1,
locale: 'en-US',
reducedMotion: 'reduce',
screenshot: 'only-on-failure',
serviceWorkers: 'block',
timezoneId: 'UTC',
trace: 'retain-on-failure',
video: 'off',
...(launchOptions ? { launchOptions } : {}),
},
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: `npm run preview -- --host ${host} --port ${port}`,
url: baseURL,
reuseExistingServer: false,
timeout: 60_000,
},
projects: [
{
name: 'chromium',
use: { browserName: 'chromium', colorScheme: 'dark', ...(launchOptions ? { launchOptions } : {}) },
},
{
name: 'chromium-light',
use: { browserName: 'chromium', colorScheme: 'light', ...(launchOptions ? { launchOptions } : {}) },
},
],
});