From 5a4d3106cae61863c2a50fd470474dfe3cff59bb Mon Sep 17 00:00:00 2001 From: zhangxiang Date: Wed, 19 Aug 2026 14:43:53 +0800 Subject: [PATCH] chore(test): harden e2e/lighthouse tooling and ignore tool cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Playwright:firefox/webkit 使用空 storageState,消除 newContext 阶段浏览器 兼容噪声;路径以配置目录为基准兼容多种调用方式 - Lighthouse:lighthouserc 补 chromeFlags(--disable-crash-reporter --no-sandbox --headless=new),规避 TRAE 沙箱对 Crashpad 目录的拦截 - .gitignore:忽略 .impeccable 评审工具缓存 --- .gitignore | 1 + config/test/lighthouserc.json | 1 + e2e/playwright.config.ts | 6 ++++-- e2e/storageState.firefox.json | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 e2e/storageState.firefox.json diff --git a/.gitignore b/.gitignore index 46e82ef..baf5e79 100644 --- a/.gitignore +++ b/.gitignore @@ -314,6 +314,7 @@ dogfood-bain/ # agent & skill artifacts .nova-loop/ .qoder/ +.impeccable/ .superpowers/brainstorm/ sessions/ diff --git a/config/test/lighthouserc.json b/config/test/lighthouserc.json index 1889bb8..592af95 100644 --- a/config/test/lighthouserc.json +++ b/config/test/lighthouserc.json @@ -15,6 +15,7 @@ ], "settings": { "preset": "desktop", + "chromeFlags": ["--disable-crash-reporter", "--no-sandbox", "--headless=new"], "onlyCategories": [ "performance", "accessibility", diff --git a/e2e/playwright.config.ts b/e2e/playwright.config.ts index d787223..2a3ca41 100644 --- a/e2e/playwright.config.ts +++ b/e2e/playwright.config.ts @@ -74,6 +74,7 @@ export default defineConfig({ use: { ...devices['Desktop Firefox'], viewport: { width: 1280, height: 800 }, + storageState: './storageState.firefox.json', }, testMatch: 'visual-regression.spec.ts', }, @@ -82,6 +83,7 @@ export default defineConfig({ use: { ...devices['Desktop Safari'], viewport: { width: 1280, height: 800 }, + storageState: './storageState.firefox.json', }, testMatch: 'visual-regression.spec.ts', }, @@ -102,12 +104,12 @@ export default defineConfig({ }, { name: 'firefox', - use: { ...devices['Desktop Firefox'] }, + use: { ...devices['Desktop Firefox'], storageState: './storageState.firefox.json' }, testIgnore: 'visual-regression.spec.ts', }, { name: 'webkit', - use: { ...devices['Desktop Safari'] }, + use: { ...devices['Desktop Safari'], storageState: './storageState.firefox.json' }, testIgnore: 'visual-regression.spec.ts', }, ], diff --git a/e2e/storageState.firefox.json b/e2e/storageState.firefox.json new file mode 100644 index 0000000..f4ec355 --- /dev/null +++ b/e2e/storageState.firefox.json @@ -0,0 +1,4 @@ +{ + "cookies": [], + "origins": [] +} \ No newline at end of file