-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.mts
More file actions
53 lines (49 loc) · 1.39 KB
/
playwright.config.mts
File metadata and controls
53 lines (49 loc) · 1.39 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
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,
workers: process.env.CI ? 1 : undefined,
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
: {
command: "pnpm dev",
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",
NEXT_PUBLIC_OIDC_PROVIDER_ID: "okta",
BETTER_AUTH_URL: "http://localhost:3000",
BETTER_AUTH_SECRET: "e2e-test-secret-at-least-32-chars-long",
},
},
});