-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
62 lines (60 loc) · 2.27 KB
/
playwright.config.ts
File metadata and controls
62 lines (60 loc) · 2.27 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
59
60
61
62
import { defineConfig, devices } from "@playwright/test";
import dotenv from "dotenv";
import path from "path";
dotenv.config({ path: path.resolve(__dirname, ".env") });
export default defineConfig({
testDir: "./e2e",
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
maxFailures: undefined, // Don't stop after a certain number of failures - run all tests
reporter: process.env.CI ? [["json", { outputFile: "test-results/playwright-results.json" }], ["list"]] : "html",
timeout: 120000, // 2 minutes for tests that may take longer (e.g., wallet address retrieval, funding)
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL || "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
actionTimeout: 10000,
navigationTimeout: 60000,
},
projects: [
// Smoke tests - fast, single browser, serial execution
{
name: "smoke",
testDir: "./e2e/smoke-tests",
testMatch: "smoke.spec.ts",
fullyParallel: false,
retries: 0, // No retries to avoid re-running passed tests in serial mode
timeout: 300000, // 5 minutes for smoke tests
use: {
...devices["Desktop Chrome"],
navigationTimeout: 30000,
},
},
// Full e2e tests - multiple browsers, parallel execution
{
name: "chromium",
testMatch: /^(?!.*smoke).*\.spec\.ts$/, // Exclude smoke tests
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
testMatch: /^(?!.*smoke).*\.spec\.ts$/, // Exclude smoke tests
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
testMatch: /^(?!.*smoke).*\.spec\.ts$/, // Exclude smoke tests
use: { ...devices["Desktop Safari"] },
},
],
webServer: {
command: process.env.PLAYWRIGHT_WEB_SERVER_COMMAND || "pnpm dev",
url: process.env.PLAYWRIGHT_BASE_URL || "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: process.env.CI ? 180000 : 300000,
stdout: "pipe",
stderr: "pipe",
},
});