browser-test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Browser Test

浏览器测试

Automated UI testing. Now backed by a recorded RVF session container instead of an ephemeral run, so every test produces a replayable artifact.
自动化UI测试。现在由录制的RVF会话容器提供支持,而非临时运行的测试,因此每次测试都会生成一个可回放的工件。

When to use

适用场景

  • Verifying UI functionality, user flows, or that frontend changes work in a real browser.
  • Producing a baseline session that future regressions can diff against.
  • Re-running a stored test session when CI fails (no need to re-author the test).
  • 验证UI功能、用户流程,或前端变更在真实浏览器中的运行情况。
  • 生成基准会话,供后续回归测试进行对比。
  • 当CI失败时,重新运行存储的测试会话(无需重新编写测试用例)。

Steps

步骤

  1. Record the test run by composing
    browser-record
    :
    • Allocates an RVF container with
      --kind browser-session
      .
    • Begins a ruvector trajectory.
  2. Drive interactions
    browser_open
    ,
    browser_click
    ,
    browser_fill
    ,
    browser_type
    ,
    browser_select
    . Each action emits a
    trajectory-step
    .
  3. Wait for elements / network idle via
    browser_wait
    before assertions.
  4. Validate with
    browser_get-text
    /
    browser_get-value
    /
    browser_get-title
    /
    browser_get-url
    . Validation outcomes go into
    findings.md
    inside the RVF container.
  5. Screenshot before / after key interactions for visual regression. Filenames follow
    <step-id>.png
    .
  6. Snapshot the accessibility tree at navigation boundaries.
  7. End the session:
    trajectory-end --verdict pass|fail
    ,
    rvf compact
    , AgentDB index in
    browser-sessions
    .
  8. (Optional) Diff against
    --against <prior-session-id>
    : invoke
    browser-screenshot-diff
    to compare the new run with a baseline.
  1. 录制测试运行:整合
    browser-record
    功能:
    • 分配一个
      --kind browser-session
      类型的RVF容器。
    • 启动ruvector轨迹。
  2. 驱动交互——使用
    browser_open
    browser_click
    browser_fill
    browser_type
    browser_select
    。每个操作都会生成一个
    trajectory-step
  3. 等待:在断言前通过
    browser_wait
    等待元素加载或网络空闲。
  4. 验证:使用
    browser_get-text
    /
    browser_get-value
    /
    browser_get-title
    /
    browser_get-url
    进行验证。验证结果会存入RVF容器内的
    findings.md
    文件。
  5. 截图:在关键交互前后进行截图,用于视觉回归测试。文件名遵循
    <step-id>.png
    格式。
  6. 快照:在导航节点处捕获无障碍树快照。
  7. 结束会话:执行
    trajectory-end --verdict pass|fail
    rvf compact
    ,并在AgentDB的
    browser-sessions
    中建立索引。
  8. (可选)与
    --against <prior-session-id>
    进行对比
    :调用
    browser-screenshot-diff
    将新运行结果与基准版本进行比较。

Navigation

导航操作

  • browser_back
    /
    browser_forward
    for history navigation
  • browser_reload
    to refresh the page
  • browser_scroll
    to scroll to elements or coordinates
  • 使用
    browser_back
    /
    browser_forward
    进行历史导航
  • 使用
    browser_reload
    刷新页面
  • 使用
    browser_scroll
    滚动到指定元素或坐标

What changed from v0.1.0

与v0.1.0版本的差异

  • The skill no longer ends with
    browser_close
    alone — it ends with the session-end protocol.
  • Selectors discovered during the test land in
    browser-selectors
    (host:intent), so the next test can find them by embedding similarity.
  • Validation outputs pass
    aidefence_is_safe
    before any LLM-facing summary; injection-flagged content is quarantined to
    findings.md
    .
  • The same skill, used in CI, now produces an artifact that
    /ruflo-browser replay
    can re-drive.
  • 该技能不再仅以
    browser_close
    结束——而是通过会话结束协议来终止。
  • 测试过程中发现的选择器会存入
    browser-selectors
    (host:intent),以便下次测试通过嵌入相似度匹配找到它们。
  • 验证输出在生成面向LLM的摘要前会经过
    aidefence_is_safe
    检查;被标记为注入风险的内容会被隔离到
    findings.md
    中。
  • 同一技能在CI中使用时,现在会生成一个可通过
    /ruflo-browser replay
    重新驱动的工件。

Tips

小贴士

  • Use
    browser_wait
    before assertions to handle async rendering.
  • For visual regression, save the parent session id and pass
    --against <id>
    on the next run.
  • Use
    browser_eval
    for custom JavaScript assertions — but redact any returned strings via the
    aidefence_is_safe
    gate before logging.
  • 在断言前使用
    browser_wait
    来处理异步渲染。
  • 对于视觉回归测试,保存父会话ID并在下次运行时传入
    --against <id>
    参数。
  • 使用
    browser_eval
    进行自定义JavaScript断言——但在记录日志前,需通过
    aidefence_is_safe
    网关对返回的字符串进行脱敏处理。