-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
48 lines (42 loc) · 1.31 KB
/
playwright.config.js
File metadata and controls
48 lines (42 loc) · 1.31 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
/**
* Playwright configuration for Abacus E2E tests
*/
// @ts-check
const { defineConfig } = require('playwright/test');
const path = require('path');
const PLAYWRIGHT_HOME = path.join(__dirname, '.playwright-home');
const PORT = process.env.PLAYWRIGHT_PORT || '3100';
const BASE_URL = process.env.PLAYWRIGHT_BASE_URL || `http://127.0.0.1:${PORT}`;
module.exports = defineConfig({
testDir: './tests/e2e',
timeout: 30_000,
expect: {
timeout: 5_000
},
// Disable parallel execution because tests share a single server with in-memory state.
// The server's ProjectsDB loads at startup and doesn't reload when tests reset the config file.
fullyParallel: false,
workers: 1,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list',
use: {
baseURL: BASE_URL,
headless: process.env.PW_HEADLESS ? process.env.PW_HEADLESS !== 'false' : true,
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'retain-on-failure'
},
webServer: {
command: 'node server.js',
url: BASE_URL,
reuseExistingServer: false,
timeout: 60_000,
env: {
...process.env,
PORT,
// Avoid polluting the developer's home with Abacus config.
HOME: PLAYWRIGHT_HOME,
USERPROFILE: PLAYWRIGHT_HOME
}
}
});