-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
37 lines (31 loc) · 969 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
import { defineConfig, devices } from '@playwright/test';
const devicesToUse: (keyof typeof devices)[] = [
'Desktop Chrome',
'Desktop Edge',
'Desktop Firefox',
'Pixel 2',
];
const baseUrl = 'http://localhost:3000';
export default defineConfig({
testDir: 'src',
fullyParallel: true,
forbidOnly: !!process.env.CI,
reporter: 'html',
use: { baseURL: baseUrl },
timeout: !!process.env.CI ? 60_000 : 30_000,
// Opt out of parallel tests on CI.
workers: !!process.env.CI ? 1 : undefined,
// Each device must be in its own project
projects: devicesToUse.map((deviceKey) => ({
name: deviceKey as string,
use: devices[deviceKey],
testMatch: /.+\.e2e\.ts/,
})),
// Serve build to handle issues that may only appear in built environment
// e.g. https://github.com/fast-reflexes/better-react-mathjax/issues/42
webServer: {
command: 'npm run serve-build',
url: baseUrl,
reuseExistingServer: !process.env.CI,
},
});