import { defineConfig, devices } from "@playwright/test"; // The one place a line of web/*.js is executed, and where a change to either // file belongs. Why, and why Playwright: context/code/clients.md. // `reuseExistingServer` will happily adopt a server another checkout started on // this port, and then you test THAT tree. See context/code/clients.md. const PORT = process.env.IMPROVISE_HARNESS_PORT ?? "8099"; export default defineConfig({ testDir: "./tests", fullyParallel: false, workers: 1, forbidOnly: !!process.env.CI, retries: 0, reporter: process.env.CI ? [["github"], ["list"]] : "list", timeout: 60_000, use: { baseURL: `http://127.0.0.1:${PORT}`, trace: "retain-on-failure", }, // Chromium + Firefox run the OPFS battery; WebKit has no OPFS at all and is // kept for the day it does. Every other spec is Chromium-only: clients.md. projects: [ { name: "chromium", use: { ...devices["Desktop Chrome"] } }, { name: "firefox", use: { ...devices["Desktop Firefox"] }, testMatch: /opfs\.spec\.js/, }, { name: "webkit", use: { ...devices["Desktop Safari"] }, testMatch: /opfs\.spec\.js/, }, ], webServer: { command: `python3 -m http.server ${PORT} --bind 127.0.0.1 --directory serve`, // The APP, not the site root — since improvise-kh8 the root is the landing // page, which would answer 200 with no bundle assembled at all. url: `http://127.0.0.1:${PORT}/app/index.html`, reuseExistingServer: !process.env.CI, timeout: 30_000, }, });