Locks the five flows the refactor must not break (feed, channel, player, settings, nav) so later sprints can prove they changed nothing. Adds a thin data-testid layer and a dedicated seeded non-demo account; the suite runs on the baked :8080 stack (authoritative) or :5173. No product-behaviour change.
52 lines
1.9 KiB
TypeScript
52 lines
1.9 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
/**
|
|
* E2E characterization (golden-master) net for the Platform refactor.
|
|
*
|
|
* Target (PW_BASE_URL): defaults to the baked localdev stack on :8080 (production-faithful,
|
|
* same-origin, no HMR/WS gaps). Point it at http://localhost:5173 for the fast Vite loop — all
|
|
* five characterization flows are proxy-safe (none use the WebSocket).
|
|
*
|
|
* The stack must already be UP (owned by `siftlode dev`); there is deliberately no `webServer`.
|
|
* `e2e/global.setup.ts` seeds the dedicated test account and logs in once, sharing the resulting
|
|
* session via storageState so the real tests never re-authenticate (auth endpoints are rate-limited).
|
|
*
|
|
* Runs serial / single-worker on purpose: the specs share ONE seeded account, and a couple of
|
|
* them mutate server state (Settings save), so determinism beats parallelism here.
|
|
*/
|
|
|
|
const BASE_URL = process.env.PW_BASE_URL || "http://127.0.0.1:8080";
|
|
const STORAGE_STATE = "e2e/.auth/state.json";
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: 0,
|
|
reporter: [["list"], ["html", { open: "never" }]],
|
|
timeout: 30_000,
|
|
expect: { timeout: 7_000 },
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
storageState: STORAGE_STATE,
|
|
locale: "en-US",
|
|
// retain-on-failure (not on-first-retry): with retries:0 a "first retry" never happens, so a
|
|
// trace would never be captured — this keeps a full trace for any failure, discarded on success.
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "setup",
|
|
testMatch: /global\.setup\.ts/,
|
|
use: { storageState: { cookies: [], origins: [] } },
|
|
},
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"], storageState: STORAGE_STATE },
|
|
dependencies: ["setup"],
|
|
},
|
|
],
|
|
});
|