-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
58 lines (56 loc) · 1.68 KB
/
playwright.config.ts
File metadata and controls
58 lines (56 loc) · 1.68 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
import { defineConfig, devices } from "@playwright/test";
const explicitBaseURL = process.env.PLAYWRIGHT_BASE_URL?.trim();
const runningAgainstPreview = Boolean(explicitBaseURL);
const port = Number(process.env.PORT ?? "3000");
const localBaseURL = `http://127.0.0.1:${port}`;
const baseURL = explicitBaseURL ?? localBaseURL;
const webServerCommand =
`npm run db:migrate && npm run db:seed-demo && ` +
`npm run dev:app -- --hostname 127.0.0.1 --port ${port}`;
export default defineConfig({
testDir: "./tests/e2e",
forbidOnly: Boolean(process.env.CI),
fullyParallel: false,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: [
["list"],
["html", { open: "never" }],
["json", { outputFile: "reports/playwright.json" }],
],
use: {
baseURL,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
webServer: runningAgainstPreview
? undefined
: {
command: webServerCommand,
env: {
...process.env,
APP_TOKEN_HASH_SECRET:
process.env.APP_TOKEN_HASH_SECRET ??
"test-token-hash-secret-at-least-32-characters",
BETTER_AUTH_URL: localBaseURL,
DISABLE_TRANSACTIONAL_EMAILS: "1",
NEXT_PUBLIC_BETTER_AUTH_URL: `${localBaseURL}/api/auth`,
CEREBRAS_API_KEY: "",
GROQ_API_KEY: "",
GEMINI_API_KEY: "",
RESEND_API_KEY: "",
RESEND_FROM_EMAIL: "",
RESEND_REPLY_TO_EMAIL: "",
},
reuseExistingServer: false,
timeout: 120_000,
url: localBaseURL,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
});