-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaywright.config.ts
53 lines (47 loc) · 1.19 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { defineConfig, devices } from '@playwright/test'
const PORT = process.env.CI ? 3000 : 3001
const baseURL = `http://127.0.0.1:${PORT}`
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'github' : 'line',
webServer: {
command: process.env.CI ? 'pnpm preview' : 'pnpm dev',
url: baseURL,
reuseExistingServer: !process.env.CI,
},
use: {
baseURL,
trace: 'retry-with-trace',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
// ? As of Feb 7, 2024 testing against mobile browsers in github actions is too slow. Locally it's encouraged.
...(process.env.CI
? []
: [
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 13'] },
},
]),
],
})