-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (50 loc) · 1.47 KB
/
Copy pathplaywright.config.ts
File metadata and controls
52 lines (50 loc) · 1.47 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
import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
workers: process.env.PLAYWRIGHT_NUM_WORKERS
? Number(process.env.PLAYWRIGHT_NUM_WORKERS)
: 1,
reporter: 'list',
use: {
baseURL: 'http://localhost:3000',
// Default to headless for stability; opt-in to headed mode with PW_HEADED=true.
headless: process.env.PW_HEADED !== 'true',
launchOptions: {
devtools: process.env.PW_DEVTOOLS === 'true',
},
},
expect: {
timeout: process.env.CI ? 45_000 : 20_000,
},
timeout: 400_000,
projects: [
{
name: 'webkit',
// local-network tests live in their own config (playwright.local-network.config.ts)
testIgnore: ['**/local-network/**'],
use: { ...devices['Desktop Safari'] },
},
{
name: 'chromium',
testIgnore: ['**/local-network/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
testIgnore: ['**/local-network/**'],
use: { ...devices['Desktop Firefox'] },
},
],
webServer: {
// Always serve the production build: CI runs `yarn build-app:ci` first; local `yarn test:e2e` runs `prep-test` (build) first.
command: 'PORT=3000 yarn serve',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: process.env.CI ? 120_000 : 30_000,
},
});