-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
49 lines (43 loc) · 1.07 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
import Path from 'node:path'
import { defineConfig, devices } from '@playwright/test'
import appRootPath from 'app-root-path'
process.env.DATABASE_URL = ':memory:'
export default defineConfig({
forbidOnly: process.env.CI === 'true',
fullyParallel: true,
projects: [
{
// https://playwright.dev/docs/auth
name: 'setup',
testMatch: /.*\.setup\.ts/,
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'tests',
use: {
...devices['Desktop Chrome'],
storageState: Path.join(appRootPath.path, 'e2e', 'user.json'),
screenshot: 'only-on-failure',
},
dependencies: ['setup'],
},
],
reporter: 'html',
retries: process.env.CI ? 2 : 0,
testDir: './e2e',
use: {
trace: 'on-first-retry',
},
webServer: {
command:
'node --run clean && ENABLE_SOURCEMAPS=true node --run build && node --run start',
reuseExistingServer: !process.env.CI,
url: 'http://localhost:3000',
},
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
globalSetup: 'e2e/global.setup.ts',
globalTeardown: 'e2e/global.teardown.ts',
})