-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplaywright.config.js
40 lines (36 loc) · 1.19 KB
/
playwright.config.js
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
import os from 'node:os';
import { defineConfig } from '@playwright/test';
export default defineConfig({
fullyParallel: true,
globalSetup: './playwright.setup.js',
outputDir: './dist/playwright',
projects: [
{
name: 'aria',
snapshotPathTemplate: './src/aria-snapshots/{arg}{ext}',
testMatch: /.*\.test\.aria\.ts/,
},
{
name: 'visuals',
// For whatever reason, Playwright can't find snapshots that exist
// in an subdirectory of `outputDir`. So they're at the top level.
snapshotPathTemplate: './dist/playwright-baseline-screenshots/{arg}{ext}',
testMatch: /.*\.test\.visuals\.ts/,
// 30 seconds is the default. Each test should only take a couple seconds.
// Something has gone wrong if one takes longer. So we fail fast to give
// developers feedback.
timeout: 5000,
},
],
reporter: process.env.CI ? 'blob' : 'line',
testDir: './src/',
use: {
baseURL: 'http://localhost:6006/iframe.html',
},
webServer: {
command: 'pnpm start:development:storybook',
reuseExistingServer: true,
url: 'http://localhost:6006',
},
workers: process.env.CI ? os.cpus().length : os.cpus().length / 2,
});