forked from hackerai-tech/hackerai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
49 lines (44 loc) · 1.32 KB
/
playwright.config.ts
File metadata and controls
49 lines (44 loc) · 1.32 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
import { defineConfig, devices } from "@playwright/test";
import * as dotenv from "dotenv";
import * as path from "path";
// Load .env.e2e file for test environment variables
dotenv.config({ path: path.join(__dirname, ".env.e2e") });
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./e2e",
fullyParallel: true, // Run spec files in parallel (each tier uses different user)
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 3, // Allow 3 concurrent workers (one per tier spec)
reporter: "html",
timeout: 60000,
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL || "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
navigationTimeout: 30000,
},
projects: [
// Setup project - authenticates all tiers and saves storage state
{
name: "setup",
testMatch: /.*\.setup\.ts/,
},
// Main test project - depends on setup
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
dependencies: ["setup"],
testIgnore: /.*\.setup\.ts/,
},
],
/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm dev:next",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
});