import { defineConfig, devices } from "@playwright/test"; import { DEPLOYED_ORIGIN, browserArgs, chromePath } from "./tests/deployed/support/browser-options"; /** * Functional tests against the deployed site (default: https://49.232.250.35:58014). * * No webServer: it talks to the real origin. Headed on purpose — the suite is * meant to be watched. * * Cost model: one fresh browser context means downloading and compiling the * ~300 MB engine (~3 minutes). The suite therefore reuses a single persistent * context per worker (see tests/deployed/support/deployed-test.ts); these * `use` options only take effect in isolated mode (`DEPLOYED_ISOLATE=1`), which * keeps per-test contexts and video capture. */ const videoMode = process.env.DEPLOYED_VIDEO ?? "retain-on-failure"; export default defineConfig({ testDir: "tests/deployed", /* Hard cap: a case that cannot finish within a minute is a case that hangs, * and a hanging case must not hold the display. Missing controls give up in * 15 s and name the locator instead of waiting for the cap. */ timeout: 60_000, expect: { timeout: 20_000 }, actionTimeout: 15_000, navigationTimeout: 40_000, fullyParallel: false, workers: Number(process.env.DEPLOYED_WORKERS ?? "1") || 1, retries: 0, reporter: [ ["list"], ...(process.env.PLAYWRIGHT_JSON_OUTPUT_FILE ? [["json", { outputFile: process.env.PLAYWRIGHT_JSON_OUTPUT_FILE }] as const] : []), ], use: { baseURL: DEPLOYED_ORIGIN, ...devices["Desktop Chrome"], headless: false, viewport: { width: 1600, height: 900 }, acceptDownloads: true, ignoreHTTPSErrors: process.env.DEPLOYED_IGNORE_HTTPS === "1", screenshot: "on", video: videoMode === "off" ? "off" : videoMode === "all" ? "on" : "retain-on-failure", trace: "retain-on-failure", launchOptions: { ...(chromePath() ? { executablePath: chromePath() } : {}), args: browserArgs(), }, }, });