Verify-suite work (this session):
- M package.json — added typecheck, test:e2e, verify scripts; added @playwright/test devDep - M pnpm-lock.yaml - M .gitignore — Playwright artifacts - M tsconfig.json — auto-modified by Next.js include path - ?? e2e/ — config + fixtures + 3 specs - ?? playwright.config.ts - ?? scripts/verify.sh, scripts/db-test-truncate.sql
This commit is contained in:
35
playwright.config.ts
Normal file
35
playwright.config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { defineConfig, devices } from "@playwright/test";
|
||||
|
||||
// Dedicated test port — keeps the e2e server isolated from any `pnpm dev`
|
||||
// the user might have running, and pins it against the touchbase_test DB
|
||||
// (loaded from .env.test in the webServer command below).
|
||||
const PORT = Number(process.env.E2E_PORT ?? 3010);
|
||||
const BASE_URL = process.env.E2E_BASE_URL ?? `http://localhost:${PORT}`;
|
||||
|
||||
export default defineConfig({
|
||||
testDir: "./e2e",
|
||||
fullyParallel: false,
|
||||
retries: 0,
|
||||
workers: 1,
|
||||
reporter: [["list"]],
|
||||
timeout: 30_000,
|
||||
expect: { timeout: 10_000 },
|
||||
use: {
|
||||
baseURL: BASE_URL,
|
||||
trace: "retain-on-failure",
|
||||
screenshot: "only-on-failure",
|
||||
video: "off",
|
||||
},
|
||||
webServer: {
|
||||
// dotenv-cli loads .env.test (DATABASE_URL=touchbase_test) for the child.
|
||||
command: `pnpm exec dotenv -e .env.test -- next dev -p ${PORT}`,
|
||||
url: `${BASE_URL}/api/health`,
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 60_000,
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
},
|
||||
projects: [
|
||||
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user