Files
xiaoxia-saas/apps/web/playwright.config.ts
灵应 8935196fcd
Deploy / Staging E2E Tests (push) Has been skipped
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 138h4m33s
CI/CD Pipeline / Frontend Lint (push) Failing after 138h4m39s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 138h4m39s
style: 后端代码black格式化
2026-07-03 18:49:54 +08:00

66 lines
1.6 KiB
TypeScript

/**
* Playwright E2E 测试配置
*/
import { defineConfig, devices } from "@playwright/test";
const externalBaseURL = process.env.E2E_BASE_URL;
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [["html"], ["list"]],
use: {
baseURL: externalBaseURL || "http://localhost:3000",
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: process.env.E2E_VIDEO ? "retain-on-failure" : "off",
},
projects: process.env.E2E_ALL_BROWSERS
? [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
channel: process.env.E2E_BROWSER_CHANNEL || "msedge",
},
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
{
name: "Mobile Chrome",
use: { ...devices["Pixel 5"] },
},
{
name: "Mobile Safari",
use: { ...devices["iPhone 12"] },
},
]
: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
channel: process.env.E2E_BROWSER_CHANNEL || "msedge",
},
},
],
webServer: externalBaseURL
? undefined
: {
command: "npm run dev -- --host 127.0.0.1 --port 3000",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
});