-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.mjs
More file actions
46 lines (45 loc) · 1.24 KB
/
playwright.config.mjs
File metadata and controls
46 lines (45 loc) · 1.24 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
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "test/e2e",
testMatch: "test/e2e/**/*.spec.ts",
snapshotPathTemplate: "test/e2e/__snapshots__/{testFilePath}/{arg}{ext}",
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
use: {
baseURL: "http://localhost:3000",
acceptDownloads: false,
contextOptions: { strictSelectors: true },
locale: "en-US",
timezoneId: "UTC",
trace: "on-first-retry",
},
expect: {
toHaveScreenshot: {
scale: "device",
stylePath: "test/e2e/screenshot.css",
maxDiffPixelRatio: 0.02, // allow for font rendering variance
},
},
webServer: {
command: "bun run serve",
port: 3000,
reuseExistingServer: !process.env.CI, // throw in CI if port is taken
// stdout: "pipe",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
// FIXME: Webkit is broken in both CI and on local dev machines. Create a
// docker image for playwright to achieve a more consistent environment.
// {
// name: "webkit",
// use: { ...devices["Desktop Safari"] },
// },
],
});