Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🛝 test: Stabilize MCP App Link Clicks (#16760)

lia-by-librechat[bot]50dbc0dbb81b
diff --git a/e2e/specs/mock/mcp-apps.spec.ts b/e2e/specs/mock/mcp-apps.spec.ts
index b36ab7bc77..cffe051db5 100644
--- a/e2e/specs/mock/mcp-apps.spec.ts
+++ b/e2e/specs/mock/mcp-apps.spec.ts
@@ -671,8 +671,19 @@ test.describe('MCP Apps full integration', () => {
expect(linkViewCsp).toContain("connect-src 'none'");
expect(linkViewCsp).toContain("frame-src 'none'");
+ const linkOuterFrame = page.locator('iframe[title="MCP App: show_link_app"]');
+ const linkButton = linkApp.getByTestId('open-link');
+ await app.getByTestId('call-tool').focus();
+ await expect(app.getByTestId('call-tool')).toBeFocused();
+ await outerFrame.scrollIntoViewIfNeeded();
+ await expect(linkOuterFrame).not.toBeInViewport();
+
+ // Settle both scroll levels before Chrome dispatches a click into the sibling sandbox.
+ await linkOuterFrame.scrollIntoViewIfNeeded();
+ await linkButton.scrollIntoViewIfNeeded();
+ await linkButton.boundingBox();
const popupPromise = page.waitForEvent('popup', { timeout: 30_000 });
- await linkApp.getByTestId('open-link').click();
+ await linkButton.click();
const openedPage = await popupPromise;
await openedPage.waitForLoadState('domcontentloaded');
expect(new URL(openedPage.url()).origin).toBe(MCP_APP_LINK_ORIGIN);