-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.mts
More file actions
62 lines (58 loc) · 1.99 KB
/
playwright.config.mts
File metadata and controls
62 lines (58 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig, devices } from "@playwright/test";
const BASE_URL = process.env.BASE_URL || "http://localhost:3000";
async function isServerRunning(): Promise<boolean> {
try {
await fetch(BASE_URL, { signal: AbortSignal.timeout(2000) });
return true;
} catch {
return false;
}
}
const serverAlreadyRunning = await isServerRunning();
export default defineConfig({
testDir: "./tests/e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? "github" : "list",
timeout: 30_000,
use: {
baseURL: BASE_URL,
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: serverAlreadyRunning
? undefined
: {
// Run against production build - requires `pnpm build` to be run first
command: "pnpm start:e2e",
url: BASE_URL,
timeout: 120_000,
stdout: "pipe",
stderr: "pipe",
env: {
API_BASE_URL: "http://localhost:9090",
OIDC_ISSUER_URL: "http://localhost:4000",
OIDC_CLIENT_ID: "better-auth-dev",
OIDC_CLIENT_SECRET: "dev-secret-change-in-production",
OIDC_PROVIDER_ID: "okta",
BETTER_AUTH_URL: "http://localhost:3000",
BETTER_AUTH_SECRET: "e2e-test-secret-at-least-32-chars-long",
// Better Auth rate limits sign-in to 3 requests per 10 seconds by default.
// E2E tests with multiple authenticatedPage fixtures exceed this limit,
// causing 429 errors. Set to 100 to allow rapid sequential logins.
BETTER_AUTH_RATE_LIMIT: "100",
// Always use testing model for E2E tests to avoid needing OpenRouter API keys
USE_E2E_MODEL: "true",
E2E_MODEL_NAME: process.env.E2E_MODEL_NAME ?? "qwen2.5:1.5b",
OLLAMA_BASE_URL:
process.env.OLLAMA_BASE_URL ?? "http://localhost:11434",
},
},
});