Skip to content

Commit 134115c

Browse files
committed
test(web): drive hover @ref in the provider-backed web scenario
The integration-progress gate requires every public command to be referenced by a provider-backed scenario. Add hover @ref to the web desktop flow: it must reach the provider's hoverRef handle (never a coordinate) and be recorded on the session without fabricated x/y, like click @ref.
1 parent e95941d commit 134115c

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

test/integration/provider-scenarios/web-desktop.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@ test('Provider-backed integration web desktop flow uses semantic web provider ca
8282
positionals: ['text', 'Ready', '100'],
8383
expectData: { text: 'Ready' },
8484
},
85+
{
86+
// #1783: hover @ref on web rides the provider element handle
87+
// (hoverRef), never a coordinate — web ref frames carry no rects.
88+
name: 'hover submit ref',
89+
command: 'hover',
90+
positionals: ['@e4'],
91+
expectData: { ref: 'e4', gesture: 'hover' },
92+
assert: (response) => {
93+
const data = response.json?.result?.data;
94+
assert.equal(data?.x, undefined);
95+
assert.equal(data?.y, undefined);
96+
assert.equal(data?.message, 'Hovered @e4');
97+
},
98+
},
99+
{
100+
// ADR 0014: the ref hover above expired the frame; re-observe
101+
// before the next ref mutation.
102+
name: 're-observe before the ref click',
103+
command: 'snapshot',
104+
flags: { snapshotInteractiveOnly: true },
105+
},
85106
{
86107
name: 'click submit ref',
87108
command: 'click',
@@ -149,6 +170,16 @@ test('Provider-backed integration web desktop flow uses semantic web provider ca
149170
]);
150171

151172
const actions = daemon.session()?.actions ?? [];
173+
assert.ok(
174+
actions.some(
175+
(action) =>
176+
action.command === 'hover' &&
177+
action.positionals.join(' ') === '@e4' &&
178+
action.result?.x === undefined &&
179+
action.result?.y === undefined,
180+
),
181+
'Expected ref hover action to be recorded on the session without fabricated coordinates',
182+
);
152183
assert.ok(
153184
actions.some(
154185
(action) =>
@@ -183,6 +214,7 @@ test('Provider-backed integration web desktop flow uses semantic web provider ca
183214
assertFlatToolCall(semanticCalls, ['web', 'open', WEB_URL, '']);
184215
assertFlatToolCall(semanticCalls, ['web', 'recordStart', recordingPath]);
185216
assertFlatToolCall(semanticCalls, ['web', 'snapshot', 'true', '']);
217+
assertFlatToolCall(semanticCalls, ['web', 'hoverRef', '@e4']);
186218
assertFlatToolCall(semanticCalls, ['web', 'clickRef', '@e4']);
187219
assertFlatToolCall(semanticCalls, ['web', 'fillRef', '@e3', 'qa@example.test', '1']);
188220
assertFlatToolCall(semanticCalls, ['web', 'type', ' ok', '0']);

test/integration/provider-scenarios/web-world.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ export async function createWebDesktopWorld(): Promise<WebDesktopWorld> {
8383
state.statusText = 'Submitted';
8484
}
8585
},
86+
hover: async (x, y) => {
87+
semanticCalls.push(['web', 'hover', String(x), String(y)]);
88+
},
89+
hoverRef: async (ref) => {
90+
semanticCalls.push(['web', 'hoverRef', ref]);
91+
},
8692
fill: async (x, y, text, options) => {
8793
semanticCalls.push([
8894
'web',

0 commit comments

Comments
 (0)