Skip to content

Fix clipped assertView screenshots in offset iframes - #1334

Merged
DudaGod merged 1 commit into
masterfrom
INFRADUTY-30657.reproduce_iframe_assert_view
Sep 28, 2026
Merged

DudaGod merged 1 commit into
masterfrom
INFRADUTY-30657.reproduce_iframe_assert_view

Conversation

@DudaGod

@DudaGod DudaGod commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1334

commit: 1cde2e4

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Testplane E2E run succeed

Report

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Testplane browser-env run succeed

Report

@DudaGod
DudaGod force-pushed the INFRADUTY-30657.reproduce_iframe_assert_view branch from 8143c0a to 1cde2e4 Compare September 25, 2026 06:34
@DudaGod
DudaGod marked this pull request as ready for review September 25, 2026 06:39
}

export function getMainWindow(): Window {
return getMainDocumentElem().ownerDocument.defaultView ?? window;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

render iframe with margin left: 300px in order to correctly check that screenshot starts from correct position

@DudaGod
DudaGod requested a review from shadowusr September 25, 2026 06:41

@shadowusr shadowusr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔥

@DudaGod
DudaGod merged commit e45e85e into master Sep 28, 2026
9 checks passed
@DudaGod
DudaGod deleted the INFRADUTY-30657.reproduce_iframe_assert_view branch September 28, 2026 14:10
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