-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
49 lines (47 loc) · 1.04 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
import { join } from "path";
import { devices,
defineConfig,
type PlaywrightTestConfig } from "@playwright/test";
const port = process.env.PORT ?? 3000;
const baseURL = `http://localhost:${ port }`;
export default defineConfig( {
use: {
trace: process.env.CI ? "off" : "on-first-retry",
video: process.env.CI ? "off" : "on-first-retry",
locale: "en-GB",
baseURL
},
expect: { timeout: 10000 },
workers: 1,
retries: process.env.CI ? 2 : 0,
testDir: join( __dirname, "tests/e2e" ),
reporter: process.env.CI ? "github" : "html",
outputDir: "test-results/",
webServer: {
port,
command: "next start",
reuseExistingServer: !process.env.CI
},
projects: [
{
name: "chromium",
use: { ...devices[ "Desktop Chrome" ] }
},
{
name: "firefox",
use: { ...devices[ "Desktop Firefox" ] }
},
{
name: "webkit",
use: { ...devices[ "Desktop Safari" ] }
},
{
name: "Mobile Chrome",
use: { ...devices[ "Pixel 5" ] }
},
{
name: "Mobile Safari",
use: { ...devices[ "iPhone 12" ] }
}
]
} as PlaywrightTestConfig );