Skip to content

feat: improve and refactor screen-shooter and split it into 3 versions#1240

Merged
shadowusr merged 1 commit into
testplane@9from
users/shadowusr/TESTPLANE-672.screen-shooter-rewrite
Apr 19, 2026
Merged

feat: improve and refactor screen-shooter and split it into 3 versions#1240
shadowusr merged 1 commit into
testplane@9from
users/shadowusr/TESTPLANE-672.screen-shooter-rewrite

Conversation

@shadowusr
Copy link
Copy Markdown
Member

What's done?

  • There are now 3 types of screen-shooters:
    • Elements screenshooter
    • Page screenshooter
    • Viewport screenshooter
  • Elements screenshooter now includes various stability enhancements:
    • It can wait for unstable capture are to settle
    • It can retry if capture area moves or changes its size
    • It can capture elements with unstable sizes

Overall, we have 3 paths in elements screen shooter:

  1. "Happy" path, if element position is stable, we start capturing it right away. If element position/size changes, we go to (2).
  2. "Unstable" path. Here, we first verify area stability by doing this:
    1. Scroll through the whole area, saving capture area state at each offset, getting "left" checkpoints
    2. Do it again, getting "right" checkpoints
    3. Compare them, if they match, proceed, it means area changes its size, but deterministically
    4. If they don't, throw and try again
  3. Finally, there's "best effort" path in the end. If capture area is unstable in size and we can't get 100% correct screenshot, we do what we can and capture what's possible, but this screenshot may contain seams/black stripes. In practice though, it's rare.

These stability checks come with a perf cost. But for now, it's the only guaranteed way to handle highly complex and unstable pages even on exotic browsers like ios safari.

Example:
Screenshot 2026-04-14 at 5 08 49 PM

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88f77972a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/screen-shooter/elements-screen-shooter.ts
Comment thread src/browser/screen-shooter/full-page-screen-shooter.ts
Comment thread src/browser/screen-shooter/elements-screen-shooter.ts
@DudaGod DudaGod self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

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

Amazing contribution 🔥
Especially great that there are clear logs with the execution time everywhere.

Comment thread src/browser/commands/assert-view/index.js
Comment thread src/browser/commands/assert-view/index.js
Comment thread src/browser/commands/assert-view/index.js
Comment thread src/browser/commands/assert-view/index.js
Comment thread src/browser/screen-shooter/operations/pointer-events.ts
Comment thread src/browser/screen-shooter/elements-screen-shooter.ts
Comment thread src/browser/screen-shooter/full-page-screen-shooter.ts
@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-672.improve-camera-and-calibrator branch from 7730c91 to 8cc355f Compare April 18, 2026 22:26
Base automatically changed from users/shadowusr/TESTPLANE-672.improve-camera-and-calibrator to testplane@9 April 18, 2026 22:29
@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-672.screen-shooter-rewrite branch from 88f7797 to b270d47 Compare April 19, 2026 13:17
@shadowusr
Copy link
Copy Markdown
Member Author

Fixed remaining issues in #1242, to apply them on top of all other changes and reliably test everything at once (though i agree this approach is not ideal)

@shadowusr shadowusr merged commit 9afdc37 into testplane@9 Apr 19, 2026
2 of 8 checks passed
@shadowusr shadowusr deleted the users/shadowusr/TESTPLANE-672.screen-shooter-rewrite branch April 19, 2026 13:19
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 19, 2026

❌ Testplane browser-env run failed

Report

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