-
-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
44 lines (40 loc) · 1.14 KB
/
Copy pathplaywright.config.ts
File metadata and controls
44 lines (40 loc) · 1.14 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
import { defineConfig, devices } from '@playwright/test'
import { env } from './src/env'
const baseURL = 'http://localhost:3000'
export default defineConfig({
testDir: './src/tests/e2e',
fullyParallel: !env.CI,
forbidOnly: env.CI,
retries: env.CI ? 2 : 1,
workers: env.CI ? 1 : '50%',
reporter: 'html',
use: {
baseURL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
...devices['Desktop Chrome'],
contextOptions: {
permissions: ['clipboard-read', 'clipboard-write'],
},
},
expect: { timeout: 5000 },
projects: [
{ name: 'setup', testMatch: '**/*.setup.ts', teardown: 'teardown' },
{
name: 'authenticated',
testMatch: 'authenticated/**/*.test.ts',
use: {
storageState: './src/tests/e2e/.auth/user.json',
},
dependencies: ['setup'],
},
{ name: 'unauthenticated', testMatch: 'unauthenticated/**/*.test.ts', dependencies: ['setup'] },
{ name: 'teardown', testMatch: '**/*.teardown.ts' },
],
webServer: {
command: env.CI ? 'bun start' : 'bun dev',
url: baseURL,
reuseExistingServer: !env.CI,
},
})