-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
56 lines (49 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
46
47
48
49
50
51
52
53
54
55
56
import { defineConfig, devices } from '@playwright/test';
const PORT = process.env.PORT || '3000';
export default defineConfig({
testDir: './tests/playwright',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: !!process.env.CI ? 'github' : 'html',
use: {
baseURL: `http://localhost:${PORT}/`,
trace: 'on-first-retry',
},
projects: [
{ name: 'setup', testMatch: /\/tests\/playwright\/.*\.setup\.ts/ },
{
name: 'Authenticated user',
use: {
...devices['Desktop Chrome'],
storageState: 'tests/playwright/.auth/user.json',
},
testIgnore: /\/tests\/playwright\/.*\.login\.spec\.ts/,
dependencies: ['setup'],
},
{
name: 'Unauthenticated user',
use: {
...devices['Desktop Chrome'],
},
testMatch: /\/tests\/playwright\/.*\.login\.spec\.ts/,
},
],
timeout: 15 * 1000,
expect: {
timeout: 5 * 1000,
},
webServer: {
// @FIXME: Optimize webserver command
//command: 'npm run test:e2e:webserver',
command: 'npm run dev',
port: Number(PORT),
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
stderr: 'pipe',
env: {
PORT,
},
},
});