✨ 统一 example/tests 测试结果与人工验证反馈 - #1717
Draft
cyfung1031 wants to merge 6 commits into
Draft
Conversation
cyfung1031
marked this pull request as draft
September 2, 2026 22:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更范围
example/tests/lib/sctest.js:统一PASS、FAIL、WARN、INFO、SKIP、MANUAL结果协议,增加check、note、createReportSession,支持异步 predicate、required 和 WARN 降级。实际/预期/说明诊断表、重跑、筛选和 JSON 复制;Console、Shadow DOM Panel、GM_log与稳定的 JSON marker 继续消费同一条结果记录。it逐一迁移为check,保留原有断言体;缺省字段时从内部expectmatcher 推导 expected/actual,并按结果状态生成说明,不再显示无语义的“保留原有断言体”。gm_download_test.js保留 21 个自动用例和 5 个人工用例,菜单和值测试保留真实操作流程,并与统一诊断面板并行记录 INFO/WARN/MANUAL。@require、README 示例和单测 URL 均固定到框架提交9e0b465196d1b87786a8cb4d5a0c42fed148b735。验证
pnpm exec vitest run --no-coverage --reporter=dot example/tests/lib/sctest.test.js:73/73 通过。pnpm test -- --run example/tests/lib/sctest.test.js:在允许本地服务和文件系统测试的外部环境运行,364 个文件、4512 个测试全部通过。pnpm run typecheck:通过。pnpm run build:通过;仅有既有 asset size 和 Monaco dynamic require 警告。pnpm exec playwright test e2e/gm-api.spec.ts -g "SCTest panel" --reporter=line:1/1 通过,验证 CSP 页面下的宽版面板、顶部位置、诊断表和 constructable stylesheet。pnpm exec playwright test e2e/gm-api.spec.ts --reporter=line:12/12 通过;运行时 summary 显示 sandbox 32/32、GM async 29/29、GM sync 29/29、unwrap 3/3、redirect 12/12、inject 11/11、window message 5/5、XHR 138/138 等结构化结果。node --check、嵌入式 CSS strict scan、git diff --check:通过。Headed 人工验证证据
gm_download_test.js:专用 WebUI 正常加载;21 个自动用例实际运行得到 16 PASS、5 FAIL,失败是现有环境下 Blob/File/data URL 和 blocked/invalid URL 的超时,未隐瞒为通过。人工视觉文件检查确认目标文件不存在,因此不能判 PASS;点击Mark Fail时验证驱动因无 JavaScript dialog 抛出Page.handleJavaScriptDialog: No dialog is showing,手动裁决同步未能取得最终 marker。gm_value_test.js:主页面和 3 个真实 iframe 的 dashboard 正常加载;点击主 frame 的 string 操作后观察到值、远程值和事件传播,结果仍保持MANUALpending。gm_menu_test.js:观察到注册 INFO 和待人工 MANUAL;当前 headed 驱动的open popup只能打开扩展页面,不能定位浏览器工具栏菜单,因此未声称菜单点击 PASS。限制
本 PR 不执行 merge。人工操作未确认的项目保持
MANUAL,不能按自动 PASS 处理;上述下载环境失败和验证驱动 dialog 限制已作为证据记录。默认 userscript ESLint 会忽略example/tests,因此保留其运行时 GM 全局约束;语法、格式、CSS、单测、构建和实际 E2E 已单独验证。