1import { defineConfig, devices } from "@playwright/test";
2import { siteHeader } from "./e2e/helpers/site";
3
4/**
5 * E2E suite for the Opendesk SPA, run against a real bench site.
6 * `global.setup.ts` seeds personas and saves one logged-in session per persona.
7 */
8export default defineConfig({
9 testDir: "./e2e",
10 fullyParallel: false,
11 workers: 1,
12 forbidOnly: !!process.env.CI,
13 retries: process.env.CI ? 1 : 0,
14 // CI shards write blob reports that the merge-reports job joins into one HTML report.
15 reporter: process.env.CI ? [["github"], ["blob"]] : "list",
16 timeout: 60_000,
17 expect: { timeout: 10_000 },
18 use: {
19 baseURL: process.env.BASE_URL || "http://localhost:8000",
20 extraHTTPHeaders: siteHeader(),
21 trace: "retain-on-failure",
22 screenshot: "only-on-failure",
23 actionTimeout: 15_000,
24 navigationTimeout: 30_000,
25 ...devices["Desktop Chrome"],
26 viewport: { width: 1440, height: 900 },
27 // Differs from a fresh site's Asia/Kolkata, so timezone bugs show up locally too.
28 timezoneId: "UTC",
29 },
30 projects: [
31 { name: "setup", testMatch: /global\.setup\.ts/ },
32 {
33 name: "chromium",
34 testMatch: /.*\.spec\.ts/,
35 dependencies: ["setup"],
36 },
37 ],
38});
39