调整Playwright默认浏览器策略

This commit is contained in:
huojiarong committed 2026-08-03 07:03:13 +00:00
1 parent cf249d6c0d
commit de265cdde6
1 file changed
+5 -1
+5 -1
View File
@@ -1,5 +1,8 @@
import { defineConfig } from "@playwright/test"; import { defineConfig } from "@playwright/test";
const channel = process.env.PLAYWRIGHT_CHANNEL?.trim();
const executablePath = process.env.PLAYWRIGHT_EXECUTABLE_PATH?.trim();
export default defineConfig({ export default defineConfig({
testDir: "./tests/e2e", testDir: "./tests/e2e",
fullyParallel: false, fullyParallel: false,
@@ -10,7 +13,8 @@ export default defineConfig({
}, },
use: { use: {
baseURL: "http://127.0.0.1:4173", baseURL: "http://127.0.0.1:4173",
channel: "msedge", ...(channel ? { channel } : {}),
...(executablePath ? { launchOptions: { executablePath } } : {}),
headless: true, headless: true,
viewport: { width: 1440, height: 900 }, viewport: { width: 1440, height: 900 },
screenshot: "only-on-failure", screenshot: "only-on-failure",