Repository navigation
chore(test/manual): 抽出共用 CDP 原语,删掉历史叙事与重复骨架 - #15
Merged
Merged
Conversation
四份探针各自复制了一整套「找浏览器 / 起无头实例 / 连 CDP / 等 DevTools / 登录注入 Cookie / 收错误」,且正文夹着大量审计过程与历史判据(日期、§编号、修前读数、方案比较)。 - 新增 test/manual/cdp.mjs:只放不含判据的原语(findBrowser / Cdp / waitForDevTools / launchBrowser / loginAndSetCookie / collectErrors / createRecorder)。不是测试框架。 - 四份脚本改为 import 它,删掉重复骨架与历史叙事;每条真实行为断言**全部保留**: probe 36 条、probe-ui-v1 69 条、states 108 条(shoot 无断言)。 - 行数:6679 → 4746(-29%);断言一条未删。 - 修两处重写引入的回归:states 的 at() 调用缺 await(拿到 Promise 而非值); 「复选框焦点 Esc 退批量模式」被错误并进菜单 Esc 那段(首次 Esc 是关菜单,前置状态不同)。 - docs/ui.md §9:把 states.mjs 与共用 cdp.mjs 写进验证表。 未跑完整套件(仅手动跑四个脚本 + node --check + eslint)。
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
问题
四份手动探针各自复制了一整套「找浏览器 / 起无头实例 / 连 CDP / 等 DevTools / 登录注入 Cookie / 收错误」,正文里夹着大量审计过程与历史判据(日期、§编号、修前读数、方案比较)。
probe-ui-v1.mjs曾到 3248 行。改动
test/manual/cdp.mjs:只放不含判据的原语(findBrowser/Cdp/waitForDevTools/launchBrowser/loginAndSetCookie/collectErrors/createRecorder)。这不是测试框架。docs/ui.md§9:把states.mjs与共用cdp.mjs写进验证表。规模
test/manual四份脚本 6679 → 4746 行(-29%)。未达 50%:剩余体量约 55% 是页内 JS 模板串(每条断言依赖的真实 DOM 读写),再减只能删断言——已与维护者确认接受此比例、断言全保留。验证
对本地 dev server 实跑四份脚本,全部 exit 0:
probe.mjs(V2)problems=0;probe-ui-v1.mjs1440×900 与 390×844 均 findings=0;states.mjs全部断言通过;shoot.mjs出图完成。node --check+ eslint 均过。修掉重写引入的两处回归(at()缺await;「复选框焦点 Esc 退批量模式」被错误并进菜单 Esc 段)。