app-template/playwright.config.ts

41 lines
980 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig, devices } from "@playwright/test";
// 本机 http_proxy 会把 localhost 探活/请求也带进代理(502),E2E 内网请求必须直连
for (const key of [
"http_proxy",
"https_proxy",
"HTTP_PROXY",
"HTTPS_PROXY",
"all_proxy",
"ALL_PROXY",
]) {
delete process.env[key];
}
process.env.NO_PROXY = "*";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: [["list"]],
use: {
baseURL: "http://localhost:4321",
trace: "on-first-retry",
locale: "en-US",
acceptLanguage: "en-US",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
command: "yarn dev:web",
url: "http://localhost:4321",
reuseExistingServer: !process.env.CI,
timeout: 300_000,
},
});