push to maple-street
This commit is contained in:
+20
-4
@@ -4,7 +4,15 @@ 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.
|
||||
*
|
||||
* `DATABASE_URL` is overridable so CI can point at its own Postgres service
|
||||
* while local runs keep the development database on :5433.
|
||||
*/
|
||||
const DATABASE_URL =
|
||||
process.env.TEST_DATABASE_URL ??
|
||||
process.env.DATABASE_URL ??
|
||||
"postgres://media:media@localhost:5433/media";
|
||||
|
||||
export default defineConfig({
|
||||
testDir: "./e2e",
|
||||
fullyParallel: true,
|
||||
@@ -22,14 +30,22 @@ export default defineConfig({
|
||||
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
|
||||
],
|
||||
webServer: {
|
||||
command: "pnpm db:migrate && pnpm build && PORT=3000 pnpm start",
|
||||
// Playwright sets NODE_ENV=test for the runner. Next 15.5's build hangs
|
||||
// when that value is inherited, so unset it before building/serving.
|
||||
command:
|
||||
"unset NODE_ENV; 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",
|
||||
|
||||
DATABASE_URL,
|
||||
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET ?? "e2e-secret-for-shell-tests",
|
||||
NEXTAUTH_URL: "http://localhost:3000",
|
||||
// Tests create users by email and reset the database between suites.
|
||||
AUTO_ACTIVATE_NEW_USERS: "true",
|
||||
MAGIC_LINK_DEV_TRANSPORT: "true",
|
||||
ALLOW_DEV_RESET: "true",
|
||||
},
|
||||
timeout: 180_000,
|
||||
timeout: 600_000,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user