-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
32 lines (30 loc) · 964 Bytes
/
Copy pathplaywright.config.js
File metadata and controls
32 lines (30 loc) · 964 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
import { defineConfig, devices } from '@playwright/test';
const frontendPort = Number.parseInt(process.env.PLAYWRIGHT_PORT || '4173', 10);
const apiPort = Number.parseInt(process.env.PLAYWRIGHT_API_PORT || '3102', 10);
const baseURL = `http://127.0.0.1:${frontendPort}`;
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: false,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? 'github' : 'list',
use: {
baseURL,
trace: 'retain-on-failure',
},
projects: [
{ name: 'desktop-chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'mobile-chromium', use: { ...devices['Pixel 5'] } },
],
webServer: {
command: 'npm start',
url: baseURL,
reuseExistingServer: false,
timeout: 120_000,
env: {
...process.env,
API_PORT: String(apiPort),
VITE_PORT: String(frontendPort),
MINING_GAME_LOCAL_DB_PATH: `/tmp/mining-game-e2e-test-${apiPort}.json`,
},
},
});