Skip to content

feat(all): reportMergingTool support single report#2112

Open
frank-mupt wants to merge 1 commit intomainfrom
fix/report-and-misc-improvements
Open

feat(all): reportMergingTool support single report#2112
frank-mupt wants to merge 1 commit intomainfrom
fix/report-and-misc-improvements

Conversation

@frank-mupt
Copy link
Collaborator

No description provided.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 10, 2026

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: dad246a
Status: ✅  Deploy successful!
Preview URL: https://236649f0.midscene.pages.dev
Branch Preview URL: https://fix-report-and-misc-improvem.midscene.pages.dev

View logs

Copy link
Collaborator

@quanru quanru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main concern: the new reportFilePath?: string flow is only implemented in ReportMergingTool, but it is not wired through the report viewer yet.

  1. mergeReports() now writes <script type="midscene_web_dump"> entries with an empty body when reportFilePath is missing. However, the viewer still treats every dump script as JSON and eagerly selects the first case on load. If the first case is skipped, dumps[0].get() falls back to a non-GroupedActionDump object and setGroupedDump() still reads dump.executions.length, which can crash the page before the new disabled-click guard has any chance to help.

  2. Related to that, the all skipped case is still broken in the viewer path. The new unit tests only assert that the merged HTML contains the expected attributes, but they do not verify that apps/report can actually load and render those merged reports.

  3. This also broadens the public type too much. Making reportFilePath optional for all ReportFileWithAttributes values allows invalid states such as passed + undefined reportFilePath. A narrower model would be safer here, for example a discriminated union for skipped/non-viewable cases instead of weakening the whole API.

Minor point: removing the old <= 1 guard also changes the 0 reports behavior. mergeReports() now creates and returns an empty template-only report when nothing was appended. I think supporting 1 report makes sense, but 0 report should probably still return null or throw explicitly.

@frank-mupt frank-mupt force-pushed the fix/report-and-misc-improvements branch from e7d8eff to 8007edb Compare March 17, 2026 08:14
@frank-mupt frank-mupt force-pushed the fix/report-and-misc-improvements branch from 8007edb to dad246a Compare March 18, 2026 08:49
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.

2 participants