Fix clipped assertView screenshots in offset iframes - #1334
Merged
Merged
Conversation
commit: |
✅ Testplane E2E run succeed
|
✅ Testplane browser-env run succeed
|
DudaGod
force-pushed
the
INFRADUTY-30657.reproduce_iframe_assert_view
branch
from
September 25, 2026 06:34
8143c0a to
1cde2e4
Compare
DudaGod
marked this pull request as ready for review
September 25, 2026 06:39
DudaGod
commented
Sep 25, 2026
| } | ||
|
|
||
| export function getMainWindow(): Window { | ||
| return getMainDocumentElem().ownerDocument.defaultView ?? window; |
Member
Author
There was a problem hiding this comment.
getMainWindow() finds the window of the top page. getMainDocumentElem() goes up from the current iframe through the parent iframes to the top document, and ownerDocument.defaultView returns its window
| </style> | ||
| </head> | ||
| <body> | ||
| <iframe id="frame" src="offset-iframe-content.html"></iframe> |
Member
Author
There was a problem hiding this comment.
render iframe with margin left: 300px in order to correctly check that screenshot starts from correct position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After using
switchToFrame, the target rectangle is expressed in top-level window coordinates, while the viewport size and scroll offset were read from the iframe. With a 900 px wide iframe offset by 300 px, this clipped 300 px from the right side of the screenshot.I now read the viewport size, scroll offset, and clipping bounds from the top-level window. The E2E checks the full-width gradient inside the offset iframe.