import { defineConfig } from "@playwright/test"; import { fileURLToPath } from "url"; import { dirname, join } from "path"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const EXTENSION_PATH = join(__dirname, "dist-chrome"); const CI = process.env.CI === "true" || process.env.PEACH_RELEASE_BROWSER_GATE === "1"; export default defineConfig({ testDir: "./tests", timeout: 30_000, use: { headless: false, viewport: { width: 320, height: 600 }, trace: CI ? "retain-on-failure" : "off", screenshot: CI ? "only-on-failure" : "off", }, projects: [ { name: "peach-extension", use: { launchOptions: { args: [ `--disable-extensions-except=${EXTENSION_PATH}`, `--load-extension=${EXTENSION_PATH}`, `--no-sandbox`, `--disable-gpu`, `--disable-dev-shm-usage`, ], }, }, testMatch: "**/*.spec.ts", testIgnore: /security-sentinels\.spec\.ts/, }, // PB-26-210: mandatory Chrome release browser gate. // Headless, deterministic timeouts, artifact capture on failure. // Runs security sentinels for PB-26-201 (authorization) and // PB-26-203 (session storage isolation). { name: "chrome-release", use: { headless: true, launchOptions: { executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH, args: [ `--disable-extensions-except=${EXTENSION_PATH}`, `--load-extension=${EXTENSION_PATH}`, `--no-sandbox`, `--disable-gpu`, `--disable-dev-shm-usage`, ], }, }, testMatch: /security-sentinels\.spec\.ts/, timeout: 120_000, retries: 0, }, ], });