Skip to content

Commit 6e68783

Browse files
committed
fix(showcase): use pressSequentially instead of fill for sandboxed iframe input
fill() silently no-ops inside sandbox="allow-scripts" iframes on some Playwright/Chromium combos because the null origin blocks the set-value protocol message. The input.value stays empty, so the host-side evaluateExpression handler rejects it with "Unsupported characters" and the test never sees a console log. pressSequentially sends individual key events that always reach the input regardless of sandbox restrictions.
1 parent 5d14af9 commit 6e68783

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

showcase/integrations/google-adk/tests/e2e/open-gen-ui-advanced.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ test.describe("Open Generative UI (advanced)", () => {
184184
await sendPromptAndAwaitIframe(page, PROMPTS.inlineEval);
185185

186186
const frame = page.frameLocator('iframe[sandbox*="allow-scripts"]').first();
187-
await frame.locator("#in").fill("2 + 2");
187+
// `fill()` silently no-ops inside sandbox="allow-scripts" iframes on
188+
// some Playwright/Chromium combos (null origin blocks the set-value
189+
// protocol message). `pressSequentially` sends individual key events
190+
// that always reach the input regardless of sandbox restrictions.
191+
const input = frame.locator("#in");
192+
await input.click();
193+
await input.pressSequentially("2+2");
188194
await frame.locator("#go").click();
189195

190196
await expect

showcase/integrations/langgraph-python/tests/e2e/open-gen-ui-advanced.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ test.describe("Open Generative UI (advanced)", () => {
184184
await sendPromptAndAwaitIframe(page, PROMPTS.inlineEval);
185185

186186
const frame = page.frameLocator('iframe[sandbox*="allow-scripts"]').first();
187-
await frame.locator("#in").fill("2 + 2");
187+
// `fill()` silently no-ops inside sandbox="allow-scripts" iframes on
188+
// some Playwright/Chromium combos (null origin blocks the set-value
189+
// protocol message). `pressSequentially` sends individual key events
190+
// that always reach the input regardless of sandbox restrictions.
191+
const input = frame.locator("#in");
192+
await input.click();
193+
await input.pressSequentially("2+2");
188194
await frame.locator("#go").click();
189195

190196
await expect

showcase/integrations/langgraph-typescript/tests/e2e/open-gen-ui-advanced.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ test.describe("Open Generative UI (advanced)", () => {
184184
await sendPromptAndAwaitIframe(page, PROMPTS.inlineEval);
185185

186186
const frame = page.frameLocator('iframe[sandbox*="allow-scripts"]').first();
187-
await frame.locator("#in").fill("2 + 2");
187+
// `fill()` silently no-ops inside sandbox="allow-scripts" iframes on
188+
// some Playwright/Chromium combos (null origin blocks the set-value
189+
// protocol message). `pressSequentially` sends individual key events
190+
// that always reach the input regardless of sandbox restrictions.
191+
const input = frame.locator("#in");
192+
await input.click();
193+
await input.pressSequentially("2+2");
188194
await frame.locator("#go").click();
189195

190196
await expect

0 commit comments

Comments
 (0)