forked from closedloop-ai/closedloop-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
45 lines (41 loc) · 1.62 KB
/
Copy pathplaywright.config.ts
File metadata and controls
45 lines (41 loc) · 1.62 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
// Load env vars before any imports so DEVOPS_CLOSEDLOOP_APP_PWD and CLERK_TESTING_TOKEN
// are available to the test runner process (Playwright does not auto-load .env.local unlike Next.js)
import { config } from "dotenv";
config({ path: "./apps/app/.env.local" });
import { defineConfig, devices } from "@playwright/test";
// WARNING: test-results/ may contain session screenshots from authenticated pages — do not upload to public artifact stores
export default defineConfig({
testDir: "e2e",
timeout: 60_000,
outputDir: "test-results",
globalSetup: "./e2e/global.setup.ts",
// Top-level retries apply to projects that don't set their own.
// Auth-related projects override to 0 to prevent Clerk account lockout.
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [["list"], ["html", { outputFolder: "playwright-report" }]],
use: {
baseURL: process.env.BASE_URL ?? "http://localhost:3000",
trace: process.env.CI ? "on-first-retry" : "off",
screenshot: process.env.CI ? "only-on-failure" : "off",
},
projects: [
{
name: "setup",
testMatch: /.*\.setup\.ts/,
// retries: 0 is mandatory to prevent Clerk account lockout from consecutive login failures
retries: 0,
},
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
storageState: ".auth/user.json",
},
dependencies: ["setup"],
// retries: 0 — auth.spec.ts performs real password sign-in under this project;
// retrying on failure would resubmit credentials and risk locking the shared Clerk account.
retries: 0,
},
],
});