Skip to content

fix(wework): route desktop scenario captures through the platform-aware helper - #2253

Merged
qdaxb merged 1 commit into
mainfrom
fix/wework-e2e-scenario-capture-linux
Jul 27, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/wework-e2e-scenario-capture-linux

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

问题

Wework Desktop E2E (Core) 在 Linux 上报错:

Error: Main webview snapshots are currently supported on macOS only

根因

#2250 把 e2e:desktop 改为始终加载 streaming-text 场景。场景内的 capture() 直接调用 webview 的 capture 控制命令,底层走 Tauri 的 capture_main_webview,而该命令只在 macOS 上实现(desktop_capture.rs)。Linux Core 任务在场景末尾截图时因此失败。

修复

把 runner 中已有的平台感知截图助手 captureVerificationScreenshot(Linux 用 ImageMagick import -window root,macOS 用 webview 快照)通过 createDesktopScenario 选项注入,三个桌面场景(streaming-text / cloud-space-mention / conversation-mention)统一改走该助手,删除各自重复的 capture() 实现。

验证

  • pnpm --filter wework test:222 个测试文件、2223 个用例全部通过
  • ESLint / Prettier / TypeScript 检查通过
  • 本地 macOS 实机跑了 e2e:desktop:streaming-text:新截图链路正常工作(streaming-text-00-ready-to-send.png 成功产出);后续在 waitFor 阶段超时,已用未修改的 origin/main 对照复现同样失败(本地 codex-cli 0.144.5 未转发模型请求,0 条 model requests),确认与本次改动无关
  • pre-push 全量检查通过

Summary by CodeRabbit

  • Tests
    • Improved desktop end-to-end test screenshot capture through a shared mechanism.
    • Added more consistent screenshots for conversation mentions, including menu, selected conversation, and sent states.
    • Preserved existing request validation and streaming-text verification coverage.

…re helper

The desktop scenarios called the webview capture command directly, which
invokes the macOS-only capture_main_webview Tauri command. Since
e2e:desktop now always loads the streaming-text scenario, the Linux Core
job failed with 'Main webview snapshots are currently supported on macOS
only'. Pass the runner's captureVerificationScreenshot into scenarios so
captures use ImageMagick on Linux and webview snapshots on macOS.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b5e8625-ee89-4ce9-af1f-68cdab2b0dba

📥 Commits

Reviewing files that changed from the base of the PR and between aa74cfc and b27e431.

📒 Files selected for processing (4)
  • wework/e2e/desktop/scenarios/cloud-space-mention.scenario.mjs
  • wework/e2e/desktop/scenarios/conversation-mention.scenario.mjs
  • wework/e2e/desktop/scenarios/streaming-text.scenario.mjs
  • wework/e2e/desktop/task-flow.e2e.mjs

📝 Walkthrough

Walkthrough

Desktop E2E scenarios no longer write screenshots directly. They accept an injected captureScreenshot callback, use workbench selectors, and route capture requests through task-flow.e2e.mjs to the shared verification screenshot implementation.

Changes

Desktop screenshot capture

Layer / File(s) Summary
Scenario capture API migration
wework/e2e/desktop/scenarios/*
Scenario factories accept captureScreenshot, remove direct filesystem writes, and update screenshot calls across cloud-space, conversation-mention, and streaming-text flows.
Desktop runner capture wiring
wework/e2e/desktop/task-flow.e2e.mjs
loadDesktopScenario receives a callback that forwards capture requests to captureVerificationScreenshot.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: micro66

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: desktop scenario screenshot captures now use the platform-aware helper.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-e2e-scenario-capture-linux

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb merged commit dda3bc6 into main Jul 27, 2026
33 checks passed
@qdaxb
qdaxb deleted the fix/wework-e2e-scenario-capture-linux branch July 27, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant