Skip to content

fix(core): support directory mode reports in mergeReports#2019

Open
quanru wants to merge 1 commit intomainfrom
fix/directory-mode-merge-reports
Open

fix(core): support directory mode reports in mergeReports#2019
quanru wants to merge 1 commit intomainfrom
fix/directory-mode-merge-reports

Conversation

@quanru
Copy link
Collaborator

@quanru quanru commented Feb 14, 2026

Summary

  • Fix [Bug]: Using large file report configurations and report merging together can cause issues #2011: mergeReports() now correctly handles html-and-external-assets (directory mode) reports
  • Copies screenshot files from source reports to merged output's screenshots/ directory
  • Outputs merged report as {name}/index.html when any source is directory mode
  • Injects <base> URL fix script for both single and merged directory-mode reports to handle static server clean URL resolution (e.g. npx serve)

Test plan

  • Added unit tests for directory mode merge with screenshot copying
  • Added unit tests for rmOriginalReports with directory mode (deletes entire directory)
  • Added browser parse simulation tests verifying full data roundtrip
  • Verified with real PNG screenshots in browser via npx serve
  • All 11 existing + new tests pass

When reports are generated with `outputFormat: 'html-and-external-assets'`,
mergeReports now correctly copies screenshot files and outputs as directory
mode. Also injects a `<base>` URL fix script for both single and merged
directory-mode reports to handle static server clean URL resolution.
@cloudflare-workers-and-pages
Copy link

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: cb3830e
Status: ✅  Deploy successful!
Preview URL: https://c69ed500.midscene.pages.dev
Branch Preview URL: https://fix-directory-mode-merge-rep.midscene.pages.dev

View logs

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.

[Bug]: Using large file report configurations and report merging together can cause issues

1 participant