3451bced82
Fixes the A4 blocker: /api/dev/complete now establishes the Auth.js session. Root cause was UntrustedHost (trustHost defaulted false in pnpm start / production because setEnvDefaults derives it from AUTH_URL, not NEXTAUTH_URL, and assertConfig checks it before that default applies). Added trustHost: true to the auth config; rebuilt. Complete response now sets authjs.session-token, /schedule returns 200, and all 4 e2e shell tests pass. Also ignores test-results/ artifacts.
33 lines
976 B
TypeScript
33 lines
976 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
/**
|
|
* E2E for the app shell. The done-criteria is "passes at 360px viewport", so
|
|
* the shell tests pin a mobile viewport. The webServer builds + starts the app
|
|
* against the same Postgres the app uses in production.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
fullyParallel: true,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: "list",
|
|
use: {
|
|
baseURL: "http://localhost:3000",
|
|
trace: "on-first-retry",
|
|
},
|
|
projects: [
|
|
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
|
|
],
|
|
webServer: {
|
|
command: "pnpm db:migrate && pnpm build && PORT=3000 pnpm start",
|
|
url: "http://localhost:3000",
|
|
reuseExistingServer: true,
|
|
env: {
|
|
DATABASE_URL: "postgres://media:media@localhost:5433/media",
|
|
NEXTAUTH_SECRET: "e2e-secret-for-shell-tests",
|
|
AUTO_ACTIVATE_NEW_USERS: "true",
|
|
},
|
|
timeout: 180_000,
|
|
},
|
|
});
|