Skip to content

fix(mcp): make verify tools work in iframes#39374

Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:frame_verify
Feb 24, 2026
Merged

fix(mcp): make verify tools work in iframes#39374
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:frame_verify

Conversation

@pavelfeldman
Copy link
Member

@pavelfeldman pavelfeldman commented Feb 23, 2026

const locator = frame.getByRole(params.role as any, { name: params.accessibleName });
if (await locator.count() > 0) {
const resolved = await locator._resolveForCode();
response.addCode(`await expect(page.${resolved}).toBeVisible();`);
Copy link
Member

Choose a reason for hiding this comment

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

should be resolved.first() in case of count > 1, otherwise it will throw

Copy link
Member Author

Choose a reason for hiding this comment

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

Throwing would be intended behavior.

const locator = frame.getByText(params.text).filter({ visible: true });
if (await locator.count() > 0) {
const resolved = await locator._resolveForCode();
response.addCode(`await expect(page.${resolved}).toBeVisible();`);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1082 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:96 › should batch watch updates `@windows-latest-node20`

36821 passed, 834 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "MCP"

1513 passed, 47 skipped


Merge workflow run.

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.

Bug: browser_verify_element_visible and browser_verify_text_visible cannot locate elements within iframe

2 participants