-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
37 lines (35 loc) · 961 Bytes
/
playwright.config.ts
File metadata and controls
37 lines (35 loc) · 961 Bytes
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
import path from 'path'
import { defineConfig, devices } from '@playwright/test'
import config from './src/utils/config'
const TEST_PORT = process.env.TEST_PORT || 5000
const baseURL = `http://localhost:${TEST_PORT}`
export default defineConfig({
timeout: 30 * 1000,
testDir: path.join(__dirname, 'e2e'),
retries: 0, // Set retries to 0 to avoid flaky tests and speed up test runs
outputDir: 'test-results/',
webServer: {
command: 'yarn dev',
url: baseURL,
timeout: 120 * 1000,
reuseExistingServer: config.CI !== 'true',
env: {
...process.env,
PORT: String(TEST_PORT),
NODE_ENV: 'test',
NEXTAUTH_URL: baseURL, // Ensure NextAuth works in test
},
},
globalSetup: require.resolve('./scripts/setup-test-db.js'),
use: {
baseURL,
trace: 'retry-with-trace',
headless: true,
},
projects: [
{
name: 'Desktop Chrome',
use: { ...devices['Desktop Chrome'] },
},
],
})