-
Notifications
You must be signed in to change notification settings - Fork 116
/
playwright.config.ts
51 lines (45 loc) · 1.32 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
46
47
48
49
50
51
// eslint-disable-next-line import/no-nodejs-modules
import path from 'node:path'
import type {PlaywrightTestConfig} from '@playwright/test'
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: path.join(__dirname, 'test', 'playwright'),
testMatch: '**/*.test.ts',
/* Maximum time one test can run for. */
timeout: 10 * 1000,
// https://playwright.dev/docs/api/class-testconfig#test-config-output-dir
outputDir: path.join(__dirname, '.playwright', 'results'),
snapshotDir: path.join(__dirname, '.playwright', 'screenshots'),
/* Run tests in files in parallel */
fullyParallel: true,
workers: process.env.CI ? 4 : undefined,
updateSnapshots: 'all',
use: {
baseURL: 'http://127.0.0.1:4000',
browserName: 'chromium',
headless: true,
screenshot: 'only-on-failure',
},
expect: {
toHaveScreenshot: {
animations: 'disabled',
},
toMatchSnapshot: {
threshold: 0.1,
},
},
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
reporter: [
['line'],
['html', {open: 'never', outputFolder: path.join(__dirname, '.playwright/report')}],
['json', {outputFile: path.join(__dirname, '.playwright', 'results.json')}],
],
webServer: {
command: 'script/dev',
port: 4000,
},
}
export default config