-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
38 lines (32 loc) · 963 Bytes
/
playwright.config.ts
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
import { defineConfig, PlaywrightTestConfig } from '@playwright/test'
require('dotenv').config()
const defaultFEUrl = 'http://localhost:3000'
const defaultBEUrl = 'http://localhost:4000'
console.log('Running E2E tests on: ', process.env.FRONTEND_URL ?? defaultFEUrl)
const config: PlaywrightTestConfig = {
testDir: './e2e', // Directory where tests will be placed
webServer: [],
use: {
baseURL: process.env.FRONTEND_URL ?? defaultFEUrl,
headless: true,
video: 'on-first-retry',
},
}
if (!process.env.FRONTEND_URL && Array.isArray(config.webServer)) {
config.webServer.push({
command: 'yarn frontend dev',
url: defaultFEUrl,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
})
config.webServer.push({
command: 'yarn backend dev',
url: defaultBEUrl,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
MOCKS: 'true',
},
})
}
export default defineConfig(config)