-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
53 lines (51 loc) · 1.44 KB
/
Copy pathplaywright.config.js
File metadata and controls
53 lines (51 loc) · 1.44 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
53
const { defineConfig, devices } = require('@playwright/test');
const BACKEND_PORT = process.env.BACKEND_PORT || '3001';
const FRONTEND_PORT = process.env.FRONTEND_PORT || '3000';
module.exports = defineConfig({
testDir: './test/e2e',
outputDir: './test/e2e/test-results',
fullyParallel: false,
workers: 1,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
timeout: 60_000,
expect: { timeout: 15_000 },
reporter: [
['list'],
['html', { outputFolder: 'test/e2e/playwright-report', open: 'never' }]
],
use: {
baseURL: `http://localhost:${FRONTEND_PORT}`,
headless: true,
viewport: { width: 1280, height: 800 },
launchOptions: { slowMo: Number(process.env.PW_SLOWMO || 0) },
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: process.env.PW_VIDEO || 'retain-on-failure'
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}
],
webServer: [
{
command: 'bash test/db/reset-test-db.sh && node --env-file=back/.env.test back/server.js',
url: `http://localhost:${BACKEND_PORT}/health`,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: 'pipe',
stderr: 'pipe'
},
{
command: 'npm run dev',
cwd: 'front',
url: `http://localhost:${FRONTEND_PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: 'pipe',
stderr: 'pipe'
}
]
});