Skip to content

Commit cf1ff6a

Browse files
committed
chore(config): enhance Playwright configuration for improved test execution and CI integration
1 parent 31d1f77 commit cf1ff6a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ jobs:
5959

6060
- name: Run Playwright e2e tests
6161
run: pnpm test:e2e
62+
63+

playwright.config.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
import { defineConfig } from "@playwright/test";
1+
import { defineConfig, devices } from "@playwright/test";
22

33
export default defineConfig({
44
testDir: "tests/e2e",
5-
// You can add more Playwright options here if needed
5+
fullyParallel: true, // Run tests in parallel
6+
forbidOnly: !!process.env.CI, // Fail if test.only is left in code in CI
7+
retries: process.env.CI ? 2 : 0, // Retry on failure in CI
8+
workers: process.env.CI ? 1 : undefined, // Limit workers in CI
9+
reporter: "html", // Reporter to use
10+
use: {
11+
baseURL: "http://localhost:3000", // Base URL for actions like page.goto()
12+
trace: "on-first-retry", // Record trace only when retrying a failed test
13+
},
14+
webServer: {
15+
command: "pnpm start", // Command to start the dev server
16+
url: "http://localhost:3000", // URL to wait for
17+
reuseExistingServer: !process.env.CI, // Reuse server locally, start fresh in CI
18+
timeout: 120 * 1000, // Increase timeout for server start
19+
},
20+
// Optional: Configure projects for major browsers
21+
// projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } } ],
622
});

0 commit comments

Comments
 (0)