-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
53 lines (51 loc) · 1.59 KB
/
Copy pathplaywright.config.ts
File metadata and controls
53 lines (51 loc) · 1.59 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 baseURL = process.env.PLAYWRIGHT_BASE_URL ?? "http://127.0.0.1:3000";
const useLocalProductAuth = process.env.COMMONSTATE_E2E_LOCAL_AUTH === "true";
export default defineConfig({
testDir: "./tests/e2e",
outputDir: "test-results",
timeout: 45_000,
expect: { timeout: 8_000 },
fullyParallel: false,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [
["list"],
["html", { outputFolder: "playwright-report", open: "never" }],
],
use: {
baseURL,
navigationTimeout: 15_000,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: "npm run start -- --hostname 127.0.0.1 --port 3000",
env: {
...(useLocalProductAuth
? {
// The application still requires a loopback PostgreSQL URL
// and rejects this path on Vercel. Clearing CI only in the
// spawned localhost server lets the production build exercise
// the local-bootstrap principal without enabling it in a
// deployed environment.
CI: "",
COMMONSTATE_LOCAL_AUTH: "true",
}
: {}),
},
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});