-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (50 loc) · 1.68 KB
/
Copy pathplaywright.config.ts
File metadata and controls
52 lines (50 loc) · 1.68 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
import { defineConfig, devices } from "@playwright/test";
const port = Number(process.env.PLAYWRIGHT_PORT || 4401);
const webServerEnv: Record<string, string> = Object.fromEntries(
Object.entries(process.env).filter((entry): entry is [string, string] => entry[1] !== undefined),
);
webServerEnv.NEXT_PUBLIC_BASE_PATH = "/agent-render";
webServerEnv.PORT = String(port);
delete webServerEnv.NO_COLOR;
export default defineConfig({
testDir: "tests/e2e",
testIgnore: process.env.CI ? ["**/visual.spec.ts"] : undefined,
fullyParallel: false,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [["html", { open: "never" }], ["github"]] : [["list"]],
expect: {
toHaveScreenshot: {
// Keep per-project snapshot names while removing platform-specific suffixes.
pathTemplate: "{snapshotDir}/{testFilePath}-snapshots/{arg}{-projectName}{ext}",
},
},
use: {
baseURL: `http://127.0.0.1:${port}/agent-render/`,
locale: "en-US",
timezoneId: "America/New_York",
colorScheme: "light",
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
webServer: {
command: "npm run build && npm run preview",
env: webServerEnv,
port,
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
// Second engine for the arx4 wire-format gate: the codec has to code bit-identically here.
// Visual baselines are chromium-only, so the screenshot spec stays on its single engine.
name: "webkit",
testIgnore: ["**/visual.spec.ts"],
use: { ...devices["Desktop Safari"] },
},
],
});