-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathplaywright.config.js
More file actions
54 lines (52 loc) · 1.92 KB
/
Copy pathplaywright.config.js
File metadata and controls
54 lines (52 loc) · 1.92 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
54
import { defineConfig, devices } from '@playwright/test'
const PORT = 4173
const BASE_URL = `http://localhost:${PORT}`
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'github' : 'list',
use: {
baseURL: BASE_URL,
trace: 'retain-on-failure',
},
projects: [
// Default project: smoke + visual regression. Daily traffic is mocked
// inside the specs, so no network access or credentials are required.
{
name: 'chromium',
testIgnore: [/e2e\.spec\.js/, /screenshots\.spec\.js/, /prod-verify\.spec\.js/],
use: { ...devices['Desktop Chrome'] },
},
// True end-to-end project: actually joins a real Daily room. Requires
// VITE_DAILY_SUBDOMAIN to be set, and uses Chrome's fake media flags
// so the browser doesn't need a real camera or mic.
{
name: 'e2e',
testMatch: [/e2e\.spec\.js/, /screenshots\.spec\.js/],
testIgnore: /prod-verify\.spec\.js/,
use: {
...devices['Desktop Chrome'],
permissions: ['camera', 'microphone'],
launchOptions: {
args: [
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
'--autoplay-policy=no-user-gesture-required',
],
},
},
},
],
webServer: {
// Build then serve preview, so we exercise the production bundle exactly.
command: `npm run build && npm run preview -- --port ${PORT} --strictPort`,
url: BASE_URL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: 'pipe',
stderr: 'pipe',
},
})