fix: additional fixes of the new assertView command#1282
Conversation
commit: |
✅ Testplane E2E run succeed
|
✅ Testplane browser-env run succeed
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f2d38ae50
ℹ️ 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".
| opts, | ||
| async currentState => { | ||
| if (currentState.captureSpecs.length === 0) { | ||
| if (iterations > 0) { |
There was a problem hiding this comment.
Require complete coverage before accepting disappeared targets
For a target that needs another scroll chunk and hides after the first scroll, iterations > 0 is true even though hasCapturedTheWholeArea is still false. Returning here makes _scrollThroughCaptureArea treat the empty spec list as finished, so CompositeImage renders only previously registered chunks and the lower part of the requested selector is never captured or compared; this can turn an incomplete capture into a passing/truncated baseline instead of an error.
Useful? React with 👍 / 👎.
| width: visualViewport.width as Length<"css", "x">, | ||
| height: visualViewport.height as Length<"css", "y"> |
There was a problem hiding this comment.
Normalize visual viewport dimensions before returning
When visualViewport exposes fractional CSS pixels, such as under pinch/page zoom, these raw dimensions flow through fromCssToDevice unchanged whenever DPR is an integer. Later screenshot cropping and PNG encoding assume integer image sizes (Image.crop stores actualWidth/actualHeight directly, and PNG IHDR writes integer widths), so these captures can fail or produce malformed buffers; round/floor the visual viewport size before returning it.
Useful? React with 👍 / 👎.
What's done?
This PR contains minor enhancements of the new assertView logic in Testplane 9: