-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
60 lines (57 loc) · 1.63 KB
/
Copy pathplaywright.config.ts
File metadata and controls
60 lines (57 loc) · 1.63 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
55
56
57
58
59
60
// biome-ignore-all lint/correctness/noNodejsModules : Playwright config reads CI from Node's process env.
import process from 'node:process';
import { defineConfig, devices } from '@playwright/test';
const PORT = 4173;
const HOST = 'localhost';
const BASE_URL = `http://${HOST}:${PORT}`;
const smokeTag = /@smoke/;
// biome-ignore lint/style/noProcessEnv: Playwright config reads CI from Node's process env.
const isCi = Boolean(process.env.CI);
// biome-ignore lint/style/noDefaultExport: Playwright config must use the default export shape.
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: isCi,
retries: isCi ? 2 : 0,
workers: isCi ? 1 : 2,
reporter: isCi
? [['github'], ['html', { open: 'never' }], ['list']]
: [['html', { open: 'never' }], ['list']],
use: {
// biome-ignore lint/style/useNamingConvention: Playwright config uses the upstream `baseURL` key.
baseURL: BASE_URL,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
grep: smokeTag,
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
grep: smokeTag,
use: { ...devices['Desktop Safari'] },
},
{
name: 'mobile-chrome',
grep: smokeTag,
use: { ...devices['Pixel 7'] },
},
{
name: 'mobile-safari',
grep: smokeTag,
use: { ...devices['iPhone 13'] },
},
],
webServer: {
command: `pnpm preview --host ${HOST} --port ${PORT} --strictPort`,
url: BASE_URL,
reuseExistingServer: !isCi,
timeout: 120_000,
},
});