Files
orca/tests/e2e/browser-agent-input-focus-isolation.spec.ts
T
Neil cbc357f547 fix(browser): agent typing into a cross-site frame no longer borrows your keyboard (#29000)
* fix(browser): agent typing into a cross-site frame no longer borrows the user's focus

Keys and text for a focused cross-site iframe went through the focus-borrowing
fallback, because widget input reaches only the guest's own renderer. They now
go to that frame's own CDP target session, found by following the page's focus
through frame elements, which reaches the frame without touching the user's
focus. The proxy keeps those Orca-owned sessions' events from the agent's client.

* fix(browser): retry frame focus emulation after a failed enable

* fix(browser): retry a failed frame focus-emulation enable before sending input
2026-10-14 23:30:13 -07:00

41 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Agent browser input must reach its page without touching the user's keyboard focus (#20595).
* Runs hidden; browser-agent-input-focus-isolation-native.spec.ts repeats it in a visible window.
*/
import { test } from './helpers/orca-app'
import {
runAgentClicksScenario,
runAgentCrossSiteFrameScenario,
runAgentKeysScenario,
runAgentShortcutsScenario
} from './helpers/browser-agent-focus-scenarios'
test('agent keys and text reach the page without leaving the user’s terminal', async ({
orcaPage
}) => {
test.setTimeout(120_000)
await runAgentKeysScenario(orcaPage)
})
test('agent clicks and presses reach the page without leaving the user’s terminal', async ({
orcaPage
}) => {
test.setTimeout(120_000)
await runAgentClicksScenario(orcaPage)
})
test('agent shortcut keys stay in the page instead of running Orca shortcuts', async ({
orcaPage
}) => {
test.setTimeout(120_000)
await runAgentShortcutsScenario(orcaPage)
})
test('agent keys and text reach a focused cross-site frame without moving the user’s focus', async ({
orcaPage
}) => {
test.setTimeout(120_000)
await runAgentCrossSiteFrameScenario(orcaPage)
})