Repository navigation
test(desktop): follow the new / and model menus in composer journeys - #5274
Conversation
#5093 drops the leading slash from / menu names and turns the empty composer placeholder into @ and / hints. #5247 stages quick model menu choices until an outside click or Cmd/Ctrl+Enter, and Escape discards them. Three journeys still expected the old names, the old placeholder and a menu that applies on click, so they failed on main. Locate / menu options by their visible names, expect the new default placeholder, and commit each quick model menu choice before checking the model pill: once with an outside click and otherwise with Cmd/Ctrl+Enter.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Route file download and session media URL calls through a sessionSync route that answers from the current owner without a session load (MoonshotAI#5336). Add thoughtsTokenCount to the Google GenAI output usage with thinking and zero-thinking fixtures (MoonshotAI#5334), update the desktop composer e2e specs for the label-only slash menu (MoonshotAI#5274), and document the Bash session/workspace env vars (MoonshotAI#5053).
Requirement or Bug
Resolve #5265
main 在
7746b1621的 push 运行(run 45126564648)里有 3 个 Desktop E2E 旅程失败。失败来自 #5093 和 #5247 两次有意的界面改动:它们没改旅程文件,PR 阶段按选测规则不跑全量旅程,所以合入 main 后才暴露。这个 PR 让 3 个旅程跟上新的界面契约,main 恢复通过后,跑全量旅程的 PR 不会再看到同样的失败。Bug Reproduction Steps
See linked issue。本地在 main 上运行即可复现:
Root Cause
产品没有 bug,是旅程里的定位和期望还停在旧界面上。这是根本修复:按有意改变的契约更新旅程,不回退产品行为。
turn-esc-layering.spec.ts:44/菜单里找不到/^\/compact /选项/菜单的显示名去掉开头的/,/compact显示成compactcomposer-commands.spec.ts:29、33–35/new、/status等带斜杠的名字找选项composer-commands.spec.ts:98(修好上一行后才暴露)Type a message…Type @ to reference files, or start with / for commands and skillscomposer-placeholder-hints.mdcomposer-drafts-models.spec.ts:98Swift Stub后,模型按钮 15 秒内没有变第三个旅程的定位过程:CI trace 显示对
Swift Stub的点击已执行完,但 Electron 日志里此后没有任何切换模型的请求;失败时的页面快照里模型按钮仍是stub,并且aria-expanded为 true,菜单还开着。对照 #5247 的实现,原生菜单的模型行带keepOpen,只有原因为dismiss的关闭才会提交暂存的选择。原 spec 在改完思考档位后按 Esc 关菜单,按新契约这会直接放弃选择,所以这几处也要一起改。同期合入的 #5260 只调整了完整的 "Switch model" 对话框里 provider 标签的顺序,和这次失败无关。
Code Changes
只改了三个旅程文件,没有改产品代码。
turn-esc-layering.spec.ts、composer-commands.spec.ts:/菜单的选项按不带斜杠的可见名字定位(/^compact /,BUILT_INS去掉斜杠);退出 plan 模式后,期望占位文字变回新的默认提示。composer-drafts-models.spec.ts:在快捷模型菜单里每做一次选择,都显式提交后再检查模型按钮:两种提交方式都覆盖到了:第一次用用户最常走的"在菜单外点击",其余用 Cmd/Ctrl+Enter。原有断言全部保留,只是"模型按钮已变化"挪到了提交之后;另外加了一条"选择后菜单里已勾选"的断言,确认选择是先暂存、后提交的。
另外,已隔离的
settings-appearance.spec.ts第 118 和 154 行也断言了旧的占位文字。它在 #5093 之前就因别的原因被隔离(见tests/quarantine.yaml),这个 PR 没有改它;解除隔离时需要一并更新这两处期望。Behavior Changes and Affected Users
None。只改了
apps/desktop/e2e/下的三个旅程文件,没有改产品代码、配置或契约文件;测试改动不需要 changeset。turn-esc-layering/后出现命令菜单,Esc 先关菜单,不会停止运行中的回合composer-commands/菜单列出内置命令并随输入过滤;退出 plan 模式后占位文字回到默认提示composer-drafts-models验证
pnpm --filter kimi-code-app run e2e:headless e2e/turn-esc-layering.spec.ts e2e/composer-commands.spec.ts e2e/composer-drafts-models.spec.ts --repeat-each=2,3 个旅程各跑两遍都通过(连同它们依赖的 smoke 和 gate 项目)。pnpm lint以 0 退出;apps/desktop的tsc --noEmit(包含e2e/)通过。pnpm run check:duplication没有新增重复。ControlOrMeta在 Windows 上映射为 Ctrl,产品端 Ctrl 和 Cmd 都接受。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.