Skip to content

fix(report): compute total duration from task timing and show start/end tooltip#1761

Open
yuyutaotao wants to merge 2 commits intofix/timing-in-reportfrom
codex/fix-timing-calculation-and-add-tooltip
Open

fix(report): compute total duration from task timing and show start/end tooltip#1761
yuyutaotao wants to merge 2 commits intofix/timing-in-reportfrom
codex/fix-timing-calculation-and-add-tooltip

Conversation

@yuyutaotao
Copy link
Collaborator

Motivation

  • 修正报告页总时长计算,应该以所有任务的最早时间戳到最晚时间戳为准计算总时长,而不是简单累加或依赖单一字段。
  • 当用户把鼠标移到总时间上时,应显示工具提示(tooltip),告知最早时间与最晚时间。
  • 使用项目中统一的时间格式化方法来展示带毫秒的时间戳,避免重复实现。

Description

  • apps/report/src/components/sidebar/index.tsx 中新增 timingRange 计算,遍历 groupedDump.executions[].tasks[]timing.start/timing.end,得到 earliestlatestduration,并以 duration 作为总时长来源(有值时优先使用)。
  • totalTimeCost 的来源改为优先使用 timingRange.duration,若不存在则回退到 playwright_test_duration(保持向后兼容)。
  • 在总时间显示处用 Tooltip 包裹 timeCostStrElement,tooltip 内容展示 Start / End,使用 fullTimeStrWithMilliseconds 格式化时间戳。
  • fullTimeStrWithMillisecondspackages/visualizer/src/utils 导出(在 packages/visualizer/src/index.tsx 添加导出),以便在报告组件中复用统一的时间格式化方法。

Testing

  • 自动化测试:未执行任何自动化测试。
  • 手动/集成检查:无(仅按要求提交代码变更)。

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant