forked from ariakit/ariakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
42 lines (37 loc) · 951 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
38
39
40
41
42
import { LaunchOptions, PlaywrightTestConfig, devices } from "@playwright/test";
process.env.PLAYWRIGHT_EXPERIMENTAL_FEATURES = "1";
const headed = process.env.HEADED === "true";
const launchOptions: LaunchOptions = {
headless: !headed,
slowMo: headed ? 250 : undefined,
};
const config: PlaywrightTestConfig = {
webServer: {
command: "npm start",
reuseExistingServer: !process.env.CI,
port: 3000,
},
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: headed ? 1 : 0.025,
},
},
use: {
screenshot: "only-on-failure",
},
reporter: process.env.CI ? [["github"], ["dot"]] : "list",
projects: [
{
name: "chrome",
testMatch: "test-chrome.ts",
retries: 1,
use: { ...devices["Desktop Chrome"], launchOptions },
},
{
name: "safari",
testMatch: "test-safari.ts",
use: { ...devices["Desktop Safari"], launchOptions },
},
],
};
export default config;