Skip to content

TE-12511: CLI-Capture - Fix 32767px screenshot height limit & per-viewport error isolation#506

Open
shrinishLT wants to merge 1 commit intoLambdaTest:stagefrom
shrinishLT:TE-12511
Open

TE-12511: CLI-Capture - Fix 32767px screenshot height limit & per-viewport error isolation#506
shrinishLT wants to merge 1 commit intoLambdaTest:stagefrom
shrinishLT:TE-12511

Conversation

@shrinishLT
Copy link
Copy Markdown
Contributor

@shrinishLT shrinishLT commented Apr 20, 2026

Summary

  • 32767px height cap: Pages taller than 32,767px (Safari/Firefox browser engine limit) now gracefully degrade to a viewport-based screenshot capped at 32,767px instead of crashing with Cannot take screenshot larger than 32767 pixels on any dimension
  • Per-viewport error isolation: A single viewport/browser screenshot failure no longer aborts remaining captures for that URL. Uses Promise.allSettled for browser-level parallelism and per-viewport try/catch within the loop.
  • Aligned with the existing fix in dotlapse-visual-ui-pixel

Files Changed

  • src/lib/constants.ts — Added MAXIMUM_POSSIBLE_PAGE_HEIGHT: 32767
  • src/lib/screenshot.ts — Added getMaxPageHeight() helper, height cap logic, per-viewport try/catch, Promise.allSettled in async capture

Test plan

  • Test smartui capture against a page with height > 32767px on Safari and Firefox — verify capped screenshot is produced with warning log
  • Test with Chrome (should not be affected, passes through normally)
  • Test with a multi-viewport config where one viewport is intentionally broken — verify remaining viewports still capture
  • Test parallel mode (--parallel) with a failing browser — verify other browsers complete
  • Verify existing capture flows (normal pages, mobile devices) are unaffected

JIRA: TE-12511

🤖 Generated with Claude Code

…t capture errors

- Cap fullPage screenshots to 32767px (browser engine limit for Safari/Firefox) instead of crashing
- Wrap each viewport capture in its own try/catch so one failure doesn't abort remaining viewports
- Use Promise.allSettled in async capture so one browser failure doesn't cancel other browsers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shrinishLT shrinishLT changed the title TE-12511: Fix 32767px screenshot height limit & per-viewport error isolation TE-12511: CLI-Capture - Fix 32767px screenshot height limit & per-viewport error isolation Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants