chore: only include visible iframes, keep frame locators in own array (#60)

As discussed:

- hides invisible frames from snapshot
- keep our own frame locator array, so we don't rely on `page.frames()`
ordering to be stable
This commit is contained in:
Simon Knott
2025-03-27 20:22:44 +01:00
committed by GitHub
parent 1b18e31ffe
commit f033213618
5 changed files with 60 additions and 40 deletions

View File

@@ -427,7 +427,7 @@ test('stitched aria frames', async ({ server }) => {
params: {
name: 'browser_navigate',
arguments: {
url: 'data:text/html,<h1>Hello</h1><iframe src="data:text/html,<h1>World</h1>"></iframe>',
url: 'data:text/html,<h1>Hello</h1><iframe src="data:text/html,<h1>World</h1>"></iframe><iframe src="data:text/html,<h1>Should be invisible</h1>" style="display: none;"></iframe>',
},
},
});
@@ -438,14 +438,16 @@ test('stitched aria frames', async ({ server }) => {
content: [{
type: 'text',
text: `
- Page URL: data:text/html,<h1>Hello</h1><iframe src="data:text/html,<h1>World</h1>"></iframe>
- Page URL: data:text/html,<h1>Hello</h1><iframe src="data:text/html,<h1>World</h1>"></iframe><iframe src="data:text/html,<h1>Should be invisible</h1>" style="display: none;"></iframe>
- Page Title:
- Page Snapshot
\`\`\`yaml
- document [ref=s1e2]:
- heading \"Hello\" [level=1] [ref=s1e4]
- document [ref=f1s1e2]:
- heading \"World\" [level=1] [ref=f1s1e4]
# iframe src=data:text/html,<h1>World</h1>
- document [ref=f0s1e2]:
- heading \"World\" [level=1] [ref=f0s1e4]
\`\`\`
`,
}],