-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (51 loc) · 1.54 KB
/
playwright.config.ts
File metadata and controls
52 lines (51 loc) · 1.54 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
45
46
47
48
49
50
51
52
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: 'tests/e2e',
globalSetup: require.resolve('./tests/e2e/global-setup.js'),
globalTeardown: require.resolve('./tests/e2e/global-teardown.js'),
timeout: 30 * 1000,
expect: { timeout: 5000 },
fullyParallel: true,
retries: 0,
workers: 1,
use: {
headless: true,
viewport: { width: 1280, height: 720 },
actionTimeout: 5000,
baseURL: process.env.BASE_URL || 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
// Setup project to authenticate once
{
name: 'setup',
testMatch: /auth\.setup\.ts/,
},
// Auth tests run without stored state (testing login/logout)
{
name: 'auth-tests',
testMatch: /auth\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
launchOptions: {
args: ['--no-sandbox'],
},
},
},
// Main test project that depends on setup
{
name: 'chromium',
testMatch: /.*\.spec\.ts/,
testIgnore: /auth\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
launchOptions: {
args: ['--no-sandbox'],
},
// Use stored authentication state
storageState: '.auth/user.json',
},
dependencies: ['setup'],
},
],
});