8429bd86d4
Fixes 8 failures from the first test run: 1. Rate limiter exhaustion (5/8 failures) Admin was logged in 9× across the suite, hitting the 5/15min auth limit. Fix: global-setup.ts logs in once per role and saves storage state; all non-login tests use storageState so they skip the form. Total admin logins per suite run: 3 (global setup + 2 explicit tests). 2. Strict-mode violations (2/8 failures) toBeVisible() matched 3 email cells / 2 permission-error nodes. Fix: .first() on both locators. 3. Auth.js v5 signout confirmation page (1/8 failures) GET /auth/signout renders a confirm form rather than immediately redirecting. Fix: signOut() helper clicks the submit button. Note: running the suite right after a previous run may fail if the in-memory rate limit hasn't reset (15-min window). Restart the dev server, or add E2E_TEST_MODE=true to apps/web/.env.local to bypass. Co-Authored-By: claude-flow <ruv@ruv.net>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
/**
|
|
* Playwright configuration for running E2E tests against the LIVE dev server.
|
|
*
|
|
* Unlike the default playwright.config.ts (which spins up a dedicated test
|
|
* server with isolated test data), this config targets the already-running
|
|
* dev server at localhost:3100 and exercises real dev-DB data.
|
|
*
|
|
* Usage:
|
|
* pnpm --filter @capakraken/web exec playwright test --config playwright.dev.config.ts
|
|
*
|
|
* Prerequisites:
|
|
* - Dev server running: pnpm run dev (or docker compose up)
|
|
* - Dev DB seeded with planarchy.dev seed users
|
|
*/
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
import * as path from "path";
|
|
|
|
export const STORAGE_STATE = {
|
|
admin: path.join(__dirname, "e2e/dev-system/.auth/admin.json"),
|
|
manager: path.join(__dirname, "e2e/dev-system/.auth/manager.json"),
|
|
viewer: path.join(__dirname, "e2e/dev-system/.auth/viewer.json"),
|
|
};
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e/dev-system",
|
|
globalSetup: "./e2e/dev-system/global-setup.ts",
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env["CI"],
|
|
retries: 0,
|
|
workers: 1,
|
|
reporter: "list",
|
|
use: {
|
|
baseURL: "http://localhost:3100",
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
// No webServer block — the dev server must already be running
|
|
});
|