Files
image-workbench-desktop/tests/_helpers/env.js
T
qiqi a8151364b2 test(e2e): 环境依赖用例改为开关跳过(全量跑 0 红)
7 条用例需要真实能力(无头 web 环境必红),改为默认跳过、可手动开启:
- clipboard-audit 3 条:真实剪贴板读图
- iwb-image-memory-parity 4 条:真实远端图床 / 同源图片代理
(download-cors 1 条此前已 fixme,同样需要桌面环境)

开关在 tests/_helpers/env.js:默认跳过;设 IWB_E2E_ENV_DEPS=1 才执行。

验证:全量 52 spec / 195 用例 → 187 通过、0 失败、8 跳过、0 flaky(106s,52/52 spec 全绿)。
基线 tests/fixtures/e2e-known-red.json 已清空(0 已知红),之后出现的任何红都是新增回归。
2026-11-27 07:32:04 +08:00

16 lines
738 B
JavaScript
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.
'use strict'
// 环境依赖用例开关(2026-11-27)
//
// 有一类 e2e 需要「真实能力」才能通过,在无头 web 环境必红:
// · 读系统剪贴板里的图片(需真实前台窗口 + 剪贴板权限)
// · 跨域图片经同源代理出缩略图(需真实远端图床 / 代理服务)
// 默认跳过,保证「全量跑 = 真绿」;需要人工验收这些能力时:
// IWB_E2E_ENV_DEPS=1 npx playwright test tests/<spec>
const ENV_DEPS = process.env.IWB_E2E_ENV_DEPS === '1'
function requireEnvDeps (test, reason) {
test.skip(!ENV_DEPS, (reason || '依赖真实环境能力') + '(本地/CI 默认跳过;设 IWB_E2E_ENV_DEPS=1 运行)')
}
module.exports = { ENV_DEPS, requireEnvDeps }