The interaction address is now /api/v2/interaction/<uid> (redirecting to the sign-in page): oidc-provider scopes its cookie to that path, so every step's API call gets it. Before, a real browser never sent it and every sign-in 'expired'; the test browser now honours cookie paths too. 8 Playwright tests (deep link, wrong password, foreign return address, sign-up, reset mid-sign-in, 2FA set-up, account page, admin) on the real backend with an in-memory database, no Postgres needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
// Accounts' pages end to end (docs/ACCOUNTS-1.0-PLAN.md §12): the real backend on an in-memory
|
|
// database with a test product (e2e/server.ts), and the Next.js pages. Run with `npm run test:e2e`
|
|
// in apps/accounts. Nothing needs a database.
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
testMatch: "**/*.spec.ts",
|
|
workers: 1,
|
|
fullyParallel: false,
|
|
timeout: 120_000,
|
|
expect: { timeout: 20_000 },
|
|
reporter: "list",
|
|
outputDir: "e2e/test-results",
|
|
use: { baseURL: "http://localhost:3210", trace: "retain-on-failure", navigationTimeout: 90_000 },
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
webServer: [
|
|
{
|
|
command: "npx tsx e2e/server.ts",
|
|
url: "http://127.0.0.1:5210/api/health",
|
|
timeout: 120_000,
|
|
reuseExistingServer: false,
|
|
stdout: "pipe",
|
|
},
|
|
{
|
|
command: "npx next dev -p 3210",
|
|
cwd: "frontend",
|
|
url: "http://localhost:3210/privacy",
|
|
timeout: 180_000,
|
|
reuseExistingServer: false,
|
|
env: { ACCOUNTS_API_URL: "http://127.0.0.1:5210" },
|
|
},
|
|
],
|
|
});
|