File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,6 +245,38 @@ describe('e2e', () => {
245245 } ,
246246 ) ;
247247 } ) ;
248+
249+ it ( 'returns blocked message when dialog is opened during tool execution' , async ( ) => {
250+ await withClient ( async client => {
251+ // Navigate to a page with a button that triggers a dialog on click
252+ await client . callTool ( {
253+ name : 'new_page' ,
254+ arguments : {
255+ url : `data:text/html,<button id="test" onclick="alert('test dialog')">Click me</button>` ,
256+ } ,
257+ } ) ;
258+
259+ const snapshotResult = await client . callTool ( {
260+ name : 'take_snapshot' ,
261+ arguments : { } ,
262+ } ) ;
263+
264+ const snapshotText = ( snapshotResult . content as TextContent [ ] ) [ 0 ] . text ;
265+ const match = snapshotText . match ( / u i d = ( \d + _ \d + ) \s + b u t t o n " C l i c k m e " / ) ;
266+ const uid = match ? match [ 1 ] : '1_1' ;
267+
268+ // Trigger the dialog
269+ const result = await client . callTool ( {
270+ name : 'click' ,
271+ arguments : {
272+ uid
273+ } ,
274+ } ) ;
275+
276+ const content = result . content as TextContent [ ] ;
277+ assert . match ( content [ 0 ] . text , / \[ B l o c k e d \] A c t i o n t r i g g e r e d a d i a l o g \. / ) ;
278+ } ) ;
279+ } ) ;
248280} ) ;
249281
250282async function getToolsWithFilteredCategories (
You can’t perform that action at this time.
0 commit comments