forked from primer/react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
45 lines (41 loc) · 1.26 KB
/
playwright.config.ts
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
import path from 'node:path'
import {defineConfig} from '@playwright/test'
import './e2e/matchers/toHaveNoViolations'
export default defineConfig({
// https://playwright.dev/docs/api/class-testconfig#test-config-test-dir
testDir: path.join(__dirname, 'e2e'),
testIgnore: ['**/matchers/**', '**/test-helpers/**'],
testMatch: '**/*.test.ts',
// https://playwright.dev/docs/api/class-testconfig#test-config-timeout
timeout: 1000 * 15,
// https://playwright.dev/docs/api/class-testconfig#test-config-output-dir
outputDir: path.join(__dirname, '.playwright', 'results'),
snapshotDir: path.join(__dirname, '.playwright', 'snapshots'),
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
use: {
screenshot: 'only-on-failure',
viewport: {
// Large breakpoint
// @see https://primer.style/primitives/spacing#breakpoints
width: 1012,
height: 768,
},
},
expect: {
toHaveScreenshot: {
animations: 'disabled',
},
},
reporter: [
['line'],
process.env.CI ? ['blob'] : ['html', {open: 'never', outputFolder: path.join(__dirname, '.playwright/report')}],
[
'json',
{
outputFile: path.join(__dirname, '.playwright', 'results.json'),
},
],
],
})