跳到正文
Skillpedia
测试81k · #1582

browser-screenshot-diff

它能做什么

这项技能通过步骤 ID 配对两个已录制的浏览器会话,并检查截图和页面结构。适合需要发现两次运行之间视觉或内容变化的测试人员。

适用场景

  • ✓当界面改动本不应改变页面外观时。
  • ✓当你想确认重放的运行结果与原始记录一致时。
  • ✓当你想比较同一表单流程的两个版本时。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-browser/skills/browser-screenshot-diff/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-browser/skills/browser-screenshot-diff/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请比较改版前后的两段录制,并告诉我页面在哪些地方有差异。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体将两个会话的步骤配对,在每一步比较截图和页面结构,并报告第一处差异以及总体相似度得分。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Browser Screenshot Diff

Compare two recorded sessions step-by-step. Pairs each step in session A to the same step-id in session B, diffs the captured screenshot and accessibility snapshot, reports the first divergence and an aggregate similarity score.

When to use

  • Visual regression after a UI change (record before, record after, diff).
  • Verifying a browser-replay run matches the parent session within tolerance.
  • Comparing two A/B variants of the same form flow.

Steps

  1. Locate both RVF containers:
    npx -y ruvector@0.2.27 rvf status <session-id-a>.rvf
    npx -y ruvector@0.2.27 rvf status <session-id-b>.rvf
    
  2. Load both trajectories from trajectory.ndjson. Build a step-id → (screenshot_path, snapshot_path) map for each.
  3. Pair steps by step-id. Steps that exist on only one side are flagged as unmatched and contribute to the divergence score.
  4. Pixel diff (--mode pixel|both): compare the two PNGs at each step. Report mse, psnr, and the bounding box of the largest diff cluster. Threshold default 0.02 (2% of pixels).
  5. DOM diff (--mode dom|both): compare the accessibility snapshots node-by-node. Report added / removed / changed nodes with their accessible names.
  6. Aggregate similarity: weighted average across matched steps, weighted by step duration. Verdict goes into a new findings.md under a fresh RVF container so the diff itself is replayable.
  7. Persist the diff verdict in browser-sessions under both source ids' tags so future searches surface "ran a diff against session X".

Caveats

  • Pixel diff is sensitive to font hinting, antialiasing, and scrollbar position. Keep viewport pinned across both sessions.
  • DOM diff over Playwright's accessibility tree is more stable than HTML diff. Prefer it.
  • This skill does not handle dynamic content (clocks, ads); add ignore regions to the field map or pre-process snapshots before diffing.
  • The browser_screenshot_diff MCP tool is not planned (ADR-0001 §7); the skill operates against locally-saved RVF artifacts and uses browser_eval only for live verification.
常见问题

它比较什么?

它逐像素比较截图,并逐个节点比较页面结构。

如果某一步只出现在一个会话中怎么办?

这项技能会将其标记为未匹配,并计入相似度得分的扣分。

结果会保存在哪里?

这项技能会把发现报告写入会话容器中。

详情

作者的原始描述

Visual + DOM diff between two recorded sessions at matching trajectory step ids; used for visual regression and replay verification

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1582
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能